[petsc-dev] Problem with petsc.pc when configured with --with-single-library=0

Satish Balay balay at mcs.anl.gov
Wed Mar 1 08:08:59 CST 2017


Hm --with-single-library=0 is primarily a debugging tool for petsc
developers [to avoid circular dependencies within library components].

So its not really useful for regular usage.

Attaching a patch-fix for this issue - does this work?

patch -Np1 < petsc-pkg-conf-mlib.diff

Satish

On Wed, 1 Mar 2017, Garth N. Wells wrote:

> When configuring PETSc with "--with-single-library=0", my installed petsc.pc
> file looks like:
> 
> prefix=/home/garth/local/packages/petsc-test
> exec_prefix=${prefix}
> includedir=${prefix}/include
> libdir=/home/garth/local/packages/petsc-test/lib
> ccompiler=mpicc
> fcompiler=mpif90
> blaslapacklibs=-llapack -lblas
> 
> Name: PETSc
> Description: Library to solve ODEs and algebraic equations
> Version: 3.7.5
> Cflags: -I/home/garth/local/packages/petsc-test/include
> -I/home/garth/local/packages/petsc-test/include
> Libs: -L/home/garth/local/packages/petsc-test/lib  -lpetsc
> Libs.private: -llapack -lblas -lX11 -lpthread -lm
> -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu
> -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/6 -L/usr/lib/gcc/x86_64-linux-gnu/6
> -Wl,-rpath,/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -lmpichfort
> -lgfortran -lm -lgfortran -lm -lquadmath -lm -lmpichcxx -lstdc++
> -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu
> -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/6 -L/usr/lib/gcc/x86_64-linux-gnu/6
> -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu
> -Wl,-rpath,/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu
> -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -ldl -lmpich
> -lgcc_s -ldl
> 
> 
> Note the "Libs:". It points only to petsc (which doesn't exist), whereas I
> would expect it to list each PETSc lib, i.e., petscdm, petscksp, etc, or
> provide a pkg-config file for each PETSc lib.
> 
> Garth
> 
> 
> 
-------------- next part --------------
diff --git a/config/PETSc/Configure.py b/config/PETSc/Configure.py
index a99e880..2ed991b 100644
--- a/config/PETSc/Configure.py
+++ b/config/PETSc/Configure.py
@@ -182,7 +182,10 @@ class Configure(config.base.Configure):
 
     fd.write('Cflags: '+self.allincludes+'\n')
 
-    plibs = self.libraries.toStringNoDupes(['-L'+os.path.join(self.petscdir.dir,self.arch.arch,'lib'),' -lpetsc'])
+    if self.framework.argDB['with-single-library']:
+      plibs = self.libraries.toStringNoDupes(['-L'+os.path.join(self.petscdir.dir,self.arch.arch,'lib'),'-lpetsc'])
+    else:
+      plibs = self.libraries.toStringNoDupes(['-L'+os.path.join(self.petscdir.dir,self.arch.arch,'lib'),'-lpetscts -lpetscsnes -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetscsys'])
     if self.framework.argDB['prefix']:
       fd.write('Libs: '+plibs.replace(os.path.join(self.petscdir.dir,self.arch.arch),self.installdir.dir)+'\n')
     else:


More information about the petsc-dev mailing list