Going insane trying to build boost for android

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Going insane trying to build boost for android

Boost - Dev mailing list
How many months has it been of lost google searching, trying to beat
b2 into submission. I have no idea at this point how to build boost
for Android. Really hoping I get some help here...

So to start, here are the versions I'm using:

- Android NDK r14b
- Boost 1.63.0

I'm doing all of this on Windows 10, through command prompt.

I want to use clang and libc++ to build boost for API 15. I figure the
easiest way is to generate a standalone toolchain using the NDK, so I
did that first:

> %ANDROID_NDK%\build\tools\make_standalone_toolchain.py --arch arm --api 15 --stl libc++ "C:\android\_toolchains\arm-api-15"

This generated the appropriate toolchain (I think).

I then temporarily added this location to PATH:

> set PATH=C:\android\_toolchains\arm-api-15\bin;%PATH%

Then I ran bootstrap:

> bootstrap.bat --with-toolset=clang

Then I tried to build boost itself:

> b2 --toolset=clang cxxflags="-stdlib=libc++ -std=c++14" threadapi=pthread --prefix=..\boost_android_arm --builddir=./ target-os=linux define=BOOST_FILESYSTEM_VERSION=3 --without-python link=static runtime-link=shared threading=multi variant=release install -j8

However I get failures when it tries to run the clang command:

'C:\code\_third_party\boost_1_63_0\\clang38++.exe' is not recognized
as an internal or external command

I'm not sure why it's appending that absolute path (that's where my
current directory is set to, and where boost source is). It should
just be trying to use "clang++" but doesn't look like it is.

From the output, it looks like it's trying to use clang correctly I think:

"clang++" -c -x c++ -stdlib=libc++ -std=c++14 -O3 -Wno-inline -Wall
-pthread -stdlib=libc++ -std=c++14 -DBOOST_ALL_NO_LIB=1
-DBOOST_FILESYSTEM_VERSION=3 -DBOOST_THREAD_USE_LIB=1 -DNDEBUG -I"."
-o "bin.v2\libs\wave\build\clang-linux-android\release\link-static\target-os-linux\threadapi-pthread\threading-multi\cpplexer\re2clex\aq.o"
"libs\wave\src\cpplexer\re2clex\aq.cpp"

Am I going about this all wrong? How in the heck can I build boost for
android using the settings I specified above?

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Going insane trying to build boost for android

Boost - Dev mailing list
On Thu, Mar 23, 2017 at 9:14 PM, Robert Dailey <[hidden email]> wrote:

> How many months has it been of lost google searching, trying to beat
> b2 into submission. I have no idea at this point how to build boost
> for Android. Really hoping I get some help here...
>
> So to start, here are the versions I'm using:
>
> - Android NDK r14b
> - Boost 1.63.0
>
> I'm doing all of this on Windows 10, through command prompt.
>
> I want to use clang and libc++ to build boost for API 15. I figure the
> easiest way is to generate a standalone toolchain using the NDK, so I
> did that first:
>
>> %ANDROID_NDK%\build\tools\make_standalone_toolchain.py --arch arm --api 15 --stl libc++ "C:\android\_toolchains\arm-api-15"
>
> This generated the appropriate toolchain (I think).
>
> I then temporarily added this location to PATH:
>
>> set PATH=C:\android\_toolchains\arm-api-15\bin;%PATH%
>
> Then I ran bootstrap:
>
>> bootstrap.bat --with-toolset=clang
>
> Then I tried to build boost itself:
>
>> b2 --toolset=clang cxxflags="-stdlib=libc++ -std=c++14" threadapi=pthread --prefix=..\boost_android_arm --builddir=./ target-os=linux define=BOOST_FILESYSTEM_VERSION=3 --without-python link=static runtime-link=shared threading=multi variant=release install -j8
>
> However I get failures when it tries to run the clang command:
>
> 'C:\code\_third_party\boost_1_63_0\\clang38++.exe' is not recognized
> as an internal or external command
>
> I'm not sure why it's appending that absolute path (that's where my
> current directory is set to, and where boost source is). It should
> just be trying to use "clang++" but doesn't look like it is.
>
> From the output, it looks like it's trying to use clang correctly I think:
>
> "clang++" -c -x c++ -stdlib=libc++ -std=c++14 -O3 -Wno-inline -Wall
> -pthread -stdlib=libc++ -std=c++14 -DBOOST_ALL_NO_LIB=1
> -DBOOST_FILESYSTEM_VERSION=3 -DBOOST_THREAD_USE_LIB=1 -DNDEBUG -I"."
> -o "bin.v2\libs\wave\build\clang-linux-android\release\link-static\target-os-linux\threadapi-pthread\threading-multi\cpplexer\re2clex\aq.o"
> "libs\wave\src\cpplexer\re2clex\aq.cpp"
>
> Am I going about this all wrong? How in the heck can I build boost for
> android using the settings I specified above?

So I beat on this a bit more and I'm past the clang path issue (it was
some %~dp0/clang38++.exe stuff the batch file was doing which didn't
resolve the right base path)

What are the actual include directories I need to use for clang? I
think that's the difficulty I'm running into now... errors like:

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
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;
      ~~^

My config jam:

import common ;
import configure ;
import build-system ;
import generate ;
import modules ;
import option ;
import os ;
import package ;
import path ;
import project ;
import regex ;
import set ;
import targets ;
import feature ;
import property ;

local androidNDKRoot = C:/android/ndk ; # put the relevant path

using clang : android
    :
    $(androidNDKRoot)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++
    :
    <compileflags>-std=c++14
    <compileflags>-stdlib=libc++
    <compileflags>--sysroot=$(androidNDKRoot)/platforms/android-15/arch-arm
    <compileflags>-I$(androidNDKRoot)/sources/android/support/include
    <compileflags>-I$(androidNDKRoot)/sources/cxx-stl/llvm-libc++abi/include
    <compileflags>-I$(androidNDKRoot)/sources/cxx-stl/llvm-libc++/include
    <compileflags>-fno-strict-aliasing
    <compileflags>-D__GLIBC__
    <compileflags>-DANDROID
    <compileflags>-D__ANDROID__
    <compileflags>-D_GLIBCXX__PTHREADS
    <compileflags>-D__arm__
    <compileflags>-D_REENTRANT
    <compileflags>-O2
    <compileflags>-DNDEBUG
    ;

And I'm running this command:

b2 ^
    --user-config=clang-android.jam ^
    target-os=android ^
    toolset=clang-android ^
    threadapi=pthread ^
    link=static ^
    runtime-link=shared ^
    threading=multi ^
    variant=release ^
    --prefix=..\boost_android_arm ^
    --builddir=./ ^
    --without-python ^
    -j1 ^
    install

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Going insane trying to build boost for android

Boost - Dev mailing list
On Sun, Mar 26, 2017 at 10:59 AM, Robert Dailey
<[hidden email]> wrote:

> On Thu, Mar 23, 2017 at 9:14 PM, Robert Dailey <[hidden email]> wrote:
>> How many months has it been of lost google searching, trying to beat
>> b2 into submission. I have no idea at this point how to build boost
>> for Android. Really hoping I get some help here...
>>
>> So to start, here are the versions I'm using:
>>
>> - Android NDK r14b
>> - Boost 1.63.0
>>
>> I'm doing all of this on Windows 10, through command prompt.
>>
>> I want to use clang and libc++ to build boost for API 15. I figure the
>> easiest way is to generate a standalone toolchain using the NDK, so I
>> did that first:
>>
>>> %ANDROID_NDK%\build\tools\make_standalone_toolchain.py --arch arm --api 15 --stl libc++ "C:\android\_toolchains\arm-api-15"
>>
>> This generated the appropriate toolchain (I think).
>>
>> I then temporarily added this location to PATH:
>>
>>> set PATH=C:\android\_toolchains\arm-api-15\bin;%PATH%
>>
>> Then I ran bootstrap:
>>
>>> bootstrap.bat --with-toolset=clang
>>
>> Then I tried to build boost itself:
>>
>>> b2 --toolset=clang cxxflags="-stdlib=libc++ -std=c++14" threadapi=pthread --prefix=..\boost_android_arm --builddir=./ target-os=linux define=BOOST_FILESYSTEM_VERSION=3 --without-python link=static runtime-link=shared threading=multi variant=release install -j8
>>
>> However I get failures when it tries to run the clang command:
>>
>> 'C:\code\_third_party\boost_1_63_0\\clang38++.exe' is not recognized
>> as an internal or external command
>>
>> I'm not sure why it's appending that absolute path (that's where my
>> current directory is set to, and where boost source is). It should
>> just be trying to use "clang++" but doesn't look like it is.
>>
>> From the output, it looks like it's trying to use clang correctly I think:
>>
>> "clang++" -c -x c++ -stdlib=libc++ -std=c++14 -O3 -Wno-inline -Wall
>> -pthread -stdlib=libc++ -std=c++14 -DBOOST_ALL_NO_LIB=1
>> -DBOOST_FILESYSTEM_VERSION=3 -DBOOST_THREAD_USE_LIB=1 -DNDEBUG -I"."
>> -o "bin.v2\libs\wave\build\clang-linux-android\release\link-static\target-os-linux\threadapi-pthread\threading-multi\cpplexer\re2clex\aq.o"
>> "libs\wave\src\cpplexer\re2clex\aq.cpp"
>>
>> Am I going about this all wrong? How in the heck can I build boost for
>> android using the settings I specified above?
>
> So I beat on this a bit more and I'm past the clang path issue (it was
> some %~dp0/clang38++.exe stuff the batch file was doing which didn't
> resolve the right base path)
>
> What are the actual include directories I need to use for clang? I
> think that's the difficulty I'm running into now... errors like:
>
> 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
> 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;
>       ~~^
>
> My config jam:
>
> import common ;
> import configure ;
> import build-system ;
> import generate ;
> import modules ;
> import option ;
> import os ;
> import package ;
> import path ;
> import project ;
> import regex ;
> import set ;
> import targets ;
> import feature ;
> import property ;
>
> local androidNDKRoot = C:/android/ndk ; # put the relevant path
>
> using clang : android
>     :
>     $(androidNDKRoot)/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++
>     :
>     <compileflags>-std=c++14
>     <compileflags>-stdlib=libc++
>     <compileflags>--sysroot=$(androidNDKRoot)/platforms/android-15/arch-arm
>     <compileflags>-I$(androidNDKRoot)/sources/android/support/include
>     <compileflags>-I$(androidNDKRoot)/sources/cxx-stl/llvm-libc++abi/include
>     <compileflags>-I$(androidNDKRoot)/sources/cxx-stl/llvm-libc++/include
>     <compileflags>-fno-strict-aliasing
>     <compileflags>-D__GLIBC__
>     <compileflags>-DANDROID
>     <compileflags>-D__ANDROID__
>     <compileflags>-D_GLIBCXX__PTHREADS
>     <compileflags>-D__arm__
>     <compileflags>-D_REENTRANT
>     <compileflags>-O2
>     <compileflags>-DNDEBUG
>     ;
>
> And I'm running this command:
>
> b2 ^
>     --user-config=clang-android.jam ^
>     target-os=android ^
>     toolset=clang-android ^
>     threadapi=pthread ^
>     link=static ^
>     runtime-link=shared ^
>     threading=multi ^
>     variant=release ^
>     --prefix=..\boost_android_arm ^
>     --builddir=./ ^
>     --without-python ^
>     -j1 ^
>     install

And another oddity I noticed, is that Boost is not able to detect
C++14 being enabled even though I specify -std=c++14 in my jam file.
Note the config checks after I run b2:

$ b2     --user-config=clang-android.jam     target-os=android
toolset=clang-android     threadapi=pthread     link=static
runtime-link=shared     threading=multi     variant=release
--prefix=..\boost_android_arm     --builddir=./     --without-python
  -j1     install
Performing configuration checks

    - 32-bit                   : yes
    - arm                      : yes
    - symlinks supported       : yes
    - C++11 mutex              : no
    - lockfree boost::atomic_flag : no
    - Boost.Config Feature Check: cxx11_auto_declarations : no
    - Boost.Config Feature Check: cxx11_constexpr : no
    - Boost.Config Feature Check: cxx11_defaulted_functions : no
    - Boost.Config Feature Check: cxx11_final : no
    - Boost.Config Feature Check: cxx11_hdr_mutex : no
    - Boost.Config Feature Check: cxx11_hdr_tuple : no
    - Boost.Config Feature Check: cxx11_lambdas : no
    - Boost.Config Feature Check: cxx11_noexcept : no
    - Boost.Config Feature Check: cxx11_nullptr : no
    - Boost.Config Feature Check: cxx11_rvalue_references : no
    - Boost.Config Feature Check: cxx11_template_aliases : no
    - Boost.Config Feature Check: cxx11_thread_local : no
    - Boost.Config Feature Check: cxx11_variadic_templates : no

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Going insane trying to build boost for android

