I am trying to use the bcp tool in Boost to extract a subset of headers/libraries to use in my project.
- OS: Linux Ubuntu 12.04 LTS x64
- Boost version: 1.56.0, downloaded as source code from boost.org
I want to use a custom namespace as well, which bcp supplied, but the resulting code needs to be built, and this is not as straightforward as it should be.
I would have thought a simple
./dist/bin/bcp --namespace=myboost build filesystem ../myboost
would be enough to produce a set of files that could build the 'filesystem' library, but there seems to be extra problems that just keep cropping up.
I have read as many related posts all over the web that I could find, and yet none have presented a solution that works.
Steps I've followed and the corresponding error messages are detailed below.
After extracting the boost 1.56.0 tarball, I have done the following:
./bootstrap.sh
./b2 tools/bcp
mkdir ../myboost
./dist/bin/bcp --namespace=myboost build filesystem ../myboost
The files copied into ../myboost don't include a bootstrap.sh, b2, bjam or other *.jam files, which seem to be something the 'build' target should be including, right?
Other sources (including stackoverflow posts) have suggested copying these files from the original boost location:
cp bootstrap.sh boost-build.jam boostcpp.jam ../myboost
cd ../myboost
./bootstrap.sh
This then builds b2 and bjam ok.
When running b2, things fall over:
./b2
/work/approved-osslibs/boost/boost-1.56.0/myboost/tools/build/src/build /project.jam:262: in find-jamfile from module project
error: Unable to load Jamfile.
error: Could not find a Jamfile in directory 'tools/inspect/build'.
error: Attempted to find it with pattern '[Bb]uild.jam [Jj]amfile.v2 [Jj]amfile [Jj]amfile.jam'.
error: Please consult the documentation at 'http://www.boost.org'.
<error backtrace lines snipped>
So this implies to me that the 'build' tool relies on 'inspect', so we go back and copy that:
cd ../boost_1_56_0
./dist/bin/bcp --namespace=myboost inspect ../myboost
cd ../myboost
./b2
which results in the error:
/work/myboost/tools/build/src/build/project.jam:262: in find-jamfile from module project
error: Unable to load Jamfile.
error: Could not find a Jamfile in directory 'libs/wave/tool/build'.
error: Attempted to find it with pattern '[Bb]uild.jam [Jj]amfile.v2 [Jj]amfile [Jj]amfile.jam'.
error: Please consult the documentation at 'http://www.boost.org'.
<error backtrace lines snipped>
So that means 'build' also depends on wave...
cd ../boost_1_56_0
./dist/bin/bcp --namespace=myboost wave ../myboost
cd ../myboost
./b2
At which point I encounter this error:
/work/myboost/tools/build/src/build/targets.jam:397: in find-really
*** argument error
* rule project.is-registered-id ( id )
* called with: ( )
* missing argument id
/work/myboost/tools/build/src/build/project.jam:600:see definition of rule 'project.is-registered-id' being called
<error backtrace lines snipped>
I have found this particular error relating to the boost filesystem library referenced in this ticket but that was supposed to have been fixed so I wasn't expecting to see it in Boost 1.56.0 which is the latest release.
What is going on?
Why can't bcp create an executable build system for just one boost library?
Why is build dependent on inspect and wave, which add a LOT more headers to the extracted "myboost" than should be necessary?
Any help on this issue would be appreciated.
chrono
,inspect
,system
andwave
to get it to work. I can only guess that the current version ofbcp
isn't so good at picking up transitive dependencies among Boost components. Anyway, adding those other two libs (just like you did withwave
andinspect
) was enough to make it work for me.cp -a $BOOST_ROOT/boost/atomic $TARGET_DIR/boost
to get everything to compile. I don't know if it's just that I'm Doing It Wrong™, but this is pretty typical of my experience withbcp
: it never gets the dependencies quite right, so you always have to do some manual copying to bring over missing headers, or invoke it a second time with an explicit list of libs it missed. Still a hella useful tool!