
I am working on a lib that is laid out in typical boost fashion: a directory with boost/rdb/includes.hpp, libs/rdb/src/stuff.cpp. When I put these two directories right inside a Boost tree that builds properly with bjam, I can build my libs as well (via chdir to libs/rdb/test and run bjam). I managed to get that much working. Now I would like to build outside the boost tree. I have found this message:http://lists.boost.org/boost-build/2002/11/2221.php but the link it contains is broken. I have tried to locate the information in the doc for half an hour now, without success. I tried to set BOOST_BUILD_PATH AND BOOST_ROOT to point to the boost tree. And copied boost-build.jam to the root of my dir. Can someone help me with this please? TIA, J-L

Hi, Maybe if you show what kind of errors do you get could help. Could you give the values of BOOST_BUILD_PATH and BOOST_ROOT ? Best, Vicente ----- Original Message ----- From: "Jean-Louis Leroy" <jl@yorel.be> To: <boost@lists.boost.org> Sent: Sunday, October 04, 2009 11:17 PM Subject: [boost] Bjam outside Boost tree
I am working on a lib that is laid out in typical boost fashion: a directory with boost/rdb/includes.hpp, libs/rdb/src/stuff.cpp. When I put these two directories right inside a Boost tree that builds properly with bjam, I can build my libs as well (via chdir to libs/rdb/test and run bjam). I managed to get that much working.
Now I would like to build outside the boost tree. I have found this message:http://lists.boost.org/boost-build/2002/11/2221.php but the link it contains is broken. I have tried to locate the information in the doc for half an hour now, without success. I tried to set BOOST_BUILD_PATH AND BOOST_ROOT to point to the boost tree. And copied boost-build.jam to the root of my dir.
Can someone help me with this please?
TIA, J-L
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Maybe if you show what kind of errors do you get could help. Could you give the values of BOOST_BUILD_PATH and BOOST_ROOT ?
Thanks. Everything is below. I think I am getting closer: maybe it's the way I refer to the test monitor: ../../test/build//boost_test_exec_monitor I gues I should put a bjam variable there... J-L
cd C:\Users\JLL\Documents\Visual Studio 2008\Projects\rdb.hg
set B Environment variable B not defined
tree C:. ├───boost │ └───rdb │ └───sql │ └───detail └───libs └───rdb ├───build ├───doc │ └───templates ├───msvc │ ├───examples │ ├───odbc │ ├───rdb │ ├───test_odbc │ ├───test_rdb │ └───tutorial ├───src └───test
My boost tree is at: C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0 For the first attempt: no Jamfile in the root of my tree.
cd libs\rdb\test bjam Unable to load Boost.Build: could not find "boost-build.jam"
bjam --build-path "C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0" Unable to load Boost.Build: could not find "boost-build.jam"
set BOOST_BUILD_PATH="C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0"
bjam error: Could not find parent for project at '.' error: Did not find Jamfile.jam or Jamroot.jam in any parent directory.
copy ..\..\..\..\boost_1_40_0\Jamroot "C:\Users\JLL\Documents\Visual Studio 2008\Projects\rdb.hg" 1 file(s) copied.
bjam warning: No toolsets are configured. warning: Configuring default toolset "msvc". warning: If the default is wrong, your build may not work correctly. warning: Use the "toolset=xxxxx" option to override our guess. warning: For more configuration options, please consult warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html error: Unable to find file or target named error: '../../test/build//boost_test_exec_monitor' error: referred from project at error: '.'
type Jamfile.v2 # bring in rules for testing import testing ;
project : requirements <library>../build//boost_rdb <link>static ; { test-suite "rdb" : [ run test.cpp ../../test/build//boost_test_exec_monitor ] ; }

