Possible to put path to boost library somewhere else than Jamroot file?

Hi, my question is whether I can put the path to the boost library in a another file than the Jamroot file (eg, boost-build.jam)? I run run longish simulations on multiple workstations, essentially Debian and Mac OS X machines. For good or bad reasons, the path to the boost library is differs between machines. I give the path via an <include> in the Jamroot file. Thus the Jamroot file has to be different on each machine. However, my code is synchronized via Subversion between the machines which poses a problem for the Jamroot file. Thus, I either can only do one-way synchronisation from one master computer and edit the Jamroot file on the other machines locally (marking the conflict as resolved after the first update after this edit) or exclude the Jamroot file from Subversion. Since I probably do modify the Jamroot file from time to time, it would be nice to include it in Subversion. Currently, I solve the problem by sticking to one-way synchronisation but if there would be another place to put the path, this would be nicer. Thanks. Markus

AMDG s seelenluft wrote:
my question is whether I can put the path to the boost library in a another file than the Jamroot file (eg, boost-build.jam)?
I run run longish simulations on multiple workstations, essentially Debian and Mac OS X machines. For good or bad reasons, the path to the boost library is differs between machines. I give the path via an <include> in the Jamroot file. Thus the Jamroot file has to be different on each machine. However, my code is synchronized via Subversion between the machines which poses a problem for the Jamroot file. Thus, I either can only do one-way synchronisation from one master computer and edit the Jamroot file on the other machines locally (marking the conflict as resolved after the first update after this edit) or exclude the Jamroot file from Subversion. Since I probably do modify the Jamroot file from time to time, it would be nice to include it in Subversion. Currently, I solve the problem by sticking to one-way synchronisation but if there would be another place to put the path, this would be nicer.
The easiest solution is to put it in user-config.jam or site-config.jam. In Christ, Steven Watanabe

On Fri, Jul 3, 2009 at 6:20 PM, Steven Watanabe
The easiest solution is to put it in user-config.jam or site-config.jam.
Thanks, can you help me with the syntax there, I had exe myname : myname.cpp : <include>. :<include>/usr/local/include/boost-1_39/ ; in my Jamroot file. Putting just <include>/usr/local/include/boost-1_39/ (with or without a trailing semicolon) just below my 'darwin ;' entry in user-config.jam does not work. Thanks, Markus

Try putting a space between the colon and "<include>/usr/local/...". - Sean

s seelenluft wrote:
On Fri, Jul 3, 2009 at 6:20 PM, Steven Watanabe
wrote: The easiest solution is to put it in user-config.jam or site-config.jam.
Thanks, can you help me with the syntax there, I had
exe myname : myname.cpp : <include>. :<include>/usr/local/include/boost-1_39/ ;
I don't think this is right. Per: http://www.boost.org/boost-build2/doc/html/bbv2/advanced/targets.html the syntax is: rule-name ( main-target-name : sources + : requirements * : default-build * : usage-requirements * ) So you should have: exe myname : myname.cpp : <include>. <include>/usr/local/include/boost-1_39/ ;
in my Jamroot file. Putting just
<include>/usr/local/include/boost-1_39/
(with or without a trailing semicolon) just below my 'darwin ;' entry in user-config.jam does not work.
You need to use project requirements in user-config.jam, see: http://www.boost.org/boost-build2/doc/html/bbv2/advanced/projects.html For example: project user-config : requirements <include>/usr/local/include/boost-1_39 ; - Volodya

exe myname : myname.cpp : <include>. :<include>/usr/local/include/boost-1_39/ ;
On Wed, Jul 8, 2009 at 11:23 AM, McLemon, Sean
Try putting a space between the colon and "<include>/usr/local/...".
Sorry, that was a typo in my message here. In the Jamroot file, there was a
space.
On Wed, Jul 8, 2009 at 3:14 PM, Vladimir Prus
I don't think this is right. Per:
http://www.boost.org/boost-build2/doc/html/bbv2/advanced/targets.html
the syntax is:
rule-name ( main-target-name : sources + : requirements * : default-build * : usage-requirements * )
So you should have:
exe myname : myname.cpp : <include>. <include>/usr/local/include/boost-1_39/ ;
You might very well be correct in this but it works fine with and without the colon (some leniency in bjam, I assume).
You need to use project requirements in user-config.jam, see:
http://www.boost.org/boost-build2/doc/html/bbv2/advanced/projects.html
For example:
project user-config : requirements <include>/usr/local/include/boost-1_39 ;
Maybe we are talking about different user-config.jam files. I have put the entry 'using darwin ;' into the user-config.jam file sitting in /usr/share/boost-build as it is a project-independent settings (as would be the location of the libraries). I would not want to put any project-specific settings in this file. But without fully understanding it, I put your above-mentioned line into the user-config.jam file, it does not work (it complains about not finding the boost library, or more specifically the specific file I included in the header of my .cpp file). Trying out: project myprojectname : requirements <include>/usr/local/include/boost-1_39 ; also does not work. But I have now found another solution: I have put 'export BOOSTROOT="/usr/local/include/boost-1_39" (or the corresponding path on different machines) in my .bashrc file and ' <include>$BOOSTROOT'. They Jamroot file can now be the same on all machines. Markus

s seelenluft wrote:
exe myname : myname.cpp : <include>. :<include>/usr/local/include/boost-1_39/ ;
On Wed, Jul 8, 2009 at 11:23 AM, McLemon, Sean
wrote: Try putting a space between the colon and "<include>/usr/local/...".
Sorry, that was a typo in my message here. In the Jamroot file, there was a space.
On Wed, Jul 8, 2009 at 3:14 PM, Vladimir Prus
wrote: I don't think this is right. Per:
http://www.boost.org/boost-build2/doc/html/bbv2/advanced/targets.html
the syntax is:
rule-name ( main-target-name : sources + : requirements * : default-build * : usage-requirements * )
So you should have:
exe myname : myname.cpp : <include>. <include>/usr/local/include/boost-1_39/ ;
You might very well be correct in this but it works fine with and without the colon (some leniency in bjam, I assume).
You need to use project requirements in user-config.jam, see:
http://www.boost.org/boost-build2/doc/html/bbv2/advanced/projects.html
For example:
project user-config : requirements <include>/usr/local/include/boost-1_39 ;
Maybe we are talking about different user-config.jam files. I have put the entry 'using darwin ;' into the user-config.jam file sitting in /usr/share/boost-build as it is a project-independent settings (as would be the location of the libraries). I would not want to put any project-specific settings in this file.
In that case, you can also put file named project-config.jam in the root of your project and *do not* add it to any version control.
But without fully understanding it, I put your above-mentioned line into the user-config.jam file, it does not work (it complains about not finding the boost library, or more specifically the specific file I included in the header of my .cpp file). Trying out: project myprojectname : requirements <include>/usr/local/include/boost-1_39 ; also does not work.
This is fairly strange -- this functionality is available for years. Please pass --debug-configuration and note which user-config.jam is being loaded -- maybe you have one in home. - Volodya

On Thu, Jul 9, 2009 at 1:37 PM, Vladimir Prus
In that case, you can also put file named project-config.jam in the root of your project and *do not* add it to any version control.
But without fully understanding it, I put your above-mentioned line into the user-config.jam file, it does not work (it complains about not finding the boost library, or more specifically the specific file I included in the header of my .cpp file). Trying out: project myprojectname : requirements <include>/usr/local/include/boost-1_39 ; also does not work.
This is fairly strange -- this functionality is available for years. Please pass --debug-configuration and note which user-config.jam is being loaded -- maybe you have one in home.
I have figured it out. Whereas the Jamroot file can take a relative path, the user-config.jam needs the absolute path. Why would I use the relative path for the boost library? Simply because, I only have access to my home folder on the Linux machines, thus I put everything (bjam binary, boost-build 'library' and boost library) into my home folder and found it easier to use the relative path. The user-config.jam method works [with the absolute path and the project name], the project-config.jam file does not work (according to --debug-configuration bjam never looks for a project-config.jam). But even if it worked, I probably would prefer the .bashrc route as I often check out multiple versions of my code, have to add a non-versioned file to each of these every time, is more cumbersome then by using an environment variable in the .bashrc file. Thanks for your help anyway. Markus
participants (4)
-
McLemon, Sean
-
s seelenluft
-
Steven Watanabe
-
Vladimir Prus