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

Jed Brown jed at jedbrown.org
Sat Feb 10 20:53:49 CST 2018

Éric Chamberland <Eric.Chamberland at giref.ulaval.ca> writes:

> Le 18-02-10 à 16:49, Jed Brown a écrit :
>> Éric Chamberland <Eric.Chamberland at giref.ulaval.ca> writes:
>>> oh my, looks like "-lpetsc -lmpi" works for us!!!
>>> (sounds of head banging on desk)
>> This should work any time libpetsc is a shared library.  You'll need the
>> whole grotesque link line if you need to link statically.
> Doh!  ok, thanks for the specification because we need also a static 
> link for the code coverage to work...

You can use pkg-config --static.

> and for my peaceful sleep:
> Since when it is possible to link with PETSC with just "-lpetsc -lmpi"?

Probably as long as --with-shared-libraries has existed.

More information about the petsc-dev mailing list