Hi, If I'm not wrong you need to add \tools\build\v2 on the BOOST_BUILD_PATH setting BOOST_BUILD_PATH="C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0\tools\build\v2" Do you have a Jamroot.jam file on your project directory? Vicente ----- Original Message ----- From: "Jean-Louis Leroy" <jl@yorel.be> To: <boost@lists.boost.org> Sent: Monday, October 05, 2009 12:13 AM Subject: Re: [boost] Bjam outside Boost tree
Maybe if you show what kind of errors do you get could help. Could you give the values of BOOST_BUILD_PATH and BOOST_ROOT ?
Thanks. Everything is below. I think I am getting closer: maybe it's the way I refer to the test monitor: ../../test/build//boost_test_exec_monitor
I gues I should put a bjam variable there...
J-L
cd C:\Users\JLL\Documents\Visual Studio 2008\Projects\rdb.hg
set B Environment variable B not defined
tree C:. ├───boost │ └───rdb │ └───sql │ └───detail └───libs └───rdb ├───build ├───doc │ └───templates ├───msvc │ ├───examples │ ├───odbc │ ├───rdb │ ├───test_odbc │ ├───test_rdb │ └───tutorial ├───src └───test
My boost tree is at: C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0
For the first attempt: no Jamfile in the root of my tree.
cd libs\rdb\test bjam Unable to load Boost.Build: could not find "boost-build.jam"
bjam --build-path "C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0" Unable to load Boost.Build: could not find "boost-build.jam"
set BOOST_BUILD_PATH="C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0"
bjam error: Could not find parent for project at '.' error: Did not find Jamfile.jam or Jamroot.jam in any parent directory.
copy ..\..\..\..\boost_1_40_0\Jamroot "C:\Users\JLL\Documents\Visual Studio 2008\Projects\rdb.hg" 1 file(s) copied.
bjam warning: No toolsets are configured. warning: Configuring default toolset "msvc". warning: If the default is wrong, your build may not work correctly. warning: Use the "toolset=xxxxx" option to override our guess. warning: For more configuration options, please consult warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html error: Unable to find file or target named error: '../../test/build//boost_test_exec_monitor' error: referred from project at error: '.'
type Jamfile.v2 # bring in rules for testing import testing ;
project : requirements <library>../build//boost_rdb <link>static ; { test-suite "rdb" : [ run test.cpp ../../test/build//boost_test_exec_monitor ] ; }
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

