[petsc-users] duplicated libs

Satish Balay balay at mcs.anl.gov
Tue May 14 08:56:36 CDT 2024


On Tue, 14 May 2024, Runjian Wu wrote:
61;7601;1c
> Yes, it is indeed cleaner. Thanks for your explanation!
> 
> Now I have a question. If I stick to the old PETSc version (v3.16.2), I can
> manually remove the duplicated libraries in PETSC_LIB and keep the order of
> libraries at the same time, there should be no compiling errors, correct?

Well - that's for you to verify - that it works for your setup. Some compilers have quirks.

And its not clear to me if this trade-off is worth it. [esp - since
the duplicates don't cause grief - and manually editing stuff - for
each install/machine can be error prone, and makes pflotran makefile un-portable.]

I think using LIBS [with the correct list] might be slightly better
than manually modifying pflotran makefile.  But you can use whatever
mode you are comfortable with [that works for you]

Satish

> 
> # From PFLOTRAN makefile
> pflotran : $(pflotran_obj)
> ${FLINKER} -o pflotran $(pflotran_obj) ${PETSC_LIB} ${LIBS}
> 
> PETSC_LIB = -Wl,-rpath,/home/wurunjian/petsc/arch-linux2-c-opt/lib
> -L/home/wurunjian/petsc/arch-linux2-c-opt/lib
> -Wl,-rpath,/home/wurunjian/petsc/arch-linux2-c-opt/lib
> -L/home/wurunjian/petsc/arch-linux2-c-opt/lib
> -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/11
> -L/usr/lib/gcc/x86_64-linux-gnu/11 -lpetsc -lflapack -lfblas
> -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -lparmetis -lmetis -lm
> -lstdc++ -ldl -lmpichfort -lmpich -lgfortran -lm -lgfortran -lm -lgcc_s
> -lquadmath -lstdc++ -ldl
> 


More information about the petsc-users mailing list