Building Boost (1.60) with Clang and NDK
Has anyone built the Boost with Clang and NDK other than CryStax? If so, can you post the related config.jam and build script? I have handled gcc build but clang is very very chalnllenging and no one including the guys in Stackoverflow could answer it. Many Thanks. Fatih
On 05/01/16 23:06, Fatih Kıralioğlu wrote:
Has anyone built the Boost with Clang and NDK other than CryStax? If so, can you post the related config.jam and build script? I have handled gcc build but clang is very very chalnllenging and no one including the guys in Stackoverflow could answer it.
Hi Fatih, We're building Boost libraries continuously with clang from CrystaX NDK. This is not much straightforward, but nothing magical. You can find our build script here: https://github.com/crystax/android-platform-ndk/blob/master/build/tools/buil.... Here is example how we build it with clang-3.7: $ ./build/tools/build-boost.sh --abis=armeabi-v7a,x86 --version=1.60.0 --stdlibs=llvm-3.7 $BOOST_DIR Here BOOST_DIR is directory containing folders named '1.59.0', '1.60.0', etc. This script will not work "as is" with Google's NDK due to many limitations of the last one, but anyway, looking into script's internals can help understand how to do that. Also, please take into account that many Boost libraries just could not be built with Google's NDK (those who requires good support from underlying libraries such as libc; language-only libraries like Boost.SmartPtr should work). -- Dmitry Moskalchuk
On 5 Jan 2016 at 20:06, Fatih Kıralioğlu wrote:
Has anyone built the Boost with Clang and NDK other than CryStax? If so, can you post the related config.jam and build script? I have handled gcc build but clang is very very chalnllenging and no one including the guys in Stackoverflow could answer it.
Boost.Thread is built nightly on the vanilla Android NDK with clang and has been for at least a year now. Boost.Thread drags in a lot of Boost with it, so I would expect most of the rest of Boost to also work. The build config is utterly standard, simply target-os=android and you use the arm-linux-androideabi-clang++ compiler from the toolchain/android-5.0/clang35/bin directory. Nothing magic nor special. This is why I didn't reply to your SO post, as a quick bit of searching this list or even stackoverflow would have yielded this answer. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
On Wednesday, January 06, 2016 04:06 AM, Fatih Kıralioğlu wrote:
Has anyone built the Boost with Clang and NDK other than CryStax? If so, can you post the related config.jam and build script? I have handled gcc build but clang is very very chalnllenging and no one including the guys in Stackoverflow could answer it.
I haven't noticed any problems building boost for Android with the NDK, I honestly have no idea why I see so many people asking how to do it, or patch sets or whatever. I'm using gcc-4.9 and std=c++14 on linux x64 targeting armv7. I package the toolset I want (android 15, gcc-4.9) and pass that sysroot in the CXXFLAGS, I tend not to interfere with the build system of boost or android very much, preferring to drive everything from cmake (for my own projects). What problems have you seen? The NDK is moving entirely to clang, the next release will see gcc deprecated, so I'll have to have a play with moving over to clang, but in my experience, everything I do works equally well on clang for armv7, armv8 and x64. The only problem I remember having is thread locals on iOS targets, but my memory is short, and it only takes a few lines of code to emulate that for most purposes. If you explain what problems you've seen, which libraries, toolsets and command lines, perhaps you'll trigger a memory of a problem I've solved. I can give you more details of my configuration on the weekend, if required. As a sidenote, I'm hoping to bring up a boost/clang/linux/armv8 build bot if and when my Pine64 arrives and I get Ubuntu/Debian running on it (by April if all goes well). I have no idea how quickly it will cycle though, my current x64 tests take around 16 hours for gcc-4.9, gcc-5.2 and clang-3.7, I'll probably have to drop gcc-4.9. I had to give up on my regular sanitizer builds on x64 as they just take too long and there seemed to be very little interest. Unfortunately I don't have dedicated machines to run the tests. Ben
participants (4)
-
Ben Pope
-
Dmitry Moskalchuk
-
Fatih Kıralioğlu
-
Niall Douglas