Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-11-02 19:11:21


Nice, Toon!

FYI, you can also do this, to keep things a bit shorter:

---
local libs =     driver/src/libdriver
    analysis/src/libanalysis
    solver/src/libsolver
    system/src/libsystem
    component/src/libcomponent
    material/src/libmaterial
    field/src/libfield
    domain/src/libdomain
    element/src/libelement
    interp/src/libinterp
    integr/src/libintegr
    topology/src/libtopology
    geometry/src/libgeometry
    math/src/libmath
    utilities/src/libutilities
    main/src/libmain
    ;
exe femtown  # SUFEXE will be added implicitly
      :
 $(CPPSOURCES).cpp
 <lib>../src/lib$(MODULE)$(SUFLIB) <lib>$(libs)$(SUFLIB) ;
---
BTW, it shouldn't be neccessary to specify SUFEXE or SUFLIB here explicitly
at all.
-Dave
----- Original Message -----
From: "Toon Knapen" <toon.knapen_at_[hidden]>
> To link `portably` with external libraries I have added a section to the
> Jamrules of my project where the user can specify the paths and names to
> all external libraries  (remark that all variables I use or in my
> project's namespace (called FEMTown) to avoid clashes ):
>
> # begin project specific Jamrules
>
> #path to Boost
> FEMTOWN_BOOST_INC_PATH = /usr/local/boost ;
> FEMTOWN_BOOST_LIB_PATH = ;
> FEMTOWN_BOOST_LIBS = ;
>
> # path to BLAS
> FEMTOWN_BLAS_INC_PATH = ;
> FEMTOWN_BLAS_LIB_PATH = /usr/lib ;
> FEMTOWN_BLAS_LIBS = f77blas atlas g2c ;
>
> # path to SuperLU
> FEMTOWN_SUPERLU_INC_PATH = /usr/local ;
> FEMTOWN_SUPERLU_LIB_PATH = /usr/local/SuperLU ;
> FEMTOWN_SUPERLU_LIBS = superlu_$(SF_PLATFORM) blas_$(SF_PLATFORM) ;
>
> FEMTOWN_BOXPRO_INC_PATH = $(BOXPRO_TOP)/.. ;
> FEMTOWN_BOXPRO_LIB_PATH = $(BOXPRO_TOP)/lib ;
> FEMTOWN_BOXPRO_LIBS = actran inputoutput box basic ;
>
> # all together
> FEMTOWN_INC_PATHS = $(FEMTOWN_BOOST_INC_PATH) $(FEMTOWN_BLAS_INC_PATH)
> $(FEMTOWN_SUPERLU_INC_PATH) $(FEMTOWN_BOXPRO_INC_PATH) ;
> FEMTOWN_LIB_PATHS = $(FEMTOWN_BOOST_LIB_PATH) $(FEMTOWN_BLAS_LIB_PATH)
> $(FEMTOWN_SUPERLU_LIB_PATH) $(FEMTOWN_BOXPRO_LIB_PATH) ;
> FEMTOWN_LIBS = $(FEMTOWN_BOOST_LIBS) $(FEMTOWN_BLAS_LIBS)
> $(FEMTOWN_SUPERLU_LIBS) $(FEMTOWN_BOXPRO_LIBS) ;
>
> #end project specific Jamrules
>
> When linking an executable I just write something like
>
>
> #begin excerpt from Jamfile
> exe femtown$(SUFEXE)
>      :
> $(CPPSOURCES).cpp
> <lib>../src/lib$(MODULE)$(SUFLIB)
> <lib>../../driver/src/libdriver$(SUFLIB)
> <lib>../../analysis/src/libanalysis$(SUFLIB)
> <lib>../../solver/src/libsolver$(SUFLIB)
> <lib>../../system/src/libsystem$(SUFLIB)
> <lib>../../component/src/libcomponent$(SUFLIB)
> <lib>../../material/src/libmaterial$(SUFLIB)
> <lib>../../field/src/libfield$(SUFLIB)
> <lib>../../domain/src/libdomain$(SUFLIB)
> <lib>../../element/src/libelement$(SUFLIB)
> <lib>../../interp/src/libinterp$(SUFLIB)
> <lib>../../integr/src/libintegr$(SUFLIB)
> <lib>../../topology/src/libtopology$(SUFLIB)
> <lib>../../geometry/src/libgeometry$(SUFLIB)
> <lib>../../math/src/libmath$(SUFLIB)
> <lib>../../utilities/src/libutilities$(SUFLIB)
> <lib>../../main/src/libmain$(SUFLIB)
>      :
>          <include>$(PROJECT_ROOT)/modules
>          <include>$(FEMTOWN_INC_PATHS)
> <library-path>$(FEMTOWN_LIB_PATHS)
> <find-library>$(FEMTOWN_LIBS)
>      ;
> #end excerp from Jamfile
>
> This works great and seems to be easy on the users (they just have to
> customise the Jamrules and it works out of the box). I mainly work on
> Linux/gcc but have done something similar for another project (with Jam
> before Boost.Build was this mature) and that works on 5 Unix platforms
> and Windows.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk