
Hello, I'm trying to build Boost libraries from source (I want to use Boost.Python and Boost.Test, also I want to use a compiler other than my system one). I grabbed the boost_1_45_0.tar.bz2 and boost-jam-3.1.18.tgz tarballs. Built Jam by doing ./build.sh gcc and then copied the bjam executable to my ~/bin directory which is in $PATH. Then I went to the boost_1_45_0/tools/build/v2/example/hello directory, ran bjam, the example compiled and I was able to run it successfuly. I created ~/boost-build.jam file with boost-build /usr/home/oxyd/development/boost/boost_1_45_0/tools/build/v2 ; in it. Then I came back to the boost_1_45_0 directory. As per the instructions -- http://www.boost.org/doc/libs/1_45_0/more/getting_started/unix-variants.html... -- I ran bjam and got an error: ~/development/boost/boost_1_45_0 > bjam toolset=gcc stage Class top-level-target already defined zsh: abort bjam toolset=gcc stage I have only Googled a little info on this error -- in fact, the only useful hit is this: http://lists.boost.org/boost-build/2009/05/21793.php . I guess I can just as well provide the info asked for in that post: ~/development/boost/boost_1_45_0 > grep 'class top-level-target' Jamroot | wc -l 1 -- exactly one occurence of class top-level-target there. The only Jam-related file in the directory is Jamroot. Running with --debug-loading I get the lovely output that I attached to this mail. Additionally, I'm running FreeBSD 8.1-RELEASE, and I want to use GCC 4.5.2 installed from Ports (system compiler is GCC 4.2.1). Thanks for any thoughts on the issue, Ondra

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Loading Jamfile at '/usr/home/oxyd/development/boost/boost_1_45_0' Assigned project target object(project-target)@557 to 'Jamfile' Loading Jamfile at '.' Initializing project 'Jamfile' Assigned project target object(project-target)@597 to 'Jamfile' Class top-level-target already defined zsh: abort bjam --debug-loading toolset=gcc stage Is there a second copy of boost in /usr/home/oxyd/BACKUP/development/boost/boost_1_45_0? That would be your problem, bjam is detecting the backup and the is confused, because there's a second Boost that's trying to become the top level target. I think. - -- Bryce Lelbach aka wash boost-spirit.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkznBOMACgkQO/fqqIuE2t7OFwCg2z1NoIDOLrp9PJs0KXZTlVyd 8X8AoK5iJZcYhKX21T2ahL981Dwlmfal =vyOw -----END PGP SIGNATURE-----

Is there a second copy of boost in /usr/home/oxyd/BACKUP/development/boost/boost_1_45_0?
That would be your problem, bjam is detecting the backup and the is confused, because there's a second Boost that's trying to become the top level target.
I think.
Unfortunately, no. ~/development is a symbolic link into ~/BACKUP/development, so both paths should be identical. I did try inside /tmp with no symlinks in path, but to no avail: result is still the same. Ondra

