[petsc-dev] Sean is going to love this
sean.michael.farley at gmail.com
Tue Dec 23 18:11:10 CST 2014
Barry Smith writes:
> Say I am writing a PETSc package (for any generic packaging system) that will use the MPICH compilers package and the BLAS/LAPACK package (and say, the hdf5 package). How do I indicate to PETSc's configure the information for MPICH, BLAS/LAPACK, and hdf5 so they will be correct for users when they link and run their applications? That is, I don't want to randomly list some hdf5 on the system but is it enough to just list the exact location of the hdf5 I know the package manager will install hdf5 to?
That is a hard problem. Jed and others will chime in on this problem,
but this is why some packages have a binary / script that outputs its
compiler / linker flags. For example, netcdf has nc-config:
$ nc-config --has-hdf5
$ nc-config --libs
There is also pkg-config:
$ pkg-config --libs libpng
Ideally, package managers should provide this information. Currently,
they do not. For PETSc, this would mean something akin to 'petscmpiexec'
and / or supplying this information to pkg-config (this actually should
be fairly easy).
An end-user would then use pkg-config or a PETSc-provided script for
compiling and linking,
$ pkg-config --libs petsc
-L/opt/local/lib -lnetcdf -lpetsc -L/opt/local/lib/mpich-mp -lmpi -lpmpi
More information about the petsc-dev