On Friday 03 September 2004 12:06, David Abrahams wrote:
"Steven T. Hatton"
writes: From reading the documentation on boost.org, I have gotten the impression I don't need to set $BOOST_BUILD_PATH and $BOOST_ROOT.
Correct.
I've discovered BOOST_ROOT used in different places within the boost source tree. I don't recall exactly where, but somewhere in the sourcetree there is a comment telling me that most of the builds will require that I have $BOOST_ROOT correctly set. This is one place I found a reference to $BOOST_ROOT: subproject libs/test/example ; rule boost-test-example ( example-name : lib-name ) { exe $(example-name) : $(example-name).cpp <lib>../build/$(lib-name) : <sysinclude>$(BOOST_ROOT) <stlport-iostream>on <borland><*><cxxflags>-w-8080 ; } Can I assume that is ignored if it isn't set? I just removed the user space install, and started with a fresh source tree from the tarball. I have no boost related environment variable set. I did find it necessary to: export PYTHON_ROOT=/usr export PYTHON_VERSION=2.3
It doesn't hurt for you to set BOOST_ROOT, as long as you set it accurately. But you shouldn't need to.
Does it change the behavior of bjam to have it set? I'm a bit confused regarding which bjam version is invoked by default. The documentation suggests v1 will be invoke under certain conditions. All of my attempts to use the --v2 switch explicitly have resulted in a significant number of errors. That makes me thing the default is v1.
I'm using SuSE Linux 9.1 on a P4 box. Some basic questions are these:
When I downloaded and built boost, I first fetched the source for bjam.
Unneccessary, but it shouldn't hurt. The bjam sources are in the tools/build/jam_src directory of your Boost installation.
What do you mean by "Boost installation"? When I ran `bjam install' files were copied to /usr/local/include/boost-1_31/ # an acceptable location and /usr/local/lib # something I would never knowingly choose as a default I manually coppied the bjam executable (which I also built from the boost-1_31_0 tarball.) to /usr/local/bin. Beyond that, everything I got from the tarball still sits in the temporary directory I used for compilation. I Shall I assume you mean to call that source tree, and the files produced by my running the script bjam build.sh and subsequent invocations of bjam, the "Boost installation"? This is certainly not consistent with the way the term installation is used with the gnu autotools. Typically I would call the files placed in the --prefix directory the installation. There's nothing wrong with using a different definition, so long as we are aware of what it means in the given context.
This is the name of the file I downloaded: boost-jam-3.1.10.tgz It compiled quite nicely, and I copied the resulting bjam jam mkjambase and yyacc to a location in my path.
Why did you copy anything other than bjam?
I wasn't sure if the other executables might prove useful in the future. Since the script put four executables into the bin.linuxx86/ where the bjam file was placed, I assumed all of these were intended for my use.
Are there necessary configuration file that I need to have visible to these programs, even if they are not colocated?
Not exactly.
http://www.boost.org/tools/build/jam_src/#jambase_replacement
Ah yes, the source of much of my confusion: "The Boost.Build v2 initialization behavior has been implemented. This behavior only applies when the executable being invoked is called "bjam" or, for backward-compatibility, when the BOOST_ROOT variable is set." I'm not sure what that statement means. In particular, what is meant by "this behavior"? Does this mean the v2 behavior, or specifically the behavior described in the subsequent text? "We attempt to load "boost-build.jam" by searching from the current invocation directory up to the root of the file-system. This file is expected to invoke the boost-build rule to indicate where the Boost.Build system files are, and to load them." What are the "Boost.Build system files"? "The boost-build rule adds its (optional) argument to the front of BOOST_BUILD_PATH, and attempts to load bootstrap.jam from those directories." Is this bootstrap.jam for use when building my own projects, or only for use when building Boost libraries? Typically bootstraps are used in the gnu world as a means of building the gcc compiler, or Emacs which needs to be able to compile its own Lisp. They are not used after the first build, and do not become part of the installed package.
describes the file that bjam expects to see when it starts up. You might also drop a Jamrules file in the root directory of your own Boost.Build project (if you use bjam for your own project) that contains:
project boost : path/to/boost_1_31_0 ;
Does that mean the root of the directory structure of the tarball?
Well, yeah, except that using the BOOST_ROOT directory for your --prefix is probably a bad idea. I would leave the --prefix option off.
But that means everything is installed in the system's directory structure. That is not an ideal strategy for my purposes. All other libraries and tools I have are installed in my own user space.
Is there anything else I need to do in order to compile my programs against the boost headers and libraries?
Add the include/ directory to your #include path and the lib/ directory to your library search path?
By that am I to understand that when using the default installation my CPLUS_INCLUDE_PATH should contain /usr/local/include/boost-1_31 and my LIBRARY_PATH, and LD_LIBRARY_PATH should contain /usr/local/lib? -- Regards, Steven