If I'm not wrong you need to add \tools\build\v2 on the BOOST_BUILD_PATH setting
BOOST_BUILD_PATH="C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0\tools\build\v2"
I got closer to making it work with: [ run test.cpp $(boost-build)libs/test/build//boost_test_exec_monitor Now everything compiles but I get link errors: msvc.link ..\..\..\bin.v2\libs\rdb\test\test.test\msvc-9.0express\debug\link-static\test.exe test.obj : error LNK2019: unresolved external symbol "class boost::unit_test::master_test_suite_t & __cdecl boost::unit_ test::framework::master_test_suite(void)" (?master_test_suite@framework@unit_test@boost@@YAAAVmaster_test_suite_t@23@XZ) referenced in function "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_u nit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z)
Do you have a Jamroot.jam file on your project directory?
A Jamroot (sans extension), copied from the boost tree. J-L

AMDG Jean-Louis Leroy wrote:
If I'm not wrong you need to add \tools\build\v2 on the BOOST_BUILD_PATH setting
BOOST_BUILD_PATH="C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0\tools\build\v2"
I got closer to making it work with: [ run test.cpp $(boost-build)libs/test/build//boost_test_exec_monitor
Now everything compiles but I get link errors:
msvc.link ..\..\..\bin.v2\libs\rdb\test\test.test\msvc-9.0express\debug\link-static\test.exe
test.obj : error LNK2019: unresolved external symbol "class boost::unit_test::master_test_suite_t & __cdecl boost::unit_ test::framework::master_test_suite(void)" (?master_test_suite@framework@unit_test@boost@@YAAAVmaster_test_suite_t@23@XZ)
referenced in function "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_u nit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z)
You need to link to boost_unit_test_framework instead of boost_test_exec_monitor.
Do you have a Jamroot.jam file on your project directory?
A Jamroot (sans extension), copied from the boost tree.
Don't copy it. You can just create an empty Jamroot.jam. In Christ, Steven Watanabe

Sorry I don't read the complete mail. More below ----- Original Message ----- From: "vicente.botet" <vicente.botet@wanadoo.fr> To: <boost@lists.boost.org> Sent: Monday, October 05, 2009 12:21 AM Subject: Re: [boost] Bjam outside Boost tree
Hi, If I'm not wrong you need to add \tools\build\v2 on the BOOST_BUILD_PATH setting
BOOST_BUILD_PATH="C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0\tools\build\v2"
Do you have a Jamroot.jam file on your project directory?
Vicente ----- Original Message ----- From: "Jean-Louis Leroy" <jl@yorel.be> To: <boost@lists.boost.org> Sent: Monday, October 05, 2009 12:13 AM Subject: Re: [boost] Bjam outside Boost tree
Maybe if you show what kind of errors do you get could help. Could you give the values of BOOST_BUILD_PATH and BOOST_ROOT ?
Thanks. Everything is below. I think I am getting closer: maybe it's the way I refer to the test monitor: ../../test/build//boost_test_exec_monitor
I gues I should put a bjam variable there...
J-L
cd C:\Users\JLL\Documents\Visual Studio 2008\Projects\rdb.hg
set B Environment variable B not defined
tree C:. ├───boost │ └───rdb │ └───sql │ └───detail └───libs └───rdb ├───build ├───doc │ └───templates ├───msvc │ ├───examples │ ├───odbc │ ├───rdb │ ├───test_odbc │ ├───test_rdb │ └───tutorial ├───src └───test
My boost tree is at: C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0
For the first attempt: no Jamfile in the root of my tree.
cd libs\rdb\test bjam Unable to load Boost.Build: could not find "boost-build.jam"
bjam --build-path "C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0" Unable to load Boost.Build: could not find "boost-build.jam"
set BOOST_BUILD_PATH="C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0"
bjam error: Could not find parent for project at '.' error: Did not find Jamfile.jam or Jamroot.jam in any parent directory.
copy ..\..\..\..\boost_1_40_0\Jamroot "C:\Users\JLL\Documents\Visual Studio 2008\Projects\rdb.hg" 1 file(s) copied.
bjam warning: No toolsets are configured. warning: Configuring default toolset "msvc". warning: If the default is wrong, your build may not work correctly. warning: Use the "toolset=xxxxx" option to override our guess. warning: For more configuration options, please consult warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html error: Unable to find file or target named error: '../../test/build//boost_test_exec_monitor' error: referred from project at error: '.'
type Jamfile.v2 # bring in rules for testing import testing ;
project : requirements <library>../build//boost_rdb <link>static ; { test-suite "rdb" : [ run test.cpp ../../test/build//boost_test_exec_monitor ] ; }
have you tried the BOOST_ROOT absolute path instead of a relative one, here [ run test.cpp ../../test/build//boost_test_exec_monitor ] ?

AMDG Jean-Louis Leroy wrote:
<snip>
My boost tree is at: C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0
For the first attempt: no Jamfile in the root of my tree.
cd libs\rdb\test bjam Unable to load Boost.Build: could not find "boost-build.jam"
bjam --build-path "C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0" Unable to load Boost.Build: could not find "boost-build.jam"
set BOOST_BUILD_PATH="C:\Users\JLL\Documents\Visual Studio 2008\Projects\boost_1_40_0"
bjam error: Could not find parent for project at '.' error: Did not find Jamfile.jam or Jamroot.jam in any parent directory.
copy ..\..\..\..\boost_1_40_0\Jamroot "C:\Users\JLL\Documents\Visual Studio 2008\Projects\rdb.hg" 1 file(s) copied.
Copying Jamroot probably won't work very well. Try creating a Jamroot that contains just use-project /boost : "C:/Users/JLL/Documents/Visual Studio 2008/Projects/boost_1_40_0" ;
bjam warning: No toolsets are configured. warning: Configuring default toolset "msvc". warning: If the default is wrong, your build may not work correctly. warning: Use the "toolset=xxxxx" option to override our guess. warning: For more configuration options, please consult warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html error: Unable to find file or target named error: '../../test/build//boost_test_exec_monitor' error: referred from project at error: '.'
type Jamfile.v2 # bring in rules for testing import testing ;
project : requirements <library>../build//boost_rdb <link>static ; { test-suite "rdb" : [ run test.cpp ../../test/build//boost_test_exec_monitor ] ; }
Try /boost/test//boost_test_exec_monitor If you use path instead of a project id, you need to make sure that it refers to the directory where the library is defined. In Christ, Steven Watanabe

Copying Jamroot probably won't work very well. Try creating a Jamroot that contains just
use-project /boost : "C:/Users/JLL/Documents/Visual Studio 2008/Projects/boost_1_40_0" ;
One step back ;-) C:\Users\JLL\Documents\Visual Studio 2008\Projects\rdb.hg\libs\rdb\build\Jamfile.v2:28: in modules.load rule boost-install unknown in module Jamfile</C:/Users/JLL/Documents/Visual Studio 2008/Projects/rdb.hg/libs/rdb/build>. C:/Users/JLL/Documents/Visual Studio 2008/Projects/boost_1_40_0/tools/build/v2/build\project.jam:313: in load-jamfile C:/Users/JLL/Documents/Visual Studio 2008/Projects/boost_1_40_0/tools/build/v2/build\project.jam:62: in load C:/Users/JLL/Documents/Visual Studio 2008/Projects/boost_1_40_0/tools/build/v2/build\project.jam:168: in project.find Thanks you two for helping, J-L

AMDG Jean-Louis Leroy wrote:
I am working on a lib that is laid out in typical boost fashion: a directory with boost/rdb/includes.hpp, libs/rdb/src/stuff.cpp. When I put these two directories right inside a Boost tree that builds properly with bjam, I can build my libs as well (via chdir to libs/rdb/test and run bjam). I managed to get that much working.
Now I would like to build outside the boost tree. I have found this message:http://lists.boost.org/boost-build/2002/11/2221.php but the link it contains is broken. I have tried to locate the information in the doc for half an hour now, without success. I tried to set BOOST_BUILD_PATH AND BOOST_ROOT to point to the boost tree. And copied boost-build.jam to the root of my dir.
The boost-build.jam in the Boost distribution uses a relative path. You need to adjust it to point to the actual location of Boost.Build. In Christ, Steven Watanabe

The boost-build.jam in the Boost distribution uses a relative path. You need to adjust it to point to the actual location of Boost.Build.
Mine doesn't contain any paths: # Copyright 2001, 2002 Dave Abrahams # Copyright 2002 Rene Rivera # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) boost-build kernel ; J-L

AMDG Jean-Louis Leroy wrote:
The boost-build.jam in the Boost distribution uses a relative path. You need to adjust it to point to the actual location of Boost.Build.
Mine doesn't contain any paths:
Yes it does. kernel is a directory.
# Copyright 2001, 2002 Dave Abrahams # Copyright 2002 Rene Rivera # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
boost-build kernel ;
In Christ, Steven Watanabe

After more hours on this I still cannot make it work. I have tried again from scratch. I have unpacked the 1.40 distro in \temp and built boost.filesystem from within the boost tree (it's the project I used as a template for rdb). It builds ok. Then I copied libs\filesystem to \temp and created an empty Jamroot and a boost-build.jam in its root dir, containing: boost-build C:/TEMP/boost_1_40_0/tools/build/v2 ; This is coherent with the post I found on the internet, with Steve's recommandations, and http://www.boost.org/doc/libs/1_40_0/doc/html/bbv2/reference.html However when I try bjam from \temp\filesystem\build I get the message: rule boost-install unknown in module Jamfile</C:/TEMP/filesystem/build> I put my boost-build.jam at the top of the boost tree and tried again building from inside the tree with `bjam -d+5`. It built ok and I could see in the log that my boost-build.jam was picked: jambase.c:72:>> local boost-build-files = C:\TEMP\boost_1_40_0\boost-build.jam jambase.c:75:>> set .boost-build-file = C:\TEMP\boost_1_40_0\boost-build.jam ...so it looks like the content is correct. Then I sought where the boost-install rule pops into existence. This seems to happen here: C:/TEMP/boost_1_40_0/tools/build/v2/kernel\modules.jam:170:>>>>|>>>>|>>>>|>>>>|>>>> local rules = using import project constant path-constant use-project build-project explicit glob glob-tree conditional option handle-static-runtime libraries-to-install tag make-unversioned-links boost-install Examining `modules.jam` suggests that a bunch of build rules are dynamically extracted from all the libs in the tree and boost-install is one of them. So at this point my understanding is that there are two things going on: getting bjam to work - it seems to be dynamic in part, it locates and loads "a" build system ; Steve told me how to make that part work. The second thing is to use it to build a /boost lib/ with its dependencies (in my case the test harness) from elsewhere. In fact my initial post should have been entitled "Boost lib outside Boost tree", and not merely "Bjam outside...". Is this picture correct? Does any of the lib authors ever build from outside a boost tree? J-L

AMDG Jean-Louis Leroy wrote:
After more hours on this I still cannot make it work.
I have tried again from scratch. I have unpacked the 1.40 distro in \temp and built boost.filesystem from within the boost tree (it's the project I used as a template for rdb). It builds ok. Then I copied libs\filesystem to \temp and created an empty Jamroot and a boost-build.jam in its root dir, containing:
boost-build C:/TEMP/boost_1_40_0/tools/build/v2 ;
This is coherent with the post I found on the internet, with Steve's recommandations, and http://www.boost.org/doc/libs/1_40_0/doc/html/bbv2/reference.html
However when I try bjam from \temp\filesystem\build I get the message: rule boost-install unknown in module Jamfile</C:/TEMP/filesystem/build>
I put my boost-build.jam at the top of the boost tree and tried again building from inside the tree with `bjam -d+5`. It built ok and I could see in the log that my boost-build.jam was picked:
jambase.c:72:>> local boost-build-files = C:\TEMP\boost_1_40_0\boost-build.jam jambase.c:75:>> set .boost-build-file = C:\TEMP\boost_1_40_0\boost-build.jam
...so it looks like the content is correct. Then I sought where the boost-install rule pops into existence. This seems to happen here:
C:/TEMP/boost_1_40_0/tools/build/v2/kernel\modules.jam:170:>>>>|>>>>|>>>>|>>>>|>>>> local rules = using import project constant path-constant use-project build-project explicit glob glob-tree conditional option handle-static-runtime libraries-to-install tag make-unversioned-links boost-install
Examining `modules.jam` suggests that a bunch of build rules are dynamically extracted from all the libs in the tree and boost-install is one of them.
boost-install is defined in the boost Jamroot. I had forgotten that libraries with separate source use boost-install. It isn't really used for anything. I'm not sure that it will work correctly outside the boost tree, so you can safely define it in your Jamroot to do nothing.
So at this point my understanding is that there are two things going on: getting bjam to work - it seems to be dynamic in part, it locates and loads "a" build system ; Steve told me how to make that part work. The second thing is to use it to build a /boost lib/ with its dependencies (in my case the test harness) from elsewhere. In fact my initial post should have been entitled "Boost lib outside Boost tree", and not merely "Bjam outside...".
Is this picture correct? Does any of the lib authors ever build from outside a boost tree?
In Christ, Steven Watanabe

boost-install [...] I'm not sure that it will work correctly outside the boost tree, so you can safely define it in your Jamroot to do nothing.
Thanks; I deleted it and added a <source> feature, also used $(boost-build) to find the test lib, now it works. # build/Jamfile.v2: project boost/rdb : source-location ../src ; SOURCES = rdb odbc ; lib boost_rdb : $(SOURCES).cpp : <include>../../.. ; # test/Jamfile.v2 import testing ; project : requirements <library>../build//boost_rdb <link>static <include>../../.. ; { test-suite "rdb" : [ run test.cpp $(boost-build)libs/test/build//boost_test_exec_monitor ] : ; } [end of code] J-L
participants (3)
-
Jean-Louis Leroy
-
Steven Watanabe
-
vicente.botet