0

I have tried to install GMP Library Version 6.1.0 for iOS9. I need to compile GMP in iOS for a math project. My configuration command was like this.

./configure CC=clang CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -E" CPPFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/ -fembed-bitcode -miphoneos-version-min=7.0 -arch armv7 -target arm-apple-darwin" --host=aarch64-apple-darwin --disable-assembly --enable-static --disable-shared --disable-thread-safe --enable-cxx

Found this configure option in :This link. Here is my environment details: Mac OSX 10.11.2; Xcode7.2; iOS SDK 9.2

During "configure" state it shows one warning

configure: WARNING: unrecognized options: --disable-thread-safe 

But it configures without any error. Configure summary:

configure: summary of build options:

Version:           GNU MP 6.1.0 
Host type:         aarch64-apple-darwin
ABI:               standard 
Install prefix:    /usr/local 
Compiler:          clang
Static libraries:  yes
Shared libraries:  no

After that I run make command. Then make check. While running make check command it gives the following error.

enter image description here

or, in text form:

/bin/sh ../libtool  --tag=CC   --mode=link clang  -mfpu=neon -O2 -pedantic -DNO_ASM   -o t-bswap t-bswap.o libtests.la ../libgmp.la
libtool: link: clang -mfpu=neon -O2 -pedantic -DNO_ASM -o t-bswap t-bswap.o ./.libs/libtests.a [redacted]/Documents/gmp-6.1.0/.libs/libgmp.a ../.libs/libgmp.a
ld: warning: ld: warning: ignoring file ./.libs/libtests.a, file was built for archive which is not the architecture being linked (x86_64): ./.libs/libtests.aignoring file t-bswap.o, file was built for armv7 which is not the architecture being linked (x86_64): t-bswap.o

ld: warning: ignoring file [redacted]/Documents/gmp-6.1.0/.libs/libgmp.a, file was built for archive which is not the architecture being linked (x86_64): /Users/[redacted]/Documents/gmp-6.1.0/.libs/libgmp.a
ld: warning: ignoring file ../.libs/libgmp.a, file was built for archive which is not the architecture being linked (x86_64): ../.libs/libgmp.a
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [t-bswap] Error 1
make[3]: *** [check-am] Error 2
make[2]: *** [check-recursive] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check] Error 2

I am stuck here. Your help is highly appreciated. [EDITED]

Community
  • 1
  • 1
eNipu
  • 25
  • 1
  • 8
  • Please format the error message correctly and also show what was before "undefined symbols", an error message is almost useless without the line that caused it. Also say what commands you used (did you run `make` before `make check`?) If you are cross-compiling, unless you tell GMP how to use an emulator, `make check` doesn't make that much sense. – Marc Glisse Dec 18 '15 at 06:55
  • The flags you write in CPPFLAGS are only used for compiling, not linking. As long as you are only building a static library, that doesn't matter, but if you start using it (tests), it does. You could duplicate most of those flags in LDFLAGS. I usually simply put them directly in `CC="clang -target arm-apple-darwin ..."` so I dont have to think of where to repeat them. I don't think your CPP is needed at all. You could also just skip the `make check` step, it isn't necessary and is most useful for native builds. – Marc Glisse Dec 19 '15 at 08:50
  • Please don't use images of text without also providing the actual text. People will search Google for error messages. Since your error messages aren't in text at all[, they aren't available to Google, and so the people searching won't find this topic. – Olathe Dec 29 '15 at 06:35

0 Answers0