Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost: How bjam constructs a library name?

I was looking in the jam files, how the name of library is constructed. Example: libboost_log-mgw46-mt-1_48.dll

I would like to ignore the last part, how to pass linker the -o parameter with my constructed name. I have few versions and linking in a big project forces me to do changes in project file and that is a lot of places.

My wish is to get libboost_log.dll. I did just rename, but when executing a program it says, that it can not find libboost_log-mgw46-mt-1_48.dll file.

like image 374
Sandro Grm Avatar asked Jan 20 '12 10:01

Sandro Grm


People also ask

Which Boost libraries need to be compiled?

Most Boost libraries are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking. The only Boost libraries that must be built separately are: Boost. Chrono.

Where do I put Boost library?

Building the special stage target places Boost library binaries in the stage/lib/ subdirectory of the Boost tree. To use a different directory pass the --stagedir=directory option to b2. b2 is case-sensitive; it is important that all the parts shown in bold type above be entirely lower-case.


1 Answers

Boost Bjam has 3 different layouts of naming defined. To quote the help placed in Jamroot file (I'm not aware of any better online documentation):

#   --layout=<layout>       Determines whether to choose library names #                           and header locations such that multiple #                           versions of Boost or multiple compilers can #                           be used on the same system. # #                               versioned - Names of boost binaries #                               include the Boost version number, name and #                               version of the compiler and encoded build #                               properties.  Boost headers are installed in a #                               subdirectory of <HDRDIR> whose name contains #                               the Boost version number. # #                               tagged -- Names of boost binaries include the #                               encoded build properties such as variant and #                               threading, but do not including compiler name #                               and version, or Boost version. This option is #                               useful if you build several variants of Boost, #                               using the same compiler. # #                               system - Binaries names do not include the #                               Boost version number or the name and version #                               number of the compiler.  Boost headers are #                               installed directly into <HDRDIR>.  This option #                               is intended for system integrators who are #                               building distribution packages. # #                           The default value is 'versioned' on Windows, and #                           'system' on Unix. 

The system layout gives the naming scheme you want - plain basename without any other information.

Names for Boost output files according to these layouts are generated using the tag rule, defined in boostcpp.jam file.

like image 104
Rafał Rawicki Avatar answered Oct 01 '22 08:10

Rafał Rawicki