1

I'm trying to compile GMP for android (arm) but I'm received a very strange error. First, I set up a few things as described another SO question here:

    export NDKROOT=/prod/ndk
    $NDKROOT/build/tools/make-standalone-toolchain.sh --platform=android-9 --  install-dir=$NDKROOT/android_armeabi   
    export CC="$NDKROOT/android_armeabi/bin/arm-linux-androideabi-gcc --sysroot=$NDKROOT/android_armeabi/sysroot"
    export CXX="$NDKROOT/android_armeabi/bin/arm-linux-androideabi-g++ --sysroot=$NDKROOT/android_armeabi/sysroot"
    export AR="$NDKROOT/android_armeabi/bin/arm-linux-androideabi-ar"
    export SYSROOT="$NDKROOT/android_armeabi/sysroot"
    export PATH="$NDKROOT/android_armeabi/bin":$PATH

Then I simply run ./configure --enable-cxx --prefix=/local/to/where/i/want/to/install --host=arm-none-linux-gnueabi and configuration goes well, with the following being part of the output:

      Version:           GNU MP 5.1.1
      Host type:         arm-none-linux-gnueabi
      ABI:               standard
      Install prefix:    /location/to/where/i/want/to/install
      Compiler:          /prod/ndk/android_armeabi/bin/arm-linux-androideabi-gcc --   sysroot=/prod/ndk/android_armeabi/sysroot -std=gnu99
      Static libraries:  yes
      Shared libraries:  yes

Up to here it goes well, but when I run make, I receive the following error:

    ismpf.cc: In function 'std::istream& operator>>(std::istream&, mpf_ptr)':
    ismpf.cc:48:43: error: 'struct lconv' has no member named 'decimal_point'
    make[2]: *** [ismpf.lo] Error 1
    make[2]: Leaving directory `~/Downloads/gmp-5.1.1/cxx'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `~/Downloads/gmp-5.1.1'
    make: *** [all] Error 2

So my first problem is there. Any ideas?

Just out of curiosity, I tried to rerun the same exact configure command as above but using sudo ahead of it. After a few seconds I receive the following:

    configure: error: Oops, mp_limb_t is 64 bits, but the assembler code
    in this configuration expects 32 bits.

There is the second (and really weird problem that arises).

Just out of curiosity again, I tried to reboot and clear all the variables we created, and simply run the command that the GMP manual recommends: ./configure --prefix=/location/ --enable-cxx --host=arm-linux-androideabi

The ./configure runs, the make goes well, but all 9/9 tests fail when I do make check. Can anybody point me in the right direction with these errors, or about how to try and correctly compile GMP for android? Any help is immensely appreciated.

Community
  • 1
  • 1
shblsh
  • 81
  • 1
  • 9
  • Have you tried `./configure ABI=32 -prefix=/location/ --enable-cxx --host=arm-linux-androideabi`? There might be some bug which causes the ABI parameter to be equal to 64... – Mihai Todor Jun 07 '13 at 11:55
  • Yes indeed I have, but it says that ABI=32 is not recognized, and it shows a list of recognized options. The list though is just "standard". That's all, so I either put ABI=standard, or I don't put anything at all. It still doesn't work. – shblsh Jun 07 '13 at 17:15
  • You say 9/9 tests fail, but you don't name those tests or say how they fail, that's not very helpful. As for the lconv issue, it is a known android bug that AFAICS they won't fix. We might work around it in GMP some day, but I am in no hurry to do so myself. Just replace `localeconv()->decimal_point` with `"."` in ismpf.cc. – Marc Glisse Jun 08 '13 at 12:36
  • The lconv issue is now fixed in the development version of GMP (future 5.2). – Marc Glisse Jul 02 '13 at 07:58

1 Answers1

0

Unsetting the CFLAGS env var solved the problem for me.

MNM
  • 1