55

I am trying to create an Android package of my Kivy application using buildozer but I am getting this error when I try to include the numpy:

resume of the error:

compile options: '-DNO_ATLAS_INFO=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-2.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/include -I/home/joao/github/buildozer/.buildozer/android/platform/python-for-android/build/python-install/include/python2.7 -Ibuild/src.linux-x86_64-2.7/numpy/core/src/multiarray -Ibuild/src.linux-x86_64-2.7/numpy/core/src/umath -c'
ccache: numpy/linalg/lapack_litemodule.c
ccache: numpy/linalg/python_xerbla.c
/usr/bin/gfortran -Wall -lm build/temp.linux-x86_64-2.7/numpy/linalg/lapack_litemodule.o build/temp.linux-x86_64-2.7/numpy/linalg/python_xerbla.o -L/usr/lib -L/home/joao/github/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib -Lbuild/temp.linux-x86_64-2.7 -llapack -lblas -lpython2.7 -lgfortran -o build/lib.linux-x86_64-2.7/numpy/linalg/lapack_lite.so
/usr/bin/ld: build/temp.linux-x86_64-2.7/numpy/linalg/lapack_litemodule.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: build/temp.linux-x86_64-2.7/numpy/linalg/lapack_litemodule.o: Relocations in generic ELF (EM: 40)
build/temp.linux-x86_64-2.7/numpy/linalg/lapack_litemodule.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
/usr/bin/ld: build/temp.linux-x86_64-2.7/numpy/linalg/lapack_litemodule.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: build/temp.linux-x86_64-2.7/numpy/linalg/lapack_litemodule.o: Relocations in generic ELF (EM: 40)
build/temp.linux-x86_64-2.7/numpy/linalg/lapack_litemodule.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
unable to execute _configtest: Exec format error
error: Command "/usr/bin/gfortran -Wall -lm build/temp.linux-x86_64-2.7/numpy/linalg/lapack_litemodule.o build/temp.linux-x86_64-2.7/numpy/linalg/python_xerbla.o -L/usr/lib -L/home/joao/github/buildozer/.buildozer/android/platform/python-for-android/build/python-install/lib -Lbuild/temp.linux-x86_64-2.7 -llapack -lblas -lpython2.7 -lgfortran -o build/lib.linux-x86_64-2.7/numpy/linalg/lapack_lite.so" failed with exit status 1

does anyone knows how to solve it?

P.S. I am using Ubuntu 14.04 64-bit

João Abrantes
  • 4,772
  • 4
  • 35
  • 71
  • Can you post the full buildozer log (everything after typing 'buildozer android debug')? – inclement Apr 20 '15 at 11:00
  • perhaps go to kivy user support group(google that it's a google group) and post your issue there. You can attach the full buildozer log as a file. – Totem Apr 20 '15 at 14:47
  • @Totem i have included now the whole log file in the post – João Abrantes Apr 20 '15 at 15:13
  • 2
    Do you know for a fact that this library can be compiled and link in the Android environment? What directions are you using? – hpaulj Apr 24 '15 at 05:01
  • @hpaulj yes I know that, kivy users have done it before many times. But maybe they haven't done it with 64-bit OS.. – João Abrantes Apr 24 '15 at 06:59
  • 5
    What system architecture are you targeting (I'm guessing it's probably something ARM-based)? It looks like numpy's C extensions are still being built for x86_64, i.e. they are not being properly cross-compiled for ARM. – ali_m Apr 24 '15 at 13:16
  • @ali_m: For the record, I think the x86_64 thing is misleading, as the arm build is set up via environment variables that setup.py doesn't recognise, so it names the folders this way even though the compilation may be targeting the right architecture. – inclement Jun 16 '15 at 17:58
  • @inclement I don't know... `Relocations in generic ELF (EM: 40)` is usually a dead giveaway that something is not being correctly cross-compiled. @JoaoAbrantes: I see that you posted the full build log, but the link now seems to be broken. Could you fix it? – ali_m Jun 16 '15 at 18:05
  • @ali_m i fixed the link. Not sure if the log.txt is the exactly same as before but i think so – João Abrantes Jun 16 '15 at 19:01
  • @JoãoAbrantes That looks like a totally different error. Based on the log, my guess as to what's happening now is that numpy's `setup.py` finds your system-wide installations of `libf77blas.so`, `libcblas.so` and `libatlas.so`, but the linker can't link them to the `_dotblas.so` you've just compiled, since the system-wide libraries are compiled for x86_64, whereas `_dotblas.so` has been compiled for ARM. Could you call `$ buildozer clean`, then confirm that you see the same errors if you build again? – ali_m Jun 16 '15 at 19:35
  • @ali_m yes sorry.. I cannot find the log that I posted originally and the server where it was hosted deleted my files. I made a big pause in my kivy project so I don't have time to replicate the error. Other users with the same error are more then welcome to upload their full log and edit my question. – João Abrantes Jun 17 '15 at 11:23

1 Answers1

10

Try sudo apt-get install libatlas-base-dev it looks like you're missing some libraries

Dr.Knowitall
  • 10,080
  • 23
  • 82
  • 133
  • sorry I can't test it in the next month... but if it gets more than 10 upvotes I will assume it worked for 10 people and accept it. – João Abrantes Jun 23 '15 at 10:58