Boost logo

Boost :

Subject: Re: [boost] cross-compilation: building boost on linux targetting osx
From: Frédéric Bron (frederic.bron_at_[hidden])
Date: 2017-03-04 05:39:14


>> 1. I give toolset clang to bootstrap.sh which sets the toolset to
>> clang in project-config.jam but clang-linux is used:
>> common.mkdir bin.v2/libs/system/build/clang-linux-3.8.1/release
>>
>> Should it be clang-darwin instead?
>
>
> bootstrap.sh builds b2 and the set of toolsets used for this is completely
> different than the one Boost.Build has. It needs to be a host native
> toolset.

OK, you're right. I now let it to its default and then change the
default toolset in project-config.jam to the one I want to use for
boost buidling.

>> Currently, I am using the following commands to build boost:
>
> ...
>>
>> and run b2:
>>
>> CC="x86_64-apple-darwin13-clang" CFLAGS="-O2 -DNDEBUG"
>> CXX="x86_64-apple-darwin13-clang++-libc++" CXXFLAGS="-O2 -DNDEBUG
>> -std=c++14"
>
>
> To my knowledge these environment variables aren't used by Boost.Build.
> Aren't they typically used by make, which isn't involved here?

You are right, not used by boost build but I just use to always do
this when I compile libraries because "normal" libraries use
./congiure; make; make install and use these.

> Why not put
> all the compiler flags in user-config.jam? You can use <linkflags> for the
> linker flags. Use quotes like this to reduce repetition: <cxxflags>"-x -y
> -z".

done, and this seems to have fixed my issues.
The reason I did not do it before was because they are some command
lines options for zlib, bzip2 and iconv:
-sICONV_PATH=/softs/osx64-clang-3.8.1/release/iconv
-sBZIP2_INCLUDE=/softs/osx64-clang-3.8.1/release/bzip2/include
-sBZIP2_LIBPATH=/softs/osx64-clang-3.8.1/release/bzip2/lib
-sZLIB_INCLUDE=/softs/osx64-clang-3.8.1/release/zlib/include
-sZLIB_LIBPATH=/softs/osx64-clang-3.8.1/release/zlib/lib

apprently they do not work very well.

>> ./b2 -d2
> This should make b2 print the full command-line of each command. Have you
> compared that to what you expect?

Yes, I have a full log with all commands. The right compiler is used
but ar and ranlib are not the right ones. I have to re-run them when
it is finished. Instead of linux ar and ranlib, I run
{i386,x86_64}-apple-darwin13-{ar,ranlib}.
Concerning dependencies, it is in the configure part that it happens
and can be found in bin.v2/config.log

>> boost.locale.iconv=on boost.locale.icu=off boost.locale.std=off
>
> I have never seen these before. Where are they described?

http://www.boost.org/doc/libs/1_63_0/libs/locale/doc/html/building_boost_locale.html

I have now fixed everything. I found that clang toolsets are broken in
case of cross-compilation. I had to manually modifiy them.
For example, <archiver> and <ranlib> are not used. plain "ar" and
"ranlib" are used.

Regards,

Frédéric


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