[petsc-users] petsc rpath

Satish Balay balay at mcs.anl.gov
Wed Nov 24 09:58:35 CST 2010


B1;2601;0cOn Wed, 24 Nov 2010, Jed Brown wrote:

> On Wed, Nov 24, 2010 at 16:26, Jens-Malte Gottfried <jmgottfried at web.de>wrote:
> 
> > I am trying to write a gentoo ebuild for petsc (my current work is
> > already in the science overlay).
> > Is there any possibility to disable writing the RPATH of the
> > to-be-generated libpetsc.so?
> > Currently, the library is built fine but RPATH is set to
> >
> >
> > /usr/lib64:/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4:/usr/x86_64-pc-linux-gnu/lib
> > which is not neccessary. Before trying to patch the build system,
> > perhaps there is a simple configure option which I did not find.
> >
> 
> The standard build system does not provide an easy way to do this.  If you
> are using petsc-dev, you use CMake (configure as usual, but then run make
> from $PETSC_DIR/$PETSC_ARCH instead of from $PETSC_DIR).  The CMake build
> files default to setting RPATH, but it is easy to set the cache variables to
> disable RPATH.

Some of the above comes from 'gfortran -v' - which checkFortranLibraries() etc do..

For such known systems with known compatibility libraries [ and each
language compiler can find each others libs] you can use:

[for c++ build]
-with-clib-autodetect=0 -with-fortranlib-autodetect=0 LIBS=-lgfortran

[for c++ build]
-with-clib-autodetect=0 -with-cxxlib-autodetect=0 -with-fortranlib-autodetect=0 LIBS='-lstdc++ -lgfortran'

Wrt -rpath for -lpetsc, perhaps commenting out the following line in
config/BuildSystem/config/setCompilers.py is sufficient:

    self.executeTest(self.checkSharedLinkerPaths)


Satish


More information about the petsc-users mailing list