<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
  #pfptBanner5qq5rj1 { all: revert !important; display: block !important; 
    visibility: visible !important; opacity: 1 !important; 
    background-color: #D0D8DC !important; 
    max-width: none !important; max-height: none !important }
  .pfptPrimaryButton5qq5rj1:hover, .pfptPrimaryButton5qq5rj1:focus {
    background-color: #b4c1c7 !important; }
  .pfptPrimaryButton5qq5rj1:active {
    background-color: #90a4ae !important; }
</style>

<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">
 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
</div>
<!-- Preheader Text : END -->

<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>

<!--[if ((ie)|(mso))]>
  <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 16px 0px 16px 0px; direction: ltr" ><tr><td>
    <table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 10px 5px 6px; width: 100%; border-radius:4px; border-top:4px solid #90a4ae;background-color:#D0D8DC;"><tr><td valign="top">
      <table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 4px 8px 4px 8px">
        <tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; direction: ltr">
          This Message Is From an External Sender
        </td></tr>
        <tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
          This message came from outside your organization.
        </td></tr>

      </table>

    </td></tr></table>
  </td></tr></table>
<![endif]-->

<![if !((ie)|(mso))]>
  <div dir="ltr"  id="pfptBanner5qq5rj1" style="all: revert !important; display:block !important; text-align: left !important; margin:16px 0px 16px 0px !important; padding:8px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #D0D8DC !important; background-color: #D0D8DC; border-top: 4px solid #90a4ae !important; border-top: 4px solid #90a4ae;">
    <div id="pfptBanner5qq5rj1" style="all: unset !important; float:left !important; display:block !important; margin: 0px 0px 1px 0px !important; max-width: 600px !important;">
      <div id="pfptBanner5qq5rj1" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:18px !important; line-height:18px">
        This Message Is From an External Sender
      </div>
      <div id="pfptBanner5qq5rj1" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:18px !important; line-height:18px; margin-top:2px !important;">
This message came from outside your organization.
      </div>

    </div>

    <div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
  </div>
<![endif]>

<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->

<!-- BaNnErBlUrFlE-BoDy-end -->
<div dir="ltr"><div>Yes, it is indeed cleaner. Thanks for your explanation! </div><div><br></div><div>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?</div><div><br></div><div># From PFLOTRAN makefile<br>pflotran : $(pflotran_obj)<br>${FLINKER} -o pflotran $(pflotran_obj) ${PETSC_LIB} ${LIBS} <br></div><div><br></div><div>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<br><br></div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 14, 2024 at 1:23 PM Satish Balay <<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">And to have cleaner list - specify the (appropriate) compiler libraries via LIBS option<br>
<br>
balay@pj01:~/petsc$ mpif90 -show<br>
gfortran -I/software/mpich-4.1.1/include -I/software/mpich-4.1.1/include -L/software/mpich-4.1.1/lib -lmpifort -Wl,-rpath -Wl,/software/mpich-4.1.1/lib -Wl,--enable-new-dtags -lmpi<br>
<br>
balay@pj01:~/petsc$ ./configure --download-fblaslapack --download-hdf5 --with-hdf5-fortran-bindings --download-metis --download-parmetis COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3 --with-debugging=0 LIBS="-lmpifort -lmpi -lgfortran -lstdc++"<br>
<br>
balay@pj01:~/petsc$ grep ^PETSC_EXTERNAL_LIB_BASIC arch-linux-c-opt/lib/petsc/conf/petscvariables <br>
PETSC_EXTERNAL_LIB_BASIC = -Wl,-rpath,/home/balay/petsc/arch-linux-c-opt/lib -L/home/balay/petsc/arch-linux-c-opt/lib -lflapack -lfblas -lparmetis -lmetis -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -lm -lX11 -lquadmath -lmpifort -lmpi -lgfortran -lstdc++<br>
<br>
<br>
Satish<br>
<br>
<br>
On Tue, 14 May 2024, Satish Balay via petsc-users wrote:<br>
<br>
> You can try using latest petsc version [3.21] - the list should be a bit more cleaner with it.<br>
> <br>
> balay@pj01:~/petsc$ ./configure --download-mpich --download-fblaslapack --download-hdf5 --with-hdf5-fortran-bindings --download-metis --download-parmetis COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3 --with-debugging=0<br>
> <br>
> balay@pj01:~/petsc$ grep ^PETSC_EXTERNAL_LIB_BASIC arch-linux-c-opt/lib/petsc/conf/petscvariables <br>
> PETSC_EXTERNAL_LIB_BASIC = -Wl,-rpath,/home/balay/petsc/arch-linux-c-opt/lib -L/home/balay/petsc/arch-linux-c-opt/lib -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/13 -L/usr/lib/gcc/x86_64-redhat-linux/13 -lflapack -lfblas -lparmetis -lmetis -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -lm -lX11 -lmpifort -lmpi -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -lstdc++<br>
> <br>
> Satish<br>
> <br>
> On Tue, 14 May 2024, Runjian Wu wrote:<br>
> <br>
> > First clarification, NO issues happened. I am just curious about the<br>
> > duplicated libraries while I compile PFLOTRAN with PETSc.<br>
> > <br>
> > PETSc version: 3.16.2<br>
> > <br>
> > Configure Options: --configModules=PETSc.Configure<br>
> > --optionsModule=config.compilerOptions --with-make-np=4 --with-cc=mpicc<br>
> > --with-cxx=mpicxx --with-fc=mpif90 --download-fblaslapack=yes<br>
> > --download-hdf5=/home/wurunjian/petsc_pkg/hdf5-1.12.1.tar.bz2<br>
> > --download-hdf5-fortran-bindings=yes --download-metis=yes<br>
> > --download-parmetis=yes --CFLAGS=-O3 --CXXFLAGS=-O3 --FFLAGS=-O3<br>
> > --with-debugging=0<br>
> > <br>
> > PETSC_EXTERNAL_LIB_BASIC =<br>
> > -Wl,-rpath,/home/wurunjian/petsc/arch-linux2-c-opt/lib<br>
> > -L/home/wurunjian/petsc/arch-linux2-c-opt/lib<br>
> > -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/11<br>
> > -L/usr/lib/gcc/x86_64-linux-gnu/11 -lflapack -lfblas -lhdf5hl_fortran<br>
> > -lhdf5_fortran -lhdf5_hl -lhdf5 -lparmetis -lmetis -lm -lstdc++ -ldl<br>
> > -lmpichfort -lmpich -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath<br>
> > -lstdc++ -ldl<br>
> > <br>
> > On Mon, May 13, 2024 at 9:34 PM Satish Balay <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>> wrote:<br>
> > <br>
> > > what version of PETSc? What configure command? What do you have for<br>
> > > PETSC_EXTERNAL_LIB_BASIC?<br>
> > ><br>
> > > You can send configure.log for your build to petsc-maint<br>
> > ><br>
> > > Generally duplicates should not cause grief. [as one needs them to<br>
> > > overcome circular dependencies].<br>
> > ><br>
> > > What issues are you seeing? [send relevant logs]<br>
> > ><br>
> > > If the duplicates are coming form "compiler library" detection part of<br>
> > > configure - you can skip this part by listing the correct "compiler<br>
> > > libraries"<br>
> > ><br>
> > > for ex: with gcc/gfortran:<br>
> > ><br>
> > > LIBS="-lgfortran -lstdc++"<br>
> > ><br>
> > > However -lgfortran could be required for gcc - but a duplicate for<br>
> > > gfortran.<br>
> > ><br>
> > > Satish<br>
> > ><br>
> > > On Mon, 13 May 2024, Runjian Wu wrote:<br>
> > ><br>
> > > > Hi all,<br>
> > > ><br>
> > > > After I compiled PETSc, I found some duplicated libs in the variable<br>
> > > > PETSC_EXTERNAL_LIB_BASIC, e.g., -lm, -lgfortran -lstdc++.  I am curious<br>
> > > how<br>
> > > > it happened and how to remove the duplicates?<br>
> > > ><br>
> > > > Thanks,<br>
> > > ><br>
> > > > Runjian Wu<br>
> > > ><br>
> > ><br>
> > ><br>
> > <br>
> </blockquote></div></div>