Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-01-23 06:37:03


Hi Samuel,

> 1. I tried building a lib + app project. the building went well, then I
> didnt know how to run the exe so that it would find the lib.
> I quickly found about the stage dist rule and solved that easily, but is it
> possible to run the program without copying the lib first or setting
> LD_LIBRARY_PATH ?

There's a solution which would work on Linux: adding

<hardcode-dll-paths>true

to requirements, but Windows users will be stuck.

> I there something like "bjam run [target name]" to launch
> the built exe ?  

Nope, only "unit-test", the "run" rule (which is almost like unit-test), and
'hardcode-dll-paths'. I actually though about making wrapper script, which
sets LD_LIBRARY_PATH on Linux and PATH on windows and then invokes the actual
problem. We can generate such script automatically for all binaries -- that's
how libtool works.

The "bjam run" idea is new. I'm not sure that either wrapper or "bjam run" is
necessary, but it's up to users.

> I felt a need for that planning to add execution of tests
> in the Jamfile, then I read Boost.Buildv2 now supports unit test (btw it's
> not yet mentionned in the docu).

Maybe it's very well hidden ;-)

http://boost.sourceforge.net/boost-build2/boost_build_v2.html#builtins_main_targets

> 2. then my first stumble was : how do I use an environment variable ?

Ehmm.. you're probably third who's asking that. Should add it to docs.

> (maybe not the greatest Boost.Build thing to do, but in the context of a
> new user in the process of adapting to Boost.Build, it's a very likely
> first worry)
> I didnt find a clear answer in the docu, and I think there should be.
> Looking at some Jamfiles around, I tried $(myvarname), it worked in some
> case :
> stage dist :  somestuff :  <location>$(somedestination)
> but inside a '<include>' project requirement it was completely ignored.
> Is it normal ?

No. Maybe you've used <location> in some other module...

> Then I tried adding at the head of my Jamfile :
> import modules ;
> local MYVARNAME = [ modules.peek : myvarname ] ;
>
> and I got
> Jamfile:7: in modules.load
> rule import modules ; unknown in module Jamfile</home/sam/progs/simg>.

I'm at lost. When I add:

import modules ;
home = [ modules.peek : HOME ] ;
ECHO "My home is " $(home) ;

it works. Maybe, you've got some syntax error before? Could you send me a test
case?

- Volodya

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk