[petsc-users] When building PETSc with --prefix, reference to temporary build directory remains

Balay, Satish balay at mcs.anl.gov
Thu Aug 1 10:10:49 CDT 2019


On Thu, 1 Aug 2019, Smith, Barry F. via petsc-users wrote:

> 
>   Please consider upgrading to the latest PETSc 3.11 it has many new features and fewer bugs etc.
> 
> > 5. From now on set PETSC_DIR=/readonly PETSC_ARCH=''
> > step 4 moves the compiled PETSc to /readonly/ and it works, but when I compile a program with it the following line pops up in the linking command:
> > -Wl,-rpath,/temporary/-Xlinker
> 
> 
>    How are you compiling the program? 
> 
>    If you are using the PETSc make facilities the easiest fix would be to remove this offend -Wl,-rpath,/temporary/-Xlinker which isn't needed. It is likely in /readonly/lib/petsc/conf/petscvariables 
> 
>    I may have gotten the file or location wrong.  You can use find in /readonly to locate any use of -Wl,-rpath,/temporary/-Xlinker and remove them.


Actually its best to replace -Wl,-rpath,/temporary/-Xlinker to -Wl,-rpath,/readonly/-Xlinker or appropriate value.

Likely 'prefix' install code for this version of petsc is buggy. Alternative is to do inplace install (i.e do not use --prefix - but have sources and build) in /readonly

Satish

> 
>    Barry
> 
> 
> 
> 
> > On Aug 1, 2019, at 6:07 AM, Bastian Löhrer via petsc-users <petsc-users at mcs.anl.gov> wrote:
> > 
> > Dear all,
> > 
> > I'm struggling to compile PETSc 3.3-p6 on a cluster where it is to be provided in a read-only folder.
> > 
> > My scenario is the following:
> > PETSc shall end up in a folder into which I can write from a login node but which is read-only on compute nodes: I'll call it /readonly/ below.
> > So, using a compute node, I need to compile PETSc in a different location, which I'll call /temporary/
> > I have read numerous instructions on the web and here are the steps that I came up with:
> > 
> > 1. on a compute node: unpack the PETSc source to /temporary/ and navigate there.
> > 2. configure:
> > ./configure                                                                                                       \
> >                  --prefix=/readonly/                                                                              \
> >      --with-gnu-compilers=0                                                                                       \
> >   --with-vendor-compilers=intel                                                                                   \
> >      --with-large-file-io=1                                                                                       \
> >                  --CFLAGS="-fPIC -L${I_MPI_ROOT}/intel64/lib -I${I_MPI_ROOT}/intel64/include -lmpi"           \
> >                --CXXFLAGS="-fPIC -L${I_MPI_ROOT}/intel64/lib -I${I_MPI_ROOT}/intel64/include -lmpi -lmpicxx"  \
> >                  --FFLAGS="-fPIC -L${I_MPI_ROOT}/intel64/lib -I${I_MPI_ROOT}/intel64/include -lmpi"           \
> >                 --LDFLAGS="-L${I_MPI_ROOT}/intel64/lib -I${I_MPI_ROOT}/intel64/include -lmpi"                 \
> >                 COPTFLAGS="-O3 -axCORE-AVX2 -xSSE4.2 -fp-model consistent -fp-model source -fp-speculation=safe -ftz"  \
> >               CXXOPTFLAGS="-O3 -axCORE-AVX2 -xSSE4.2 -fp-model consistent -fp-model source -fp-speculation=safe -ftz"  \
> >                 FOPTFLAGS="-O3 -axCORE-AVX2 -xSSE4.2 -fp-model consistent -fp-model source -fp-speculation=safe -ftz"  \
> >    --with-blas-lapack-dir="${MKLROOT}/lib/intel64"                                                             \
> >          --download-hypre                                                                                         \
> >          --with-debugging=no
> > 
> > 3. make all
> > 4. on a login node: make install
> > 5. From now on set PETSC_DIR=/readonly PETSC_ARCH=''
> > step 4 moves the compiled PETSc to /readonly/ and it works, but when I compile a program with it the following line pops up in the linking command:
> > -Wl,-rpath,/temporary/-Xlinker
> > 
> > This is a problem when the drive on which /temporary/ is placed is not reachable which is the case right now due to technical issues. This causes the linking process to get stuck.
> > The folder /temporary/ is to be deleted anyway so I do not see why it should be referenced here.
> > 
> > Am I missing something?
> > 
> > - Bastian
> 
> 


More information about the petsc-users mailing list