|
Boost-Build : |
From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2004-09-14 03:23:48
Philipp Frauenfelder wrote:
>
> I am exactly in the same situation as you. I am using the
> following code in my site-config.jam:
>
> # Direct solver Umfpack
> feature.feature have-umfpack : yes no ;
> UMFPACK_PATH = /scratch/pfrauenf/umfpack-4.1 ;
> UMFPACK_LIB = umfpack_ia32 ;
> if ! [ GLOB $(UMFPACK_PATH)/lib : lib$(UMFPACK_LIB)* ] {
> Echo * Direct solver Umfpack not installed. ;
> feature.set-default <have-umfpack> : no ;
> alias umfpack ;
> alias umfpackuse ;
> } else {
> Echo * Activating support for direct solver Umfpack. ;
> feature.set-default <have-umfpack> : yes ;
> lib umfpackuse : : :
> : <include>$(UMFPACK_PATH)/UMFPACK/Include <define>HAS_UMFPACK
> <define>UMFPACK_41 ;
> lib amd : : <name>$(UMFPACK_LIB) <search>$(UMFPACK_PATH)/lib ;
> lib umfpack : : <name>amd_ia32 <search>$(UMFPACK_PATH)/lib :
> : <library>amd ;
> }
>
> This detects if the library is present and sets some flags. I
> need these since it activates some parts of the software if a
> specific library is present (not uncommon, huh?).
Nice solution. However in this case you know that you have 2 libraries:
umfpack and amd. Now in the case of BLAS you can have 1,2 or 3
libraries. 1 library generally which is a libblas.a. Atlas however
consists of 2 libraries. And it gets more difficult with Flame for
instance which contains only a partial blas implementation. So you still
need to combine Flame with another blas library (atlas or vendor blas).
So it is impossible to foresee all combinations in the build system. So
the only way out AFAICT is to let the user specify (in user-config.jam
for instance) the list of libraries that together implement the whole
BLAS specification. For instance could specify the combination of flame
and atlas as such:
<user-config.jam>
BLAS_LIBS = flame f77blas atlas ;
</user-config.jam>
and it is important that the linker will see the libraries in this order!
This problem is not only related to BLAS, Atlas for instance also
defines part of LAPACK so if you use the LAPACK of ATLAS, you also need
to link with another LAPACK.
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