[petsc-users] automatic determination of which libraries petsc wants

Satish Balay balay at mcs.anl.gov
Thu Jan 31 18:34:16 CST 2013


On Thu, 31 Jan 2013, Geoffrey Irving wrote:

> We have an scons build system linking against PETSc, and it would be
> nice to have an automatic way of determining the list of libraries
> that a statically linked, installed version of PETSc wants (e.g., the
> MacPorts installed version).  What's a good way to do such a thing
> from *outside* the PETSc build system?


One way is for some script [like configure or equivalent] to create a
simple petsc makefile and use any of the following targets to get
the required info

>>>>>>>>>>>>
asterix:/home/balay/tmp>cat makefile 
PETSC_DIR=/home/balay/spetsc
PETSC_ARCH=asterix64
include ${PETSC_DIR}/conf/variables
include ${PETSC_DIR}/conf/rules

asterix:/home/balay/tmp>make getincludedirs
-I/home/balay/spetsc/include -I/home/balay/spetsc/asterix64/include -I/home/balay/soft/linux64/mpich2-1.1/include -I/home/balay/soft/mpich2-1.5/include
asterix:/home/balay/tmp>make getlinklibs
-Wl,-rpath,/home/balay/spetsc/asterix64/lib -Wl,-rpath,/home/balay/spetsc/asterix64/lib -L/home/balay/spetsc/asterix64/lib -lpetsc -llapack -lblas -lX11 -lpthread -lm -Wl,-rpath,/home/balay/soft/mpich2-1.5/lib -L/home/balay/soft/mpich2-1.5/lib -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.7.2 -lmpichf90 -lgfortran -lm -lgfortran -lm -lquadmath -lm -ldl -lmpich -lopa -lmpl -lrt -lgcc_s -ldl
asterix:/home/balay/tmp>
>>>>>>>>>

[more similar targets are listed in conf/rules]

The other option is to use pkgconfig file created by configure.
It should be in PETSC_ARCH/lib/pkgconfig [in petsc-dev]

Satish



More information about the petsc-users mailing list