Boost - Dev mailing list

> And another oddity I noticed, is that Boost is not able to detect
> C++14 being enabled even though I specify -std=c++14 in my jam file.
> Note the config checks after I run b2:
>
> $ b2     --user-config=clang-android.jam     target-os=android
> toolset=clang-android     threadapi=pthread     link=static
> runtime-link=shared     threading=multi     variant=release
> --prefix=..\boost_android_arm     --builddir=./     --without-python
>    -j1     install
> Performing configuration checks
>
>      - 32-bit                   : yes
>      - arm                      : yes
>      - symlinks supported       : yes
>      - C++11 mutex              : no
>      - lockfree boost::atomic_flag : no
>      - Boost.Config Feature Check: cxx11_auto_declarations : no
>      - Boost.Config Feature Check: cxx11_constexpr : no
>      - Boost.Config Feature Check: cxx11_defaulted_functions : no
>      - Boost.Config Feature Check: cxx11_final : no
>      - Boost.Config Feature Check: cxx11_hdr_mutex : no
>      - Boost.Config Feature Check: cxx11_hdr_tuple : no
>      - Boost.Config Feature Check: cxx11_lambdas : no
>      - Boost.Config Feature Check: cxx11_noexcept : no
>      - Boost.Config Feature Check: cxx11_nullptr : no
>      - Boost.Config Feature Check: cxx11_rvalue_references : no
>      - Boost.Config Feature Check: cxx11_template_aliases : no
>      - Boost.Config Feature Check: cxx11_thread_local : no
>      - Boost.Config Feature Check: cxx11_variadic_templates : no

Seeing that, I would bet money (though not a lot!) on the command line
not being what you think it is, and that you're actually building for C++03

John.



---
This email has been checked for viruses by AVG.
http://www.avg.com


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Going insane trying to build boost for android

Boost - Dev mailing list
On Sun, Mar 26, 2017 at 11:31 AM, John Maddock via Boost
<[hidden email]> wrote:

>> Performing configuration checks
>>
>>      - 32-bit                   : yes
>>      - arm                      : yes
>>      - symlinks supported       : yes
>>      - C++11 mutex              : no
>>      - lockfree boost::atomic_flag : no
>>      - Boost.Config Feature Check: cxx11_auto_declarations : no
>>      - Boost.Config Feature Check: cxx11_constexpr : no
>>      - Boost.Config Feature Check: cxx11_defaulted_functions : no
>>      - Boost.Config Feature Check: cxx11_final : no
>>      - Boost.Config Feature Check: cxx11_hdr_mutex : no
>>      - Boost.Config Feature Check: cxx11_hdr_tuple : no
>>      - Boost.Config Feature Check: cxx11_lambdas : no
>>      - Boost.Config Feature Check: cxx11_noexcept : no
>>      - Boost.Config Feature Check: cxx11_nullptr : no
>>      - Boost.Config Feature Check: cxx11_rvalue_references : no
>>      - Boost.Config Feature Check: cxx11_template_aliases : no
>>      - Boost.Config Feature Check: cxx11_thread_local : no
>>      - Boost.Config Feature Check: cxx11_variadic_templates : no
>
>
> Seeing that, I would bet money (though not a lot!) on the command line not
> being what you think it is, and that you're actually building for C++03

So outside of what I'm already doing, how do I properly tell boost
about C++14? I'm sending down a cxxflag for it in my jam file right
now, but that's the only way I've been able to find out how to do it
from my Google searching.

Do you have a solution?

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Boost-users] Going insane trying to build boost for android

Boost - Dev mailing list
On Mon, Mar 27, 2017 at 11:54 AM, John Maddock
<[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Boost-users] Going insane trying to build boost for android

Boost - Dev mailing list
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:[hidden email]] On Behalf Of Robert Dailey via Boost
Sent: Tuesday, March 28, 2017 3:15 AM
To: [hidden email]; Boost <[hidden email]>; Boost Developers <[hidden email]>
Cc: Robert Dailey <[hidden email]>
Subject: Re: [boost] [Boost-users] Going insane trying to build boost for android

On Mon, Mar 27, 2017 at 11:54 AM, John Maddock <[hidden email]> 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>


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

build.7z (1K) Download Attachment
Loading...