On 20 November 2010 01:55, Ondřej Majerech
Is there a second copy of boost in /usr/home/oxyd/BACKUP/development/boost/boost_1_45_0?
That would be your problem, bjam is detecting the backup and the is confused, because there's a second Boost that's trying to become the top level target.
I think.
Unfortunately, no. ~/development is a symbolic link into ~/BACKUP/development, so both paths should be identical.
I did try inside /tmp with no symlinks in path, but to no avail: result is still the same.
Ondra
Okay, I removed all traces of boost from my $HOME, and re-did from
start, this time placing it into ~/boost (where there should be no
surprising symlinks in path). I'm getting a different error now:
[starlight] ~/boost/boost_1_45_0 > bjam toolset=gcc stage
/usr/home/oxyd/boost/boost_1_45_0/tools/build/v2/build/configure.jam:145:
in builds-raw
*** argument error
* rule UPDATE_NOW ( targets * : log ? : ignore-minus-n ? )
* called with: (

Okay, I'll reply to myself for the last time. I got it working. The problem was that I was using bjam from the standalone Boost Jam tarball. Using the bjam bundled with the Boost tarball itself fixed it. I, however, believe that the documentation is very confusing on this matter. First, this -- http://www.boost.org/doc/libs/1_45_0/doc/html/jam/building.html -- says that bjam should be located in BOOST_ROOT/tools/jam/src. There is no such path in the latest Boost tarball. Second, documentation nowhere mentions that users are expected to use the bundled bjam -- or indeed that there *is* any bjam bundled with the boost tarball -- instead of the standalone bjam distribution. It would be great if the documentation were updated to reflect the latest correct build procedures. Thanks, Ondra

Ondřej Majerech wrote:
Okay, I'll reply to myself for the last time.
I got it working. The problem was that I was using bjam from the standalone Boost Jam tarball. Using the bjam bundled with the Boost tarball itself fixed it.
I, however, believe that the documentation is very confusing on this matter. First, this -- http://www.boost.org/doc/libs/1_45_0/doc/html/jam/building.html -- says that bjam should be located in BOOST_ROOT/tools/jam/src. There is no such path in the latest Boost tarball. Second, documentation nowhere mentions that users are expected to use the bundled bjam -- or indeed that there *is* any bjam bundled with the boost tarball -- instead of the standalone bjam distribution.
It would be great if the documentation were updated to reflect the latest correct build procedures.
What documentation are you looking at? The getting started guide recommends that you use: ./bootstrap.sh ./bjam to build boost. Have you seen that recommendation? If no, do you have any suggestions how to make it more visible? If yes, why have you decided not to follow it? Thanks, Volodya

On 22 November 2010 08:35, Vladimir Prus
What documentation are you looking at? The getting started guide recommends that you use:
./bootstrap.sh ./bjam
to build boost. Have you seen that recommendation? If no, do you have any suggestions how to make it more visible? If yes, why have you decided not to follow it?
This is what I'm looking at: http://www.boost.org/doc/libs/1_45_0/more/getting_started/unix-variants.html . Yes, I have seen that recommendation. However, it also says, "If you're using a compiler other than your system's default, you'll need to use Boost.Build to create binaries." in section 5.2. As using a compiler other than my system's default is exactly my case, I understood it that I should use instructions in section 5.2 instead of those in 5.1. Did I misunderstand this part? Ondra

On Mon, Nov 22, 2010 at 4:26 AM, Ondřej Majerech
On 22 November 2010 08:35, Vladimir Prus
wrote: What documentation are you looking at? The getting started guide recommends that you use:
./bootstrap.sh ./bjam
to build boost. Have you seen that recommendation? If no, do you have any suggestions how to make it more visible? If yes, why have you decided not to follow it?
This is what I'm looking at: http://www.boost.org/doc/libs/1_45_0/more/getting_started/unix-variants.html .
Yes, I have seen that recommendation. However, it also says, "If you're using a compiler other than your system's default, you'll need to use Boost.Build to create binaries." in section 5.2. As using a compiler other than my system's default is exactly my case, I understood it that I should use instructions in section 5.2 instead of those in 5.1. Did I misunderstand this part?
I'm having the exact same problem as Ondra: boost 1.45 does not seem to build the same way as boost 1.44 if you need to use a custom compiler or non-standard build variant, and the docs do not describe the new way of doing things. So: how do you build boost 1.45 with 1) a custom compiler and 2) non-standard build variants. In my case, I'm using a local build of GCC that is not in $PATH, and I need single-threaded, static libraries. Thanks! Greg

Greg Ward wrote:
On Mon, Nov 22, 2010 at 4:26 AM, Ondřej Majerech
wrote: On 22 November 2010 08:35, Vladimir Prus
wrote: What documentation are you looking at? The getting started guide recommends that you use:
./bootstrap.sh ./bjam
to build boost. Have you seen that recommendation? If no, do you have any suggestions how to make it more visible? If yes, why have you decided not to follow it?
This is what I'm looking at: http://www.boost.org/doc/libs/1_45_0/more/getting_started/unix-variants.html .
Yes, I have seen that recommendation. However, it also says, "If you're using a compiler other than your system's default, you'll need to use Boost.Build to create binaries." in section 5.2. As using a compiler other than my system's default is exactly my case, I understood it that I should use instructions in section 5.2 instead of those in 5.1. Did I misunderstand this part?
I'm having the exact same problem as Ondra: boost 1.45 does not seem to build the same way as boost 1.44 if you need to use a custom compiler or non-standard build variant, and the docs do not describe the new way of doing things.
So: how do you build boost 1.45 with 1) a custom compiler
The same way as 1.44: ./bootstrap.sh edit ./project-config.jam to specify your new compiler. ./bjam toolset=whatever-version
and 2) non-standard build variants.
By passing relevant options to "./bjam".
In my case, I'm using a local build of GCC that is not in $PATH, and I need single-threaded, static libraries.
Then, you'd edit 'using gcc' in project-config.jam to say: using gcc : : /full/path/to/g++ ; and run: ./bjam threading=single link=static - Volodya

On 27 November 2010 07:43, Vladimir Prus
Greg Ward wrote:
So: how do you build boost 1.45 with 1) a custom compiler
The same way as 1.44:
./bootstrap.sh edit ./project-config.jam to specify your new compiler. ./bjam toolset=whatever-version
That's excellent. I wish I'd known that before I started building Boost my way. Can this be put into the documentation, please? Preferrably into the Getting Started guide. Ondra

Ondřej Majerech wrote:
On 27 November 2010 07:43, Vladimir Prus
wrote: Greg Ward wrote:
So: how do you build boost 1.45 with 1) a custom compiler
The same way as 1.44:
./bootstrap.sh edit ./project-config.jam to specify your new compiler. ./bjam toolset=whatever-version
That's excellent. I wish I'd known that before I started building Boost my way.
Can this be put into the documentation, please? Preferrably into the Getting Started guide.
This *is* in the getting started guide. It appears that you're not the first one to miss that though, which suggests that the "Simplified build from source" section should be renamed to "Build from source" section and somewhat expanded, while the current "Build from source" section should be remained "How to build from source if you have really quirky requirements" and somewhat reduced. I'll try to do that for 1.46. - Volodya

On 28 November 2010 19:33, Vladimir Prus
Ondřej Majerech wrote:
On 27 November 2010 07:43, Vladimir Prus
wrote: Greg Ward wrote:
So: how do you build boost 1.45 with 1) a custom compiler
The same way as 1.44:
./bootstrap.sh edit ./project-config.jam to specify your new compiler. ./bjam toolset=whatever-version
That's excellent. I wish I'd known that before I started building Boost my way.
Can this be put into the documentation, please? Preferrably into the Getting Started guide.
This *is* in the getting started guide. It appears that you're not the first one to miss that though, which suggests that the "Simplified build from source" section should be renamed to "Build from source" section and somewhat expanded, while the current "Build from source" section should be remained "How to build from source if you have really quirky requirements" and somewhat reduced. I'll try to do that for 1.46.
I'm sorry, but the guide nowhere mentions that the Simplified Build method can be used with non-standard compiler and it also nowhere even suggests editing ./project-config.jam to suit the target environment. I think that expanding the Simplified Build part to include these things would indeed help a lot. On the other hand, I think the Build from Source If You Have Really Quirky Requirements part should also be expanded to at least mention that users are expected to use bjam and Boost.Build that are bundled in the tarball instead of using those from separate downloads. If you insist that these things already are in the documentation then please show me because I still don't believe you. Perhaps the guide assumes some deeper knowledge of the building process and that a user will be aware of the fact they can use the simple method with a little tweak to ./project-config.jam most of the times? I don't think a Getting Started guide should assume that as people who are already familiar with these things probably don't need a beginner's guide at all. I'm trying to be constructive here. And if I'm not the only to miss these bits then that indicates there's still a room for improvement. Ondra
participants (4)
-
Bryce Lelbach
-
Greg Ward
-
Ondřej Majerech
-
Vladimir Prus