# Installation with local PETSc

**URL:** <https://community.freefem.org/t/installation-with-local-petsc/2038>\
**Category:** FreeFEM installation\
**Created:** [October 4, 2022, 8:13am UTC](https://community.freefem.org/t/installation-with-local-petsc/2038 "2022-10-04T08:13:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![erothe](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@erothe](https://community.freefem.org/u/erothe)\
**Post date:** [October 4, 2022, 8:13am UTC](https://community.freefem.org/t/installation-with-local-petsc/2038/1 "2022-10-04T08:13:08Z")

</div>

Dear all,

I’m debuging an installation of freefem which was compiled with `mpi` and `petsc`, but when I run some examples - stokes-2d-PETSc.edp - I have the following error :

```auto
Load error: PETSc
         fail: 
 dlerror : .../intel-19.0.5/freefem-4.10/lib/ff++/4.10/lib/mpi/PETSc.so: cannot open shared object file: No such file or directory

```

Indeed, there is no PETSc.so in the specified directory, which leads me to believe that the installation was not successfull.

Now I’m trying to compile it myself and I’m getting core dumps.

We have our own (working) installation of PETSc-3.13.1, we are running on a RHEL 7.7, the code is submited using slurm sbatch, we use intel compiler and intel mpi.

Is there a problem with the petsc version ?

```auto
/bin/sh: line 1: 3439 Segmentation fault (core dumped) ./configure --prefix=/work/scitas-ge/erothe/incs/freefem/install/ff-petsc/r MAKEFLAGS='' --with-debugging=0 COPTFLAGS='-O3 -mtune=native' CXXO
PTFLAGS='-O3 -mtune=native' FOPTFLAGS='-O3 -mtune=native' --with-cxx-dialect=11 --with-ssl=0 --with-x=0 --with-fortran-bindings=0 --with-cudac=0 --with-cc='/ssoft/spack/arvine/v1/opt/spack/linux-rhel7-ca
scadelake/intel-19.0.5/intel-mpi-2019.5.281-le7rnxvb6v4cwabdylht4misqgzxeg5f/compilers_and_libraries_2019.5.281/linux/mpi/intel64/bin/mpiicc' --with-cxx='/ssoft/spack/arvine/v1/opt/spack/linux-rhel7-casc
adelake/intel-19.0.5/intel-mpi-2019.5.281-le7rnxvb6v4cwabdylht4misqgzxeg5f/compilers_and_libraries_2019.5.281/linux/mpi/intel64/bin/mpiicpc' --with-fc='/ssoft/spack/arvine/v1/opt/spack/linux-rhel7-cascad
elake/intel-19.0.5/intel-mpi-2019.5.281-le7rnxvb6v4cwabdylht4misqgzxeg5f/compilers_and_libraries_2019.5.281/linux/mpi/intel64/bin/mpiifort' --with-scalar-type=real --with-blaslapack-include='' --with-bla
slapack-lib='-Wl,-rpath,/ssoft/spack/arvine/v1/opt/spack/linux-rhel7-cascadelake/intel-19.0.5/intel-mkl-2019.5.281-hclmbcuneehel46b2hzc65v7rkjh4746/compilers_and_libraries_2019.5.281/linux/mkl/lib/intel6
4 -L/ssoft/spack/arvine/v1/opt/spack/linux-rhel7-cascadelake/intel-19.0.5/intel-mkl-2019.5.281-hclmbcuneehel46b2hzc65v7rkjh4746/compilers_and_libraries_2019.5.281/linux/mkl/lib/intel64 /lib64/libpthread.
so /lib64/libm.so /lib64/libdl.so -lmkl_intel_lp64 -lmkl_sequential -lmkl_core' --download-metis --download-ptscotch --download-hypre --download-parmetis --download-mmg --download-parmmg --download-super
lu --download-suitesparse --download-tetgen --download-slepc --download-hpddm --download-slepc-configure-arguments="--download-arpack=https://github.com/prj-/arpack-ng/archive/9fc0c71.tar.gz" --download-
scalapack --download-mumps PETSC_ARCH=fr
make: *** [petsc-3.17.0/tag-conf-real] Error 139

```

STEPS:

```auto
git clone https://github.com/FreeFem/FreeFem-sources.git
module load intel intel-mpi petsc python
cd FreeFem-sources && autoreconf -i
./configure --prefix=/work/scitas-ge/erothe/incs/freefem/install \
--enable-optim --enable-download --with-mpi=yes --disable-superlu --enable-download_hpddm \
--with-petsc=/ssoft/spack/arvine/v1/opt/spack/linux-rhel7-cascadelake/intel-19.0.5/petsc-3.13.1-uwvmvb5jd34pwyn4cv5r44zkh5atxj5u/lib/petsc/conf/petscvariables \
--with-slepc-include=/ssoft/spack/arvine/v1/opt/spack/linux-rhel7-cascadelake/intel-19.0.5/slepc-3.13.3-ohnennkwwfuu2zexdsf5srfnspc46uiq/include \
--with-slepc-ldflags=/ssoft/spack/arvine/v1/opt/spack/linux-rhel7-cascadelake/intel-19.0.5/slepc-3.13.3-ohnennkwwfuu2zexdsf5srfnspc46uiq/lib
./3rdparty/getall -a
cd 3rdparty/ff-petsc && make petsc-slepc

```

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [October 4, 2022, 9:13am UTC](https://community.freefem.org/t/installation-with-local-petsc/2038/2 "2022-10-04T09:13:53Z")

</div>

On the one hand, if you already have PETSc installed, then you should not `make petsc-slepc`. On the other hand, you have an extremely old PETSc installed on your machine, so indeed I would use `make petsc-slepc`, but you should then not pass the variables `--with-petsc --with-slepc-include` and such to `./configure`.

---

<div class="post-metadata">

**Author:** ![erothe](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@erothe](https://community.freefem.org/u/erothe)\
**Post date:** [October 4, 2022, 12:23pm UTC](https://community.freefem.org/t/installation-with-local-petsc/2038/3 "2022-10-04T12:23:20Z")

</div>

Thank you for your help. I will try to narrow a bit more this issue with your input.

---

<div class="post-metadata">

**Author:** ![erothe](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@erothe](https://community.freefem.org/u/erothe)\
**Post date:** [October 17, 2022, 2:31pm UTC](https://community.freefem.org/t/installation-with-local-petsc/2038/4 "2022-10-17T14:31:44Z")

</div>

In order to make things clear I decided to follow the instructions in the README.md, but the following commands got me a segmentation fault, both with intel 19.0.5 and gcc 8.4.0.

```auto
git clone https://github.com/FreeFem/FreeFem-sources.git
cd FreeFem-sources && autoreconf -i
./configure --prefix=/work/scitas-ge/erothe/incs/freefem/install --enable-optim --enable-download
./3rdparty/getall -a
cd 3rdparty/ff-petsc && make petsc-slepc

```

I have uploaded `configure.log`

[configure.log](https://community.freefem.org/uploads/short-url/hbEKZsZndhxF3RRAGGhgcXanvgz.log) (82.9 KB)

ps: I went in vacations between the 6th and last friday…

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [October 17, 2022, 4:38pm UTC](https://community.freefem.org/t/installation-with-local-petsc/2038/5 "2022-10-17T16:38:27Z")

</div>

The end of the log reads:

```auto
      Warning accessing /home/erothe/.local/bin gives errors: [Errno 2] No such file or directory: '/home/erothe/.local/bin'
      /home/erothe/bin: slmodules z50_slmodules.ng.sh~ z50_slmodules.ng.sh

```

What’s up with your system? Is this a cluster? Are you doing this on a compute node or connection node?

Could you try the develop branch of FreeFEM instead?
