From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2004-08-24 02:18:09
Vladimir Prus wrote:
> Yes, though you'd need to do "cvs up" first ;-) I've just comitted revision
> 1.25 of build/toolset.jam which allows to write:
> : requirements <include>/home/tk/cvstop/myproject&&<include>foobar
> This syntax specifies to include paths, and they will be passed to the
> linker in the specified order. Points to note:
> 1. This is experimental feature. I've made up the syntax some time ago,
> but I'm not promising it's 100% optimal.
> 2. Use it only for cases where the order *really* matters.
> Some more information. The properties are sorted for performance reasons. We
> do quite a lot of work with property sets and try to cache results. For
> caching to really help, differences in order should be erased:
> "<variant>release <debug-symbols>on" and "<debug-symbols>on
> <variant>release" are exactly the same.
I understand your argument and I agree. I think I will try to avoid to
rely on the order of the includes.
> But some features, in some cases, should be in fixed order. The <include> is
> one example. The <find-shared-library> (which translates to -l options on
> Unix) is another. Preventing sorting for <include> had bad performance
> impact. So I've decided to invent new syntax to indicate where order should
> be preserved. This syntax is already used internally for
> <find-shared-library>, and my last commit only made it work for <include>
> also (actually for all 'path' features).
> Please let me know if it works for you.
You have answered two questions at once! Thanks. In another mail I had
asked about how I can specify system libraries in the project rule and
since you mentioned <find-shared-library> I tried it and it works (using
the < >&&< > syntax). I have not tried the <include> yet but let me
just tell about two observations using the <find-shared-library> with
the && syntax:
I have in my top-jamfile now
BLAS_LIBS = [ modules.peek : BLAS_LIBS ] ;
LAPACK_LIBS = [ modules.peek : LAPACK_LIBS ] ;
lib $(BLAS_LIBS) : : <search>/usr/local/lib ;
lib $(LAPACK_LIBS) : : <search>/usr/local/lib ;
and in my user-config.jam I have
modules.poke : BLAS_LIBS : f77blas cblas atlas ;
modules.poke : LAPACK_LIBS : lapack ;
First of all, you mentioned following syntax in your mail:
<include>foo&&<include>bar. However the '<find-shared-library>' should
not be repeated after the '&&'. If it is repeated, the link-line will
look like: '-lf77blas -l<find-shared-library>lapack'
Second, my BLAS_LIBS above are actually 3 libraries. Now bjam expands
this list on the link-line like : '-llapack -lf77blas -llapack -lcblas
-llapack -latlas'. This is not really a problem (although the link line
is much longer and thus linktime increates) but it is not really
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