[petsc-dev] Why do we pass -L/usr/lib ?

Satish Balay balay at mcs.anl.gov
Thu Nov 6 10:44:02 CST 2014


I don't think we (configure) can easily deal with multiple copies of libraries.

/usr/lib doesn't matter. It could be /foo/bar and /abc/xyz/. Its
possible for configure to test for package 'a' in the first location -
and test for package 'b' in the second location - but when the link
line is assembled - one of the packages from the wrong location can be
picked up.

And wrt --with-package-dir=/usr - if thats what the user wants to do
[and not rely on compiler default search paths using --with-package=1
option] - we should respect that.. [and present errors if they occur].

Satish

On Thu, 6 Nov 2014, Barry Smith wrote:

> 
>   Presumably we "know" that /usr/lib is not needed and thus could skip adding it to list (where ever it is added to the list? probably in multiple places?)
> 
>   But what about /usr/opt/mpich?  How would we know it is not needed? Do we do some test with and without it and if it works without it then don't add it? But then how do we know we are getting the correct one, if the library is found without the -Lpath?
> 
>   Barry
> 
> > On Nov 6, 2014, at 9:07 AM, Jed Brown <jed at jedbrown.org> wrote:
> > 
> > I configure with
> > 
> > python2 ./configure --with-suitesparse-dir=/usr --with-metis-dir=/usr --with-parmetis-dir=/opt/mpich --with-mpi-dir=/opt/mpich PETSC_ARCH=mpich-test
> > 
> > I get the wrong libparmetis.so.
> > 
> > /opt/mpich/bin/mpif90 -fPIC -Wall -Wno-unused-variable -ffree-line-length-0 -Wno-unused-dummy-argument -g -O0   -o ex5f ex5f.o -Wl,-rpath,/home/jed/petsc/mpich-test/lib -L/home/jed/petsc/mpich-test/lib  -lpetsc -Wl,-rpath,/usr/lib -L/usr/lib -lumfpack -lklu -lcholmod -lbtf -lccolamd -lcolamd -lcamd -lamd -lsuitesparseconfig -llapack -lblas -Wl,-rpath,/opt/mpich/lib -L/opt/mpich/lib -lparmetis -lmetis -lX11 -lhwloc -lpthread -lssl -lcrypto -lm -Wl,-rpath,/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1 -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1 -lmpifort -lgfortran -lm -lgfortran -lm -lquadmath -lm -lmpicxx -lstdc++ -Wl,-rpath,/opt/mpich/lib -L/opt/mpich/lib -Wl,-rpath,/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1 -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1 -ldl -Wl,-rpath,/opt/mpich/lib -lmpi -lgcc_s -ldl 
> > /usr/bin/ld: warning: libmpi.so.1, needed by /usr/lib/libparmetis.so, may conflict with libmpi.so.12
> > /usr/bin/ld: warning: libmpi.so.1, needed by /usr/lib/libparmetis.so, may conflict with libmpi.so.12
> > 
> > 
> > If I don't pass --with-suitesparse-dir=/usr, then -L/opt/mpich/lib (not
> > actually needed) is passed before -L/usr/lib (also not needed) and I get
> > the correct one.  Why don't we *not* pass these paths that are not
> > needed?
> 
> 




More information about the petsc-dev mailing list