Quantcast

Re: Going insane trying to build boost for android

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

Re: Going insane trying to build boost for android

Boost - Users 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
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Going insane trying to build boost for android

Boost - Users 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
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Boost - Users mailing list
On Sun, Mar 26, 2017 at 12:04 PM, John Maddock
<[hidden email]> wrote:

>
>> 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.
>
>
> Nod.  As far as I know that's the only way, two questions:
>
> * If you build something with the -d2 option do you see all the -std=
> compiler flags you expect to see?
> * If you do so, can you build and *run* libs/config/test/config_info and
> report the output?

(Re-included the boost ML)

With the -d2 option added, this is what I see:



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
-IC:/android/ndk/sources/cxx-stl/llvm-libc++abi/include
-IC:/android/ndk/sources/cxx-stl/llvm-libc++/include
-IC:/android/ndk/sources/android/support/include -std=c++14
-fno-strict-aliasing -D__GLIBC__ -DANDROID -D__ANDROID__
-D_GLIBCXX__PTHREADS -D__arm__ -D_REENTRANT -O2 -DNDEBUG
-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"

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;
      ~~^
4 errors generated.



I do see -std=c++14 in there.

As for your second question, why would building and running
config_info help? I'm cross compiling, so I can't run this on Windows.
If you could provide explicit instructions so I properly understand
what you want me to do, that would be ideal.

Thanks.
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Boost - Users mailing list
If only boost was available as a cmake script...

On Sun, 26 Mar 2017 at 19:39, Robert Dailey via Boost-users <[hidden email]> wrote:
On Sun, Mar 26, 2017 at 12:04 PM, John Maddock
<[hidden email]> wrote:
>
>> 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.
>
>
> Nod.  As far as I know that's the only way, two questions:
>
> * If you build something with the -d2 option do you see all the -std=
> compiler flags you expect to see?
> * If you do so, can you build and *run* libs/config/test/config_info and
> report the output?

(Re-included the boost ML)

With the -d2 option added, this is what I see:



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
-IC:/android/ndk/sources/cxx-stl/llvm-libc++abi/include
-IC:/android/ndk/sources/cxx-stl/llvm-libc++/include
-IC:/android/ndk/sources/android/support/include -std=c++14
-fno-strict-aliasing -D__GLIBC__ -DANDROID -D__ANDROID__
-D_GLIBCXX__PTHREADS -D__arm__ -D_REENTRANT -O2 -DNDEBUG
-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"

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;
      ~~^
4 errors generated.



I do see -std=c++14 in there.

As for your second question, why would building and running
config_info help? I'm cross compiling, so I can't run this on Windows.
If you could provide explicit instructions so I properly understand
what you want me to do, that would be ideal.

Thanks.
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Boost - Users mailing list

>     I do see -std=c++14 in there.
>
>     As for your second question, why would building and running
>     config_info help? I'm cross compiling, so I can't run this on Windows.
>     If you could provide explicit instructions so I properly understand
>     what you want me to do, that would be ideal.
>

OK, you are configured correctly.  I'd missed that you were
cross-compiling, in that situation Boost.Config's build time checks
*will always fail* and that's why you're seeing the messages you are.  
That shouldn't unduly effect the building of the libraries - these
checks are mainly used for the tests - but it's an open bug that needs
to be fixed.

HTH, John.

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

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Boost - Users mailing list
In reply to this post by Boost - Users mailing list


On 26/03/2017 21:14, Richard Hodges via Boost-users wrote:

>     With the -d2 option added, this is what I see:
>
>
>
>     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
>     -IC:/android/ndk/sources/cxx-stl/llvm-libc++abi/include
>     -IC:/android/ndk/sources/cxx-stl/llvm-libc++/include
>     -IC:/android/ndk/sources/android/support/include -std=c++14
>     -fno-strict-aliasing -D__GLIBC__ -DANDROID -D__ANDROID__
>     -D_GLIBCXX__PTHREADS -D__arm__ -D_REENTRANT -O2 -DNDEBUG
>     -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"
>
>     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;
>           ~~^
>     4 errors generated.
>
>

Those errors are all from <cstdlib> and therefore outside our control -
suggest you try getting a hello-world app that includes <cstdlib>
compiling before tackling Boost?  A quick Google didn't help with those
errors unfortunately, but they do look like a clang setup or
misconfiguration issue.

HTH, John.

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

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Boost - Users mailing list
On Mon, Mar 27, 2017 at 2:42 AM, John Maddock via Boost-users
<[hidden email]> wrote:

>
>
> On 26/03/2017 21:14, Richard Hodges via Boost-users wrote:
>
>>     With the -d2 option added, this is what I see:
>>
>>
>>
>>     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
>>     -IC:/android/ndk/sources/cxx-stl/llvm-libc++abi/include
>>     -IC:/android/ndk/sources/cxx-stl/llvm-libc++/include
>>     -IC:/android/ndk/sources/android/support/include -std=c++14
>>     -fno-strict-aliasing -D__GLIBC__ -DANDROID -D__ANDROID__
>>     -D_GLIBCXX__PTHREADS -D__arm__ -D_REENTRANT -O2 -DNDEBUG
>>     -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"
>>
>>     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;
>>           ~~^
>>     4 errors generated.
>>
>>
>
> Those errors are all from <cstdlib> and therefore outside our control -
> suggest you try getting a hello-world app that includes <cstdlib> compiling
> before tackling Boost?  A quick Google didn't help with those errors
> unfortunately, but they do look like a clang setup or misconfiguration
> issue.

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.

Because of these compiler errors, I'm assuming I'm missing some
include paths but I'm not sure what I'm missing. Clang annoyingly
doesn't say when includes can't be found, instead it just says it
can't find symbols (I find this horrible).

Hoping someone with experience using NDK can give me some pointers here.

My concern with the cxx tests not working is that it may disable C++14
features of boost when I build it. Isn't that the whole point of
testing for those features, so that bjam can programmatically disable
them when building? I just want to make sure of that... if that's not
what they're for, then I honestly don't see a point in them.

Also there used to be CMake support for building boost a few years
ago, but I think the project is dead. Would be nice if boost
developers used CMake instead of this niche build system. If it was
using CMake I'd already be done.
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Boost - Users 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;
      ~~^
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Boost - Users mailing list
In reply to this post by Boost - Users mailing list

> On Mar 26, 2017, at 3:14 PM, Richard Hodges via Boost-users <[hidden email]> wrote:
>
> If only boost was available as a cmake script…

This script will build boost using cmake's toolchain:

https://github.com/pfultz2/cget/blob/master/cget/cmake/boost.cmake

It basically translates cmake's settings to a user-config.jam file, and then calls boost build. It hasn’t been tested with cross compiling or android yet, so it may still need some work depending on how you setup your cmake toolchain file.

Paul


_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
On Tue, Mar 28, 2017 at 3:10 AM, John Maddock <[hidden email]> wrote:
>
> Right, but that built with g++ not clang++.

Doh!!! I didn't even notice this. Crap. I'll fix it when I get home
and try again.

> I don't think Boost.Build does anything "different" here: it basically just
> invokes clang++.
>
> Note that clang is not particular "bright" in the way it creates it's
> wrapper headers around <cstdlib> etc.  Last time I had an issue like this,
> the missing symbol was present in the system headers, but guarded by a
> #ifdef that clang didn't define (where as GCC did)..... OK had a quick
> Google, and that symbol is protected by a clang "availability" macro:
>
> longdoublestrtold(constchar*,char**)__INTRODUCED_IN(21);
>
> So it seems to me that this error will be generated by any attempt to
> compile with clang unless you specify some "magic" command line option to
> tell it to use the latest android API?  No idea what that would be, but
> perhaps you do?
>
> Hopefully getting closer, John.

Thanks for the help. Looks like it is expecting API 21 to be used.
Which is strange because the NDK documentation says to use the minimum
supported API you intend to use. Which is 15 for me. But just grepping
the NDK source directories, I see that certain files/symbols are only
defined starting at API 21. I think a lot of the C library headers are
provided by the target API directory, and they change it with each
version.

I'll try 21 and see if I get different results, and hopefully it won't
break when running on Android Ice Cream Sandwich (API 15)
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Boost - Users mailing list
On Tue, Mar 28, 2017 at 8:39 AM, Robert Dailey <[hidden email]> wrote:

> On Tue, Mar 28, 2017 at 3:10 AM, John Maddock <[hidden email]> wrote:
>>
>> Right, but that built with g++ not clang++.
>
> Doh!!! I didn't even notice this. Crap. I'll fix it when I get home
> and try again.
>
>> I don't think Boost.Build does anything "different" here: it basically just
>> invokes clang++.
>>
>> Note that clang is not particular "bright" in the way it creates it's
>> wrapper headers around <cstdlib> etc.  Last time I had an issue like this,
>> the missing symbol was present in the system headers, but guarded by a
>> #ifdef that clang didn't define (where as GCC did)..... OK had a quick
>> Google, and that symbol is protected by a clang "availability" macro:
>>
>> longdoublestrtold(constchar*,char**)__INTRODUCED_IN(21);
>>
>> So it seems to me that this error will be generated by any attempt to
>> compile with clang unless you specify some "magic" command line option to
>> tell it to use the latest android API?  No idea what that would be, but
>> perhaps you do?
>>
>> Hopefully getting closer, John.
>
> Thanks for the help. Looks like it is expecting API 21 to be used.
> Which is strange because the NDK documentation says to use the minimum
> supported API you intend to use. Which is 15 for me. But just grepping
> the NDK source directories, I see that certain files/symbols are only
> defined starting at API 21. I think a lot of the C library headers are
> provided by the target API directory, and they change it with each
> version.
>
> I'll try 21 and see if I get different results, and hopefully it won't
> break when running on Android Ice Cream Sandwich (API 15)

So I corrected my ndk test in CMake, and it now builds properly with clang++:


$ ninja -v
[1/2] C:\android\ndk\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe
--target=armv7-none-linux-androideabi
--gcc-toolchain=C:/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64
--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
[2/2] cmd.exe /C "cd . &&
C:\android\ndk\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe
--target=armv7-none-linux-androideabi
--gcc-toolchain=C:/android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64
--sysroot=C:/android/ndk/platforms/android-15/arch-arm -fPIC
-march=armv7-a -mthumb -mfpu=vfpv3-d16 -mfloat-abi=softfp
-funwind-tables -no-canonical-prefixes -fexceptions -frtti -g
-Wl,--fix-cortex-a8 -shared -Wl,-soname,libndk_test.so -o
libndk_test.so CMakeFiles/ndk_test.dir/main.cpp.o
"C:/android/ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_static.a"
"C:/android/ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++abi.a"
"C:/android/ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libandroid_support.a"
"C:/android/ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libunwind.a"
-latomic && cd ."



I'm still not able to build boost though. I did try switching to API
21 but I get a different set of errors:


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:74:
In file included from .\boost/config/posix_features.hpp:18:
In file included from
C:/android/ndk/platforms/android-21/arch-arm/usr/include\unistd.h:34:
In file included from
C:/android/ndk/platforms/android-21/arch-arm/usr/include\sys/select.h:35:
C:/android/ndk/platforms/android-21/arch-arm/usr/include\signal.h:86:18:
error: expected ';' at end of declaration list
    sighandler_t sa_handler;
                 ^
C:/android/ndk/platforms/android-21/arch-arm/usr/include\asm/signal.h:101:22:
note: expanded from macro 'sa_handler'
#define sa_handler _u._sa_handler
                     ^
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Boost - Users mailing list
On Wed, Mar 29, 2017 at 2:16 PM, John Maddock <[hidden email]> wrote:

>
>>
>> I'm still not able to build boost though. I did try switching to API
>> 21 but I get a different set of errors:
>>
>>
>> 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:74:
>> In file included from .\boost/config/posix_features.hpp:18:
>> In file included from
>> C:/android/ndk/platforms/android-21/arch-arm/usr/include\unistd.h:34:
>> In file included from
>> C:/android/ndk/platforms/android-21/arch-arm/usr/include\sys/select.h:35:
>> C:/android/ndk/platforms/android-21/arch-arm/usr/include\signal.h:86:18:
>> error: expected ';' at end of declaration list
>>      sighandler_t sa_handler;
>>                   ^
>>
>> C:/android/ndk/platforms/android-21/arch-arm/usr/include\asm/signal.h:101:22:
>> note: expanded from macro 'sa_handler'
>> #define sa_handler _u._sa_handler
>>                       ^
>
>
> OK, so you suckered me into this.... just installed Android NDK and it's a
> quoting problem, but what the issue is I'm not sure.  For example b2 invokes
> the compiler inside quotes like this:
>
> "clang++" <options> file.cpp
>
> Which produces:
>
> 'M:\data\boost\boost\\clang38++.exe' is not recognized as an internal or
> external command,
> operable program or batch file.
>
> So then you go into clang++cmd and maybe edit it so the %~dp0\ prefix is
> removed from the clang38 invocation (that's what I did anyway).  Now you
> get:
>
> .\boost/config/stdlib/libstdcpp3.hpp:78:12: fatal error: 'unistd.h' file not
>       found
> #  include <unistd.h>
>
> Even though if you search the toolset it clearly does have several copies of
> unistd.h there.
>
> And I'm wondering if you tried to fix that by editing the .cmd file and it's
> further messed up clang's include paths?
>
> Note that at any time, invoking clang via:
>
> clang++ <options> file.cpp
>
> Will work just fine.
>
> So in effect Boost.Build has been broken by trying to do the right thing and
> always quote the compiler invocation (and I'm pretty sure not quoting would
> break a bunch of other toolsets).
>
> So... which libraries do you require.... since most of them are "just a
> bunch of source files" the easiest solution would be to build what you need
> manually with something like:
>
> clang++ -c -I. -O3 -shared libs/boost-library-you-want/src/*.cpp
> mylibraryname.so
>
> which worked for me with a cursory test on Boost.System and Regex
>
> Hopefully someone can suggest a better long term fix, John.

+boost again

Yeah, you are running into the exact same set of issues I am. First I
ran into the %~dp0 issue, removed that, then the next thing is it
can't find any files.

I started using the boost cmake build process here:
https://github.com/Orphis/boost-cmake

This works perfectly once I specify a toolchain file to CMake for the
android NDK. Note that this solution means boost builds with the rest
of my targets, which isn't ideal, but at least boost builds
properly...

I really hate bjam/b2 with a passion. For as great as boost is as a
library, it's completely out of left field that they deal with this
garbage build system.
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Loading...