From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-08-24 02:35:14
Toon Knapen wrote:
>> 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 ;
> : requirements
> 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'
Sorry, I think I've made a typo. The name of the property should not be
> 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
> expected either.
That's how variable expansion works in jam. You'd need a third variable to
local all-libs = $(BLAS_LIBS) $(LAPACK_LIBS) ;
... <find-shared-library>$(all-libs:J=&&) ..
The 'J' modifier tell jam to insert the specified separate between all
elements of a list.
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