Skip to content
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

standard includes not found by boost #576

Closed
brussee opened this issue Jan 12, 2016 · 3 comments
Closed

standard includes not found by boost #576

brussee opened this issue Jan 12, 2016 · 3 comments

Comments

@brussee
Copy link
Contributor

brussee commented Jan 12, 2016

Building libtorrent depending on boost as found here: https://github.com/brussee/SkeletonApp/tree/master/recipes
fails because basic includes are not found.

This particular include is located in /boost/compatibility/cpp_c_headers/
Including this directory manually leads to another one, and another one, etc.

Traceback (most recent call last):
  File "/home/paul/.local/bin/p4a", line 9, in <module>
    load_entry_point('python-for-android==0.3', 'console_scripts', 'p4a')()
  File "/home/paul/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 683, in main
    ToolchainCL()
  File "/home/paul/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 305, in __init__
    getattr(self, args.command)(unknown)
  File "/home/paul/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 105, in wrapper_func
    build_dist_from_args(ctx, dist, dist_args)
  File "/home/paul/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 141, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "/home/paul/.local/lib/python2.7/site-packages/pythonforandroid/build.py", line 540, in build_recipes
    recipe.build_arch(arch)
  File "./libtorrent/__init__.py", line 35, in build_arch
  File "/home/paul/.local/lib/python2.7/site-packages/pythonforandroid/logger.py", line 155, in shprint
    for line in output:
  File "/home/paul/.local/lib/python2.7/site-packages/sh.py", line 565, in next
    self.wait()
  File "/home/paul/.local/lib/python2.7/site-packages/sh.py", line 500, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/paul/.local/lib/python2.7/site-packages/sh.py", line 516, in handle_command_exit_code
    raise exc(self.ran, self.process.stdout, self.process.stderr)
sh.ErrorReturnCode_1: 

  RAN: '/home/paul/.local/share/python-for-android/build/other_builds/boost/armeabi/boost/b2 -d+2 -q target-os=android link=static boost-link=static boost=source threading=multi toolset=gcc-android geoip=off encryption=tommath linkflags="--sysroot=/opt/android-ndk-r10e/platforms/android-16/arch-arm -L/opt/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi -L/home/paul/.local/share/python-for-android/build/other_builds/libtorrent/armeabi/libtorrent/python-install/lib -lpython2.7 -lgnustl_shared" release'

  STDOUT:
BOOST_ROOT = /home/paul/.local/share/python-for-android/build/other_builds/boost/armeabi/boost
CXXFLAGS = -DANDROID -mandroid -fomit-frame-pointer --sysroot /opt/android-ndk-r10e/platforms/android-16/arch-arm
LDFLAGS = -lm -L/home/paul/.local/share/python-for-android/build/libs_collections/recipe/armeabi
OS = LINUX
Performing configuration checks

    - 32-bit                   : yes
    - arm                      : yes

gcc.compile.c++ bin/gcc-android/release/boost-source/libtorrent-python-pic-on/link-static/target-os-android/threading-multi/visibility-hidden/src/module.o

    "arm-linux-androideabi-g++"  -ftemplate-depth-128 -D__arm__ -D_REENTRANT -DBOOST_SP_USE_PTHREADS -DBOOST_AC_USE_PTHREADS -D_GLIBCXX__PTHREADS -O3 -finline-functions -Wno-inline -Wall -fexceptions -frtti -fPIC -ffunction-sections -funwind-tables -Wno-psabi -mtune=xscale -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Wa,--noexecstack -DANDROID -D__ANDROID__ -DNDEBUG -O2 -g -fvisibility=hidden -fvisibility-inlines-hidden -fdata-sections -I/home/paul/.local/share/python-for-android/build/other_builds/python2/armeabi/python2/python-install/include/python2.7 -fvisibility-inlines-hidden -Wno-missing-braces -fPIC -fno-strict-aliasing -fvisibility=hidden -DBOOST_ALL_NO_LIB -DBOOST_ASIO_ENABLE_CANCELIO -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_ASIO_SEPARATE_COMPILATION -DBOOST_EXCEPTION_DISABLE -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_PYTHON_STATIC_LIB -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG -DTORRENT_DISABLE_GEO_IP -DTORRENT_USE_I2P=1 -DTORRENT_USE_TOMMATH -DUNICODE -D_FILE_OFFSET_BITS=64 -D_UNICODE -D_WIN32_WINNT=0x0501  -I"../../include" -I"../../include/libtorrent" -I"/home/paul/.local/share/python-for-android/build/other_builds/boost/armeabi/boost" -I"/usr/include/python2.7" -I"/usr/local/include" -I"/usr/sfw/include" -I"src" -c -o "bin/gcc-android/release/boost-source/libtorrent-python-pic-on/link-static/target-os-android/threading-multi/visibility-hidden/src/module.o" "src/module.cpp"

In file included from /home/paul/.local/share/python-for-android/build/other_builds/boost/armeabi/boost/boost/config.hpp:44:0,
                 from ../../include/libtorrent/config.hpp:45,
                 from src/module.cpp:9:
/home/paul/.local/share/python-for-android/build/other_builds/boost/armeabi/boost/boost/config/select_stdlib_config.hpp:18:21: fatal error: cstddef: No such file or directory
 #  include <cstddef>
                     ^
compilation terminated.
...failed updating 1 target...


  STDERR:

@brussee
Copy link
Contributor Author

brussee commented Jan 12, 2016

The goal is to port the old toolchain recipes to the new one, therefore I tried to copy the functionality exactly.

@brussee brussee changed the title boost includes not found standard includes not found by boost Jan 13, 2016
@inclement
Copy link
Member

The problem is that boost is trying to use the C++ stl, which is not available in the NDK. If you look in the user-config.jam included by the recipe, it actually tries to get this include from <compileflags>-I$(ANDROIDNDK)/sources/cxx-stl/gnu-libstdc++/$(TOOLCHAIN_VERSION)/include, a path which exists only in the CrystaX NDK. So, that should be the solution to this issue, use that NDK (and be careful to fix the rest of the recipe to also work, e.g. make sure the TOOLCHAIN_VERSION env var used by the recipe is set).

@brussee
Copy link
Contributor Author

brussee commented Feb 2, 2016

The solution was to create a custom toolchain with the regular Android NDK and use that, because only then are the required files copied to the right place. (Switching to CrystaX NDK did not help in this case.)
I have put this process in the new boost recipe.

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