-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CMake option Pism_PKG_CONFIG_STATIC (default: on) (see #529)
Normally it is enough to set "-L${petsc_prefix}/lib -lpetsc" to be able to link to PETSc: libpetsc.so should have names and locations of its dependencies recorded in its metadata. This mechanism allowing a linker to automatically discover indirect library dependencies appears to be broken on some systems, requiring explicitly listing both direct and indirect dependencies. To try to avoid this issue PISM's CMake scripts run pkg-config with the flag "--static" to get more complete lists of linker flags (usually used for static linking since static libraries are just collections of object files and don't contain metadata). This may lead to "overlinking", i.e. listing some libraries as *direct* dependencies of libpism.so even though PISM itself does not use them. They would have to be loaded (either as direct dependencies or not) anyway, so this appears to be the only side effect. I think we can live with that. Set this option to "off" to use pkg-config without the "--static" flag. Note that we had to require CMake >= 3.16 for this to work properly (see Kitware/CMake@28cb86d).
- Loading branch information
Showing
5 changed files
with
19 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters