Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a staged boost library?

Tags:

c++

boost

While trying to build the thrift c++ library, I came across the following error after specifying the --with-boost option.

If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.

I looked through the boost documentation (which is I am not overly familiar with), but I did not find a good definition for the term staged boost library. I see the parenthetical (still not installed), but there are many states that are a library can be in that fall under the category of not installed.

When I first download boost, I run ./bootstrap and ./b2 to compile it.

Is it staged at this point? Or do I have to do something else to make it staged?

like image 890
merlin2011 Avatar asked Apr 27 '15 00:04

merlin2011


2 Answers

You can call

b2 --help

to see options of Boost.Build, and there you can find

install                 Install headers and compiled library files to the
=======                 configured locations (below).
...
stage                   Build and install only compiled library files to the
=====                   stage directory.

The declaration of stage or install specifies whether the Boost Libraries are installed in a subfolder named stage or system-wide. The meaning of system-wide depends on the operating system. In Windows, the target directory is c:\boost, in Linux it is /usr/local. The target directory can also be explicitly specified using the -–prefix option. Also see this answer, I guess it will be helpful.

For more informations see Getting Started Guide for Windows or Linux.

like image 57
Nikolay K Avatar answered Sep 19 '22 23:09

Nikolay K


When you run .\b2 to compile Boost, it create a folder called stage and output of the compilation is put inside %BOOST_ROOT%\stage\lib folder. Now you can copy this lib folder somewhere and add that in to linker's path. However some projects might expect binaries to be available at stage\lib. So "staged" here means if you have libraries compiled and present in stage\lib folder. The .b2 command takes several different parameters to compile different kids of binaries, for example, below compiles binaries that are linked to shared runtime and targeting x64 architecture:

 b2 variant=debug,release link=shared runtime-link=shared address-model=64

Each variant of lib file name has tags so they don't overwrite each other, for example, libboost_date_time-vc140-mt-gd-1_62.lib.

like image 45
Shital Shah Avatar answered Sep 20 '22 23:09

Shital Shah