dec1/Boost-for-Android

Couldn't build Boost 1.65.1 with doIt.sh

Closed this issue · 5 comments

Hi,
I tried to compile with the doIt.sh script, however I am not able to build it.
I have looked for those header inside my Ubuntu, and they are located inside /usr/include/asm-generic/
Do you know how to solve this problem?

also tried with
sudo apt-get install build-essential
sudo apt-get install ia32-libs

  "g++"   -O3 -finline-functions -Wno-inline -Wall -fPIC -ftemplate-depth-255 -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_SERIALIZATION_DYN_LINK=1 -DNDEBUG  -I"." -c -o "/tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/serialization/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/polymorphic_oarchive.o" "libs/serialization/src/polymorphic_oarchive.cpp"

In file included from ./boost/config.hpp:48:0,
                from ./boost/serialization/config.hpp:18,
                from libs/serialization/src/polymorphic_oarchive.cpp:16:
./boost/config/stdlib/libstdcpp3.hpp:78:22: fatal error: unistd.h: No such file or directory
#  include <unistd.h>
                     ^
compilation terminated.
gcc.compile.c++ /tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/regex/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/winstances.o

   "g++"   -O3 -finline-functions -Wno-inline -Wall -pedantic -fPIC  -DBOOST_ALL_NO_LIB=1 -DBOOST_REGEX_DYN_LINK=1 -DNDEBUG  -I"." -c -o "/tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/regex/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/winstances.o" "libs/regex/build/../src/winstances.cpp"

In file included from ./boost/config.hpp:48:0,
                from ./boost/regex/config.hpp:44,
                from libs/regex/build/../src/winstances.cpp:21:
./boost/config/stdlib/libstdcpp3.hpp:78:22: fatal error: unistd.h: No such file or directory
#  include <unistd.h>
                     ^
compilation terminated.
gcc.compile.c++ /tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/serialization/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/extended_type_info.o

   "g++"   -O3 -finline-functions -Wno-inline -Wall -fPIC -ftemplate-depth-255 -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_SERIALIZATION_DYN_LINK=1 -DNDEBUG  -I"." -c -o "/tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/serialization/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/extended_type_info.o" "libs/serialization/src/extended_type_info.cpp"

In file included from /home/altumview/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_algo.h:59:0,
                from /home/altumview/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/algorithm:62,
                from libs/serialization/src/extended_type_info.cpp:15:
/home/altumview/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/cstdlib:72:20: fatal error: stdlib.h: No such file or directory
#include <stdlib.h>
                   ^
compilation terminated.
gcc.compile.asm /tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/context/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/asm/ontop_arm_aapcs_elf_gas.o

   "g++" -x assembler-with-cpp -O3 -finline-functions -Wno-inline -Wall -fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_CONTEXT_DYN_LINK=1 -DBOOST_CONTEXT_SOURCE -DBOOST_DISABLE_ASSERTS -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DNDEBUG -I"." -c -o "/tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/context/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/asm/ontop_arm_aapcs_elf_gas.o" "libs/context/src/asm/ontop_arm_aapcs_elf_gas.S"

gcc.compile.c++ /tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/serialization/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/basic_serializer_map.o

   "g++"   -O3 -finline-functions -Wno-inline -Wall -fPIC -ftemplate-depth-255 -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_SERIALIZATION_DYN_LINK=1 -DNDEBUG  -I"." -c -o "/tmp/ndk-root/tmp/build-7607/build-boost/armeabi-v7a/gnu-4.9/build/boost/bin.v2/libs/serialization/build/gcc-arm/release/abi-aapcs/target-os-android/threading-multi/basic_serializer_map.o" "libs/serialization/src/basic_serializer_map.cpp"

In file included from ./boost/config.hpp:48:0,
                from ./boost/serialization/config.hpp:18,
                from libs/serialization/src/basic_serializer_map.cpp:22:
./boost/config/stdlib/libstdcpp3.hpp:78:22: fatal error: unistd.h: No such file or directory
#  include <unistd.h>
                     ^
compilation terminated.
...failed updating 18 targets...
ERROR: Couldn't build Boost 1.65.1 armeabi-v7a libraries
dec1 commented

Hello.
Which version of the ndk are you using?
If you're using ndk 16 please try building with the ndk_16 branch:

https://github.com/dec1/Boost-for-Android/tree/ndk_16

tried to use ndk_16 branch.
It still cannot compile successfully.
This is the build_out it produced.
build_out.txt

Hi,
I'm having the same trouble when I try to compile Boost 1.58.0.. I'm using NDK version 15.2.4203891
build_out.txt

dec1 commented

@manuelpuyol
The build script can't find "pyconfig.h". On my system (OpenSuse Tumbleweed) it's in
/usr/include/python2.7/pyconfig.h
and part of the "python-base" package. So you should try to install whatever package includes this file on your system

dec1 commented

@chan1600
I've updated the ndk-16 branch, with a commit which I think should solve the (second) issue you describe.

If you're still having problems, please post more details, including:

  • the version of the ndk you are using (see path_to_ndk/source.properties file)
  • your doIt.sh script
  • the version of boost you are using
  • Please run doIt.sh again and include the build_out.txt this produces