expected behaviours of bjam and boost?
Hi I'm trying to figure out what the roles of different files are in the bjam system. The basic problem is that I don't know what should "just work" and what I should expect to configure. Assuming that I've got a properly installed boost, should I expect to be able to link to e.g. boost.program_options as follows: exe my_exe : my_code.cpp /boost/program_options//program_options ; (if the above fails but the code is good, does that indicate a problem with the installation? The boost Jamroot file suggested in answer to my previous question seems to be intended to define the boost project.) I have a lot of libraries in /sw/include and /sw/lib. Is there an easy way to add them to my search path? For example, I have included in my site-config.jam file the following: project site-config : requirements <include>/sw/include ; Is here an equivalent for libraries? Fiddling with LD_LIBRARY_PATH or DYLD_LIBRARY_PATH seems to be asking for trouble. Also, I have to compile python modules with the following command line: bjam --libdir=/sw/lib/python2.5 --undefined=-Wl,-flat_namespace,- undefined,dynamic_lookup --compatibility_version=1.35.0 -- current_version=1.35.0 my_target (I have set using python ; in my site-config.) If I take out any of those options, the compile fails. Is it all really necessary though? Or should I define it in a config file somewhere? Thanks for your time. David
David Philp wrote:
Hi
I'm trying to figure out what the roles of different files are in the bjam system. The basic problem is that I don't know what should "just work" and what I should expect to configure.
Assuming that I've got a properly installed boost, should I expect to be able to link to e.g. boost.program_options as follows:
exe my_exe : my_code.cpp /boost/program_options//program_options ;
This should work provided: - you have complete Boost source tree (with no random missing files :-) - you have, in your project: use-project /boost : <path-to-boost-source-tree-root> ;
(if the above fails but the code is good, does that indicate a problem with the installation? The boost Jamroot file suggested in answer to my previous question seems to be intended to define the boost project.)
I have a lot of libraries in /sw/include and /sw/lib. Is there an easy way to add them to my search path? For example, I have included in my site-config.jam file the following:
project site-config : requirements <include>/sw/include ;
Is here an equivalent for libraries?
<library-path>
Fiddling with LD_LIBRARY_PATH or DYLD_LIBRARY_PATH seems to be asking for trouble.
Also, I have to compile python modules with the following command line: bjam --libdir=/sw/lib/python2.5 --undefined=-Wl,-flat_namespace,- undefined,dynamic_lookup --compatibility_version=1.35.0 -- current_version=1.35.0 my_target
(I have set using python ; in my site-config.) If I take out any of those options, the compile fails. Is it all really necessary though? Or should I define it in a config file somewhere?
Honestly, I don't know what any of those options do. - Volodya
Hi Thanks for your help. It now all works. If you don't mind, I've got some follow-up questions because I'm still not sure how this should be working.
exe my_exe : my_code.cpp /boost/program_options//program_options ;
This should work provided:
- you have complete Boost source tree (with no random missing files :-) - you have, in your project:
use-project /boost : <path-to-boost-source-tree-root> ;
Ok. It doesn't work because I don't have the Boost source tree, and the fink package isn't supposed to be a boost source tree (it's intended to be a binary distribution of the libraries, + headers, + bjam, + whatever is appropriate). My site-config now has project site-config : requirements <include>/sw/include <library-path>/sw/lib ; and the project file: lib boost_program_options ; exe my_exe : my_source.cpp boost_program_options ; Is this "the proper" (i.e. platform- & site-independent, designer- intended, future-proof) way of referring to "boost.program_options"? Or, is use of /boost/program_options//program_options meant to be "the" way of referring to the boost source? My guess is that the former is appropriate if one is "merely using" boost, but the latter is appropriate for developing boost. (Who does the bjam documentation? Once I've got this sorted, I'd like to write a bit on "how to access system libraries" if that would be useful. I can't find any reference at all to <library-path>.)
Also, I have to compile python modules with the following command line: bjam --libdir=/sw/lib/python2.5 --undefined=-Wl,-flat_namespace,- undefined,dynamic_lookup --compatibility_version=1.35.0 -- current_version=1.35.0 my_target
(I have set using python ; in my site-config.) If I take out any of those options, the compile fails. Is it all really necessary though? Or should I define it in a config file somewhere?
Honestly, I don't know what any of those options do.
Neither do I... they were suggested by the fink maintainer, and I have trimmed them down to the point where it fails if I don't include them. I suppose my question is: is darwin.jam or something else just supposed to define these, so that bjam "just knows" that these options are required? D
participants (2)
-
David Philp
-
Vladimir Prus