[petsc-dev] petsc/master: unable to link in C++ with last night PETSC_WITH_EXTERNAL_LIB variable changes

Éric Chamberland Eric.Chamberland at giref.ulaval.ca
Sat Feb 10 12:09:27 CST 2018



Le 18-02-10 à 12:38, Jed Brown a écrit :
> Éric Chamberland <Eric.Chamberland at giref.ulaval.ca> writes:
>
>>
>> and into this block there was the "-lmpi_cxx" that we need...
> The point is that if you are linking C++ code that calls the MPI C++
> interface, then *you* should link with mpicxx or equivalent.
The funny thing, is that we are hopefully *not* using the C++ API of 
MPI.  We do use the C API since MPI 1.0.
Then, I am asking myself why this link error shows up now...since 
nothing calls it... hmmm, let me dig into this...
> You should not depend on PETSc to provide anything but PETSc to your
> application (so if you call other libraries that your configuration of
> PETSc uses, you should take responsibility to link them explicitly; this
Wait: you mean for example if I configure MUMPS (or not) with PETSc, I 
have to build my link line with all MUMPS dependencies or not myself?
I wanted to be "lazy" and to use the same line *you* are using for 
passing libs (and in the good *order* which is not easy to manage)... as 
I can rely on this line to link "pure" petsc examples... ;)
> is important when using shared libraries).  But you should definitely
> not depend on PETSc to provide your application with stuff that has been
> REMOVED from MPI (more than five years ago) and that PETSc does not use.
I agree, this C++ MPI API is not a very good excuse to add boring work 
into any software configuration and maintenance.

Thanks,

Eric



More information about the petsc-dev mailing list