Eric Chamberland <> writes:

> Hi again Jed,
> sorry to bother you again: if you prefer I can go back on the petsc-dev 
> list, as you wish.

Better to stay on list.

> Here is my new question:
> Is this a small inconsistency?  Or is it related to the way I configured 
> petsc? (see 
> pkg-config --cflags-only-I PETSc
> -I/opt/petsc-master_debug/include 
> -I/opt/intel/composer_xe_2015.2.164/mkl/include 
> -I/opt/openmpi-1.10.2/include
> pkg-config --libs PETSc
> -L/opt/petsc-master_debug/lib -lpetsc
> why does mpi stuff appears in the first one and not the second?
> I would prefer to have "-lmpi" in the second one too... When is it 
> decided to "hide" external packages "under" PETSc? At configuration time?

I don't know what pkg-config recommends in this situation, but consider
that petscsys.h includes mpi.h so a corresponding -I flag needs to be on
the command line any time you compile code that calls PETSc.  If your
application never calls MPI directly, it would be safe to link without

Also note that PETSc provides symbols (like PETSC_COMM_WORLD) which also
have the effect that merely calling PETSc does not require directly
referencing MPI symbols (MPI_COMM_WORLD is a symbol, not a macro, in
Open MPI).

And that PETSc built with MPICH can be linked unmodified with other
conforming MPI implementations.

Reply via email to