Barry Smith writes: > Sean, > > 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 yes $ nc-config --libs -L/opt/local/lib -lnetcdf There is also pkg-config: $ pkg-config --libs libpng -L/opt/local/lib -lpng16 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
