How does Boost.Build/bjam find boost?
Hello, I am starting to fiddle with boost and bjam and am not able to get bjam to find the boost headers and libraries. I'm running SuSE 9.1 and started out using the RPMs. Since last night, one-by-one I've uninstalled the RPMs and replaced with freshly downloaded and build components. Right now I have the latest boost,bjam and boost.build releases. I built boost with --prefix=/opt/boost and installed it. I have boost.build placed in /opt/boost as well. Under my home directory I have a directory in which I'm trying to build a hello-world program. The directory contents:
ls boost-build.jam Jamfile project-root.jam tst.cpp cat boost-build.jam boost-build /opt/boost/boost-build ; cat Jamfile exe tst : tst.cpp ; cat tst.cpp #include <iostream> #include <string> #include "boost/format.hpp"
int main() { std::cout << boost::format("%1%, world") % "hello" << std::endl; return 0; } project-root.jam is empty. When I try to build with 'bjam tst' it is not able to find the boost headers, which makes sense, because I've not been able to figure out how to indicate where they live. How is this accomplished? -K
Kelly Burkhart wrote:
cat Jamfile
exe tst : tst.cpp ;
When I try to build with 'bjam tst' it is not able to find the boost headers, which makes sense, because I've not been able to figure out how to indicate where they live.
How is this accomplished?
~~~Jamfile~~~ exe tst : tst.cpp : <sysinclude>/opt/boost/include/boost-1_32 ; ~~~Jamfile~~~ -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq
On Sat, 2005-03-12 at 20:03, Rene Rivera wrote:
Kelly Burkhart wrote:
cat Jamfile
exe tst : tst.cpp ;
When I try to build with 'bjam tst' it is not able to find the boost headers, which makes sense, because I've not been able to figure out how to indicate where they live.
How is this accomplished?
~~~Jamfile~~~ exe tst : tst.cpp : <sysinclude>/opt/boost/include/boost-1_32 ; ~~~Jamfile~~~
That doesn't seem to work: $ bjam --version Boost.Build V2 (Milestone 10) Boost.Jam 03.01.10 $ bjam tst /opt/boost/boost-build/build/property.jam:264: in validate1 from module property error: Invalid property '<sysinclude>/opt/boost/include/boost-1_32': unknown feature 'sysinclude'. /opt/boost/boost-build/build/property.jam:272: in validate from module property /opt/boost/boost-build/build/property.jam:410: in property.translate-paths from module property /opt/boost/boost-build/build/targets.jam:1202: in targets.main-target-requirements from module targets /opt/boost/boost-build/tools/builtin.jam:541: in exe from module builtin Jamfile:3: in modules.load from module Jamfile /opt/boost/boost-build/build/project.jam:255: in load-jamfile from module project /opt/boost/boost-build/build/project.jam:67: in project.load from module project /opt/boost/boost-build/build-system.jam:75: in load from module build-system /opt/boost/boost-build/kernel/modules.jam:259: in import from module modules /opt/boost/boost-build/kernel/bootstrap.jam:120: in boost-build from module /home/kelly/bt/boost-build.jam:1: in module scope from module
Kelly Burkhart wrote:
On Sat, 2005-03-12 at 20:03, Rene Rivera wrote:
Kelly Burkhart wrote:
cat Jamfile
exe tst : tst.cpp ;
When I try to build with 'bjam tst' it is not able to find the boost headers, which makes sense, because I've not been able to figure out how to indicate where they live.
How is this accomplished?
~~~Jamfile~~~ exe tst : tst.cpp : <sysinclude>/opt/boost/include/boost-1_32 ; ~~~Jamfile~~~
That doesn't seem to work:
$ bjam --version Boost.Build V2 (Milestone 10)
Since you did not specify that you are using BBv2, which is not the latest as it's experimental, both Dave and I gave answers using BBv1. Suggestion, look at some of the tutorials in.. http://www.boost.org/tools/build/v2/ Boost Build System V2 -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq
Rene Rivera wrote:
Kelly Burkhart wrote:
On Sat, 2005-03-12 at 20:03, Rene Rivera wrote:
~~~Jamfile~~~ exe tst : tst.cpp : <sysinclude>/opt/boost/include/boost-1_32 ; ~~~Jamfile~~~
That doesn't seem to work:
$ bjam --version Boost.Build V2 (Milestone 10)
Since you did not specify that you are using BBv2, which is not the latest as it's experimental, both Dave and I gave answers using BBv1.
Suggestion, look at some of the tutorials in..
http://www.boost.org/tools/build/v2/ Boost Build System V2
PS. Although the answer Dave gave should work for both BBv1 and BBv2 :-) -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq
Rene Rivera
Rene Rivera wrote:
Kelly Burkhart wrote:
On Sat, 2005-03-12 at 20:03, Rene Rivera wrote:
~~~Jamfile~~~ exe tst : tst.cpp : <sysinclude>/opt/boost/include/boost-1_32 ; ~~~Jamfile~~~
That doesn't seem to work:
$ bjam --version Boost.Build V2 (Milestone 10) Since you did not specify that you are using BBv2, which is not the latest as it's experimental, both Dave and I gave answers using BBv1. Suggestion, look at some of the tutorials in.. http://www.boost.org/tools/build/v2/ Boost Build System V2
PS. Although the answer Dave gave should work for both BBv1 and BBv2 :-)
Part of why I gave it. It's not very clear what the OP's intention is. To use BBv1 outside the Boost tree, remember, he must take special measures. -- Dave Abrahams Boost Consulting www.boost-consulting.com
On Sun, 2005-03-13 at 03:18, David Abrahams wrote:
Rene Rivera
writes: Rene Rivera wrote:
Kelly Burkhart wrote:
On Sat, 2005-03-12 at 20:03, Rene Rivera wrote:
~~~Jamfile~~~ exe tst : tst.cpp : <sysinclude>/opt/boost/include/boost-1_32 ; ~~~Jamfile~~~
That doesn't seem to work:
$ bjam --version Boost.Build V2 (Milestone 10) Since you did not specify that you are using BBv2, which is not the latest as it's experimental, both Dave and I gave answers using BBv1. Suggestion, look at some of the tutorials in.. http://www.boost.org/tools/build/v2/ Boost Build System V2
PS. Although the answer Dave gave should work for both BBv1 and BBv2 :-)
Part of why I gave it. It's not very clear what the OP's intention is. To use BBv1 outside the Boost tree, remember, he must take special measures.
First, David & Rene, I apprecate your attempts to help me. I believe that my assumptions must be different than a typical boost user. Either that or I'm a bit more dense than the typical boost user. I am assuming that a boost user (as opposed to a boost developer) would be working on a machine which has boost installed somewhere outside his home directory. General development would not take place within boost directories. (I don't develop within Qt or libc source directories either). I am also assuming that boost.build is designed not just to build boost, but to be a general make replacement. Given these (possibly bogus) assumptions, there must be some way to configure boost build (v1 or v2) so that you don't have to specify it's location in every Jamfile. So what are the 'special measures' one must take to accomplish this? Is what I'm attempting to do peculiar? RE: BBv1 vs. BBv2, the documentation says that BBv2 is "pretty usable already." I figured if I'm starting from scratch I may as well use latest and greatest. Do you recommend avoiding BBv2 until it's cooked? TIA, -K
Kelly Burkhart
On Sun, 2005-03-13 at 03:18, David Abrahams wrote:
Rene Rivera
writes: Rene Rivera wrote:
Kelly Burkhart wrote:
On Sat, 2005-03-12 at 20:03, Rene Rivera wrote:
~~~Jamfile~~~ exe tst : tst.cpp : <sysinclude>/opt/boost/include/boost-1_32 ; ~~~Jamfile~~~
That doesn't seem to work:
$ bjam --version Boost.Build V2 (Milestone 10) Since you did not specify that you are using BBv2, which is not the latest as it's experimental, both Dave and I gave answers using BBv1. Suggestion, look at some of the tutorials in.. http://www.boost.org/tools/build/v2/ Boost Build System V2
PS. Although the answer Dave gave should work for both BBv1 and BBv2 :-)
Part of why I gave it. It's not very clear what the OP's intention is. To use BBv1 outside the Boost tree, remember, he must take special measures.
First, David & Rene, I apprecate your attempts to help me. I believe that my assumptions must be different than a typical boost user. Either that or I'm a bit more dense than the typical boost user.
I am assuming that a boost user (as opposed to a boost developer) would be working on a machine which has boost installed somewhere outside his home directory. General development would not take place within boost directories. (I don't develop within Qt or libc source directories either).
C'rect.
I am also assuming that boost.build is designed not just to build boost, but to be a general make replacement.
Also c'rect.
Given these (possibly bogus) assumptions, there must be some way to configure boost build (v1 or v2) so that you don't have to specify it's location in every Jamfile.
For v1: boost-build.jam contains: boost-build path/to/root/of/boost/tools/build/v1 ; Jamrules contains: project boost : path/to/root/of/boost ; For v2: Refer to the BBv2 documentation.
So what are the 'special measures' one must take to accomplish this? Is what I'm attempting to do peculiar?
Nope.
RE: BBv1 vs. BBv2, the documentation says that BBv2 is "pretty usable already." I figured if I'm starting from scratch I may as well use latest and greatest.
Probably so.
Do you recommend avoiding BBv2 until it's cooked?
Nope. -- Dave Abrahams Boost Consulting www.boost-consulting.com
Kelly Burkhart
Hello,
I am starting to fiddle with boost and bjam and am not able to get bjam to find the boost headers and libraries.
I'm running SuSE 9.1 and started out using the RPMs. Since last night, one-by-one I've uninstalled the RPMs and replaced with freshly downloaded and build components.
Right now I have the latest boost,bjam and boost.build releases. I built boost with --prefix=/opt/boost and installed it. I have boost.build placed in /opt/boost as well. Under my home directory I have a directory in which I'm trying to build a hello-world program.
The directory contents:
ls boost-build.jam Jamfile project-root.jam tst.cpp cat boost-build.jam boost-build /opt/boost/boost-build ; cat Jamfile exe tst : tst.cpp ; cat tst.cpp #include <iostream> #include <string> #include "boost/format.hpp"
int main() { std::cout << boost::format("%1%, world") % "hello" << std::endl; return 0; }
project-root.jam is empty.
When I try to build with 'bjam tst' it is not able to find the boost headers, which makes sense, because I've not been able to figure out how to indicate where they live.
How is this accomplished?
exe tst : tst.cpp : <include>path/to/boost/headers ; -- Dave Abrahams Boost Consulting www.boost-consulting.com
On Sat, 2005-03-12 at 21:42, David Abrahams wrote:
Kelly Burkhart
writes: <snip> When I try to build with 'bjam tst' it is not able to find the boost headers, which makes sense, because I've not been able to figure out how to indicate where they live.
How is this accomplished?
exe tst : tst.cpp : <include>path/to/boost/headers ;
This works, I think: $ bjam tst ...patience... ...found 371 targets... ...updating 2 targets... gcc.compile.c++ bin/gcc/debug/tst.o gcc.link bin/gcc/debug/tst ...updated 2 targets... Why are there 371 targets? The only target is 'tst' (and perhaps tst.o). Also, adding this in each and every jamfile doesn't seem right. Can I put something in boost.build site-config.jam or user-config.jam to effect all of my projects? How do I specify libs? If I replace the contents of my tst.cpp with regex_split_example_1.cpp how do I indicate that I want to link with the appropriate libboost_regex-*? -K
participants (3)
-
David Abrahams
-
Kelly Burkhart
-
Rene Rivera