[petsc-dev] DESTDIR

Jed Brown jed at 59a2.org
Fri Apr 23 11:06:09 CDT 2010

On Fri, 23 Apr 2010 10:32:56 -0500 (CDT), Satish Balay <balay at mcs.anl.gov> wrote:
> there are different ways of doing it:
> 1. 'mpicc -show'

I don't like this because it requires parsing to isolate the relevant
bits.  MPICH2's mpicc supports -show, -compile_info, and -link_info
(although all of these return the same thing on my system) and Open MPI
supports -show, -showme:compile, -showme:link.  The main problem with
wrappers is that they don't interoperate and sometimes put their options
in the wrong order (thus interfering options from other packages;
admittedly, there is no complete resolution to this problem).  It also
requires the user to parse the result to remove the compiler from the
resulting string in order to combine foocc, barcc, and quxcc.

> 2. pkgconfig as Jed mentioned

I think that prefix-installs should write a pkgconfig file, I don't
think the pkgconfig people have a recommended practice for multiple
installs, though

  PKG_CONFIG_PATH=${PETSC_DIR}/${PETSC_ARCH}/lib/pkgconfig pkg-config --options petsc

would work (except that pkg-config will fall back to system paths if it
doesn't find something here, thus linking the wrong install rather than
giving an error).  My suggestion of a petsc-config written in Python was
just to have something with the same interface as pkgconfig, but with
more robust handling of multiple installs.  Maybe it's better to just
use pkgconfig (which has lots of buy-in and tool support) and perhaps
try to upstream some support for multiple installs.  Come to think of
it, it might be sufficient to drop $PETSC_ARCH in pkgconfig's "Version"
field (along with the actual version), permitting something like

  pkg-config --options petsc-mpich2-gcc-complex

assuming all the relevant PETSc installs were present in

> 3. makefiles - as currently implemented by PETSc. 'make getincludes'

Writing a temporary makefile, setting up necessary environment
variables, and running the various make -f tmp-makefile getlinklibs is
more effort than would be optimal.


More information about the petsc-dev mailing list