petsc: fix pkgconfig error - with incorrect library link order that can break mfem examples with static build

This commit is contained in:
Satish Balay 2017-11-07 22:33:06 -06:00
parent 00d48e60bf
commit d1afa8c20d
2 changed files with 25 additions and 0 deletions

View File

@ -93,6 +93,8 @@ class Petsc(Package):
patch('macos-clang-8.1.0.diff',
when='@3.7.5%clang@8.1.0:')
patch('petsc-pkgconfig.patch', when='@3.8.0:3.8.1')
# Virtual dependencies
# Git repository needs sowing to build Fortran interface
depends_on('sowing', when='@develop')

View File

@ -0,0 +1,23 @@
commit f5eb75d68c6efa16dcc4687305bbb6c2eafc4802
Author: Satish Balay <balay@mcs.anl.gov>
Date: Tue Nov 7 22:26:10 2017 -0600
pkg-config: fix mismatch between Libs.private in PETSc.pc and PETSC_EXTERNAL_LIB_BASIC in petscvariables
for xsdk builds.
' -lfoobar' was processed incorrectly by toStringNoDupes() as the space at the begining
results in a failure for startswith('-l') check
diff --git a/config/BuildSystem/config/libraries.py b/config/BuildSystem/config/libraries.py
index 5f9ae8e5f5..0d86f31121 100644
--- a/config/BuildSystem/config/libraries.py
+++ b/config/BuildSystem/config/libraries.py
@@ -55,7 +55,7 @@ class Configure(config.base.Configure):
return [getattr(self.setCompilers, flagName)+dirname,'-L'+dirname,'-l'+name]
if flagSubst in self.argDB:
return [self.argDB[flagSubst]+dirname,'-L'+dirname,'-l'+name]
- return ['-L'+dirname,' -l'+name]
+ return ['-L'+dirname,'-l'+name]
else:
return ['-l'+name]
if os.path.splitext(library)[1] == '.so':