Boost logo

Boost :

Subject: Re: [boost] [Boost-users] Going insane trying to build boost for android
From: Mert Büyüktuncay (mert.buyuktuncay_at_[hidden])
Date: 2017-03-29 06:27:00


Hi,
I was too frustrated maintaining boost builds with android in our company. I copied the necessary compilation parameters from bjam commands and ended up with the attached build files. I hope they will be useful to you. If you want to use them you should change the paths to cpp files on your own system. And run build.bat from command line.

They work with android-ndk-r13b we build boost 1.60 on Windows with these.

Note: archive password is
1

-----Original Message-----
From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Robert Dailey via Boost
Sent: Tuesday, March 28, 2017 3:15 AM
To: john_at_[hidden]; Boost <boost-users_at_[hidden]>; Boost Developers <boost_at_[hidden]>
Cc: Robert Dailey <rcdailey.lists_at_[hidden]>
Subject: Re: [boost] [Boost-users] Going insane trying to build boost for android

On Mon, Mar 27, 2017 at 11:54 AM, John Maddock <jz.maddock_at_[hidden]> wrote:
>
>> That won't do me any good because I'm already using this toolchain
>> perfectly fine via CMake and ndk-build. bjam isn't working, maybe
>> because I haven't set up the config.jam file properly. I'm not sure
>> at this point. Boost is the only thing not working here.
>
>
> Then if you compare the compilation command line generated when
> building under b2 and when building under cmake the error should be obvious?

I took your advice and compared a real build that worked using CMake (using a simple test cpp file) and what I got from b2.

Here is the command line used to build the sample app using CMake.
Note that the compilation succeeded:

C:\android\ndk\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-g++.exe
--sysroot=C:/android/ndk/platforms/android-15/arch-arm
-Dndk_test_EXPORTS -isystem
C:/android/ndk/sources/cxx-stl/llvm-libc++/include -isystem C:/android/ndk/sources/android/support/include -isystem C:/android/ndk/sources/cxx-stl/llvm-libc++abi/include -isystem C:/android/ndk/platforms/android-15/arch-arm/usr/include
-march=armv7-a -mthumb -mfpu=vfpv3-d16 -mfloat-abi=softfp -funwind-tables -no-canonical-prefixes -fexceptions -frtti -g -fPIC
-std=gnu++14 -MD -MT CMakeFiles/ndk_test.dir/main.cpp.o -MF CMakeFiles\ndk_test.dir\main.cpp.o.d -o CMakeFiles/ndk_test.dir/main.cpp.o -c ../main.cpp

And here is the command line from b2:

"C:/android/ndk/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++"
-c -x c++ -O3 -Wno-inline -Wall
--sysroot=C:/android/ndk/platforms/android-15/arch-arm -isystem C:/android/ndk/sources/cxx-stl/llvm-libc++/include -isystem C:/android/ndk/sources/android/support/include -isystem C:/android/ndk/sources/cxx-stl/llvm-libc++abi/include -isystem C:/android/ndk/platforms/android-15/arch-arm/usr/include -std=c++14 -fno-strict-aliasing -D__GLIBC__ -DANDROID -D__ANDROID__ -D_GLIBCXX__PTHREADS -D__arm__ -D_REENTRANT -O2 -DNDEBUG -H
-DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_SOURCE
-DBOOST_ATOMIC_STATIC_LINK=1 -DNDEBUG -I"." -o "bin.v2\libs\atomic\build\clang-linux-android\release\link-static\target-os-android\threadapi-pthread\threading-multi\lockpool.o"
"libs\atomic\src\lockpool.cpp"

The build for boost still fails. Note I also passed the -H option, so I could see the include searches performed by clang as it was building boost. The output is long, but I've included it below. Can anyone help me identify why boost still won't build?

clang-linux.compile.c++.without-pth
bin.v2\libs\atomic\build\clang-linux-android\release\link-static\target-os-android\threadapi-pthread\threading-multi\lockpool.o

  "C:/android/ndk/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++"
-c -x c++ -O3 -Wno-inline -Wall
--sysroot=C:/android/ndk/platforms/android-15/arch-arm -isystem C:/android/ndk/sources/cxx-stl/llvm-libc++/include -isystem C:/android/ndk/sources/android/support/include -isystem C:/android/ndk/sources/cxx-stl/llvm-libc++abi/include -isystem C:/android/ndk/platforms/android-15/arch-arm/usr/include -std=c++14 -fno-strict-aliasing -D__GLIBC__ -DANDROID -D__ANDROID__ -D_GLIBCXX__PTHREADS -D__arm__ -D_REENTRANT -O2 -DNDEBUG -H
-DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_SOURCE
-DBOOST_ATOMIC_STATIC_LINK=1 -DNDEBUG -I"." -o "bin.v2\libs\atomic\build\clang-linux-android\release\link-static\target-os-android\threadapi-pthread\threading-multi\lockpool.o"
"libs\atomic\src\lockpool.cpp"

. C:/android/ndk/sources/cxx-stl/llvm-libc++/include\\cstddef
.. C:/android/ndk/sources/cxx-stl/llvm-libc++/include\\__config
.. C:\\android\\ndk\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin\\..\\lib64\\clang\\3.8.275480\\include\\stddef.h
... C:\\android\\ndk\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin\\..\\lib64\\clang\\3.8.275480\\include/__stddef_max_align_t.h
.. C:/android/ndk/sources/cxx-stl/llvm-libc++/include\\__nullptr
. .\\boost/config.hpp
.. .\\boost/config/user.hpp
.. .\\boost/config/select_compiler_config.hpp
.. .\\boost/config/compiler/clang.hpp
.. .\\boost/config/select_stdlib_config.hpp
.. .\\boost/config/stdlib/libcpp.hpp
.. .\\boost/config/select_platform_config.hpp
.. .\\boost/config/platform/linux.hpp
... C:/android/ndk/sources/cxx-stl/llvm-libc++/include\\cstdlib
.... C:/android/ndk/sources/cxx-stl/llvm-libc++/include\\stdlib.h
..... C:/android/ndk/sources/android/support/include\\stdlib.h
...... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\stdlib.h
....... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\sys/cdefs.h
........ C:/android/ndk/platforms/android-15/arch-arm/usr/include\\sys/cdefs_elf.h
........ C:/android/ndk/platforms/android-15/arch-arm/usr/include\\android/api-level.h
....... C:/android/ndk/sources/cxx-stl/llvm-libc++/include\\stddef.h
........ C:\\android\\ndk\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin\\..\\lib64\\clang\\3.8.275480\\include\\stddef.h
....... C:/android/ndk/sources/cxx-stl/llvm-libc++/include\\stddef.h
........ C:\\android\\ndk\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin\\..\\lib64\\clang\\3.8.275480\\include\\stddef.h
....... C:/android/ndk/sources/cxx-stl/llvm-libc++/include\\string.h
........ C:/android/ndk/sources/android/support/include\\string.h
......... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\string.h
.......... C:/android/ndk/sources/cxx-stl/llvm-libc++/include\\stddef.h
.......... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\malloc.h
........... C:/android/ndk/sources/cxx-stl/llvm-libc++/include\\stddef.h
....... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\alloca.h
....... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\strings.h
........ C:/android/ndk/platforms/android-15/arch-arm/usr/include\\sys/types.h
......... C:/android/ndk/sources/cxx-stl/llvm-libc++/include\\stddef.h
.......... C:\\android\\ndk\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin\\..\\lib64\\clang\\3.8.275480\\include\\stddef.h
......... C:/android/ndk/sources/android/support/include\\stdint.h
.......... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\stdint.h
........... C:/android/ndk/sources/cxx-stl/llvm-libc++/include\\stddef.h
........... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\sys/_types.h
............ C:/android/ndk/platforms/android-15/arch-arm/usr/include\\machine/_types.h
......... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\linux/posix_types.h
.......... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\linux/stddef.h
........... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\linux/compiler.h
.......... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\asm/posix_types.h
......... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\asm/types.h
......... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\linux/types.h
......... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\machine/kernel.h
......... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\sys/sysmacros.h
....... C:/android/ndk/platforms/android-15/arch-arm/usr/include\\memory.h
In file included from libs\atomic\src\lockpool.cpp:16:
In file included from .\boost/config.hpp:57:
In file included from .\boost/config/platform/linux.hpp:15:
C:/android/ndk/sources/cxx-stl/llvm-libc++/include\cstdlib:108:9:
error: no member named 'strtold' in the global namespace using ::strtold;
      ~~^
C:/android/ndk/sources/cxx-stl/llvm-libc++/include\cstdlib:126:9:
error: no member named '_Exit' in the global namespace using ::_Exit;
      ~~^
C:/android/ndk/sources/cxx-stl/llvm-libc++/include\cstdlib:149:9:
error: no member named 'at_quick_exit' in the global namespace using ::at_quick_exit;
      ~~^
C:/android/ndk/sources/cxx-stl/llvm-libc++/include\cstdlib:150:9:
error: no member named 'quick_exit' in the global namespace using ::quick_exit;
      ~~^

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Bu elektronik posta mesajý ve ekleri sadece gönderildiði kiþi veya kuruma özeldir ve gizli bilgiler içerebilir. Eðer bu mesajý hataen aldýysanýz lütfen bu durumu gönderen kiþiye derhal bildiriniz ve mesajý sisteminizden siliniz. Eðer doðru kiþiye ulaþmadýðýný düþünüyorsanýz, bu mesajýn gizlenmesi, yönlendirilmesi, kopyalanmasý veya herhangi bir þekilde kullanýlmasý yasaktýr. Internet iletiþiminde güvenlik ve hatasýz gönderim garanti edilemeyeceðinden, mesajýn yerine ulaþmamasý, geç ulaþmasý, içeriðinin bozulmasý ya da mesajýn virüs taþýmasý gibi problemler oluþabilir. Gönderen taraf bu tip sorunlardan sorumlu tutulmaz.
SESTEK Ses ve Ýletiþim Teknolojileri A.Þ.
www.sestek.com<http://www.sestek.com>

This e-mail message and any attachments are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this message in error, please notify the sender immediately and delete it from your system. If you are not the intended recipient you are hereby notified that any dissemination, forwarding, copying or use of any of the information is prohibited. Internet communications cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, arrive late or contain viruses. The sender therefore does not accept liability for any errors or omissions in the context of this message which arise as a result of Internet transmission
SESTEK INC.
www.sestek.com <http://www.sestek.com>




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk