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

Barry Smith bsmith at mcs.anl.gov
Thu Nov 6 10:18:57 CST 2014


  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