`bjam --toolset =` and tag values โ€‹โ€‹for Apple compilers?

When creating Boost binary libraries with bjam you can specify which compiler to use without specifying a specific version of the compiler using specific values โ€‹โ€‹for the --toolset= parameter. For instance:

bjam --with-serialization --toolset=msvc

the toolset msvc tells bjam to search your system for some version of Microsoft Visual C ++, and then use it to create several variations of the Boost.Serialization library. The resulting libraries will contain a tag indicating which toolbox was actually used. For example, the above command creates files such as:

 libboost_serialization-vc100-mt-s-1_44.lib libboost_serialization-vc100-mt-sgd-1_44.lib ... 

where the vc100 line in the file name is a toolet tag that indicates that a version of the Microsoft Visual C ++ 2010 compiler has been found and is being used to build libraries. [More information on Boost library file naming conventions can be found here. ]

You can also specify a specific version of the compiler using some other values โ€‹โ€‹for the --toolset= parameter. For instance:

bjam --with-serialization --toolset=msvc-9.0

tells bjam that even if I can have multiple compilers on my system, I want it to use Microsoft Visual C ++ 2008 specifically. As a result, the libraries contained a string of the vc90 tag to indicate that Microsoft Visual C ++ 2008 was used to create them.

The Boost documentation seems a bit outdated regarding the newer Mac compilers (e.g. how to distinguish between GCC, LLVM-GCC and LLVM?)

My question is, what are some of the other values โ€‹โ€‹of bjam --toolset= and their respective tags for specific compiler versions in Xcode 3 and Xcode 4 on Mac (not common compiler name values โ€‹โ€‹like darwin )? Are these documents documented anywhere? Even if Boost libraries with some versions are not yet supported by Boost, are the toolset and tag values โ€‹โ€‹not yet specified?

Please help replace ??? in this table:

 TOOL AND VERSION --toolset= TAG ====================================================== Microsoft Visual C++ 2008 msvc-9.0 vc90 Microsoft Visual C++ 2010 msvc-10.0 vc100 Apple (1) GCC 4.0 (2) ??? xgcc40 Apple GCC 4.2 ??? xgcc42 Apple LLVM GCC 4.2 ??? ??? Apple LLVM compiler 1.5 (2) ??? ??? Apple LLVM compiler 2.0 (3) ??? ??? 

(1) Apple releases its own versions of the GCC and LLVM compilers to add Apple extensions and behavior.

(2) Available only in Xcode 3.

(3) Available only in Xcode 4.

+5
source share
1 answer

There is a direct mapping of the toolbox to the base part of the tag. Therefore, for any specified Apple Xcode compiler that uses the darwin.jam beginning of the tag will always be xgcc (for Xcode GCC). The second part, that is, the version number of the compiler, is usually automatically detected from the compiler itself. The darwin.jam code for the darwin.jam tools uses -dumnpversion to find out what version it is (see line darwin.jam # 123). So a few things:

  1. For Xcode, this will always be toolset=darwin for the default g++ .
  2. For other non-default versions, you must configure site-config.jam or user-config.jam to tell Boost Build where and what compilers you have (see the BB configuration documentation).
  3. The toolset=darwin-<some_version> matches what you specified in your configuration.
  4. darwin.jam tools The darwin.jam tool supports smart compiler choices based on what you are trying to create to make it a little easier.

For example, I use something like the following for iOS development:

 using darwin : : /Xcode-path/usr/bin/g++-4.0 ; using darwin : : /Xcode-path/usr/bin/g++-4.2 ; using darwin : 4.2~iphone : /Xcode-path/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 -arch armv6 : <striper> : <architecture>arm <target-os>iphone ; using darwin : 4.2~iphonesim : /Xcode-path/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 : <striper> : <architecture>x86 <target-os>iphone ; 

What can I do for:

  1. bjam toolset=darwin-4.0 - for a regular build of OSX with GCC 4.0. Which leads to the xgcc-42 tag.
  2. bjam toolset=darwin-4.2 - similar for OSX and GCC 4.2. For which I would get the xgcc-42 tag.
  3. bjam toolset-darwin architecture=arm target-os=iphone - To build an iPhone device with GCC 4.2. xgcc42 also ends with xgcc42 which is a collision. But there is a limit to how much we can take into account in these tags. And this, as a rule, is not a problem, because in any case, the results are shared between platforms.

You can configure the use of one of the LLVM compilers by adding to your configuration:

 using darwin : 4.2~llvm~gcc : /Xcode-path/user/bin/llvm-g++ ; 

And call using bjam toolset=darwin-4.2~llvm~gcc . Unfortunately, the tag will also be xgcc-4.2 (again, it is based on the use of darwin.jam ). Thus, you will need to separate the resulting libraries from other GCC assemblies.

It is also unfortunate that there is no documented mapping location of the toolbox used with the tag value, except in the code (see BB common.jam Lines # 801 through # 841).

+7
source

All Articles