Skip to content

Build error to import shapely (libgeos) #1311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mawady opened this issue Jul 15, 2018 · 1 comment
Closed

Build error to import shapely (libgeos) #1311

mawady opened this issue Jul 15, 2018 · 1 comment

Comments

@mawady
Copy link

mawady commented Jul 15, 2018

I am trying to build an android using Shapely
Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=client --bootstrap=sdl2 --requirements=kivy,pil,android,numpy,opencv,libgeos,shapely --arch armeabi-v7a --copy-libs --color=always --storage-dir=/app/.buildozer/android/platform/build

The output is as follows:
libtool: link: /usr/bin/ccache arm-linux-androideabi-g++ -DANDROID -mandroid -fomit-frame-pointer -D__ANDROID_API__=19 -I/root/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -isysroot /root/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -I/app/.buildozer/android/platform/build/build/python-installs/mobileclient/include/python2.7 -fPIC -DPIC -shared -nostdlib crtbegin_so.o .libs/inlines.o -Wl,--whole-archive algorithm/.libs/libalgorithm.a geom/.libs/libgeom.a geomgraph/.libs/libgeomgraph.a index/.libs/libindex.a io/.libs/libio.a linearref/.libs/liblinearref.a noding/.libs/libnoding.a operation/.libs/liboperation.a planargraph/.libs/libplanargraph.a precision/.libs/libprecision.a simplify/.libs/libsimplify.a triangulate/.libs/libtriangulate.a util/.libs/libutil.a -Wl,--no-whole-archive -L/root/.buildozer/android/platform/android-ndk-r9c/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a -L/app/.buildozer/android/platform/build/build/libs_collections/mobileclient/armeabi-v7a -lgnustl_shared -L/root/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/armv7-a/thumb -L/root/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/lib/armv7-a/thumb -L/root/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8 -L/root/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc -L/root/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/lib -lstdc++ -lm -lc -ldl -lgcc crtend_so.o -mandroid -isysroot /root/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -mandroid -isysroot /root/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb --sysroot /root/.buildozer/android/platform/android-ndk-r9c/platforms/android-19/arch-arm -Wl,-soname -Wl,libgeos-3.5.2.so -o .libs/libgeos-3.5.2.so arm-linux-androideabi-g++: error: crtbegin_so.o: No such file or directory arm-linux-androideabi-g++: error: crtend_so.o: No such file or directory Makefile:552: recipe for target 'libgeos.la' failed make[3]: *** [libgeos.la] Error 1 make[3]: Leaving directory '/app/.buildozer/android/platform/build/build/other_builds/libgeos/armeabi-v7a/libgeos/src' Makefile:596: recipe for target 'all-recursive' failed make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory '/app/.buildozer/android/platform/build/build/other_builds/libgeos/armeabi-v7a/libgeos/src' Makefile:474: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/app/.buildozer/android/platform/build/build/other_builds/libgeos/armeabi-v7a/libgeos' Makefile:421: recipe for target 'all' failed make: *** [all] Error 2

I tried add some flags to find these files in libgeos recipe inside function "get_recipe_env" but it is still not working yet:
env['CXXFLAGS'] += ' -I/android/ndk-bundle/platforms/android-24/arch-x86/usr/include/' env['LDFLAGS'] += ' -L/android/ndk-bundle/platforms/android-24/arch-x86/usr/lib/' env['LDFLAGS'] += ' -Wl,-rpath-link=/android/ndk-bundle/platforms/android-24/arch-x86/usr/lib/'

@inclement
Copy link
Member

error: crtbegin_so.o

I didn't understand this at the time, but I've since dealt with these errors and it should be working in p4a master. I think it's to do with clang (called by redirected scripts) failing to look in the correct include directories for these .o files, even when they are specified by -I.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants