# Fatal error: Cannot open source file "gnu/stubs-32.h"

**URL:** <https://community.freefem.org/t/fatal-error-cannot-open-source-file-gnu-stubs-32-h/1488>\
**Category:** FreeFEM installation\
**Created:** [February 11, 2022, 10:29am UTC](https://community.freefem.org/t/fatal-error-cannot-open-source-file-gnu-stubs-32-h/1488 "2022-02-11T10:29:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mas](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/mas/32/2160_2.png) [@mas](https://community.freefem.org/u/mas)\
**Post date:** [February 11, 2022, 10:29am UTC](https://community.freefem.org/t/fatal-error-cannot-open-source-file-gnu-stubs-32-h/1488/1 "2022-02-11T10:29:18Z")

</div>

I’m installing FreeFEM on my HPC cluster environment, following the discussion " [MPI fail on HPC cluster](https://community.freefem.org/t/mpi-fail-on-hpc-cluster/1303)", but make failed.

Final messages (translated from japanese) were

> eval ./ff-c++ gsl.cpp -lgsl -lgslcblas -lm -I/usr/include  
> FCCpx -c -fPIC ‘-I./include’ ‘-I/usr/include’ -g -DNDEBUG -O3 -mmmx -mavx -std=c++14 -DBAMG\_LONG\_LONG -DNCHECKPTR -fPIC ‘gsl.cpp’  
> FCCpx: Warning: -mmmx is an unrecognizable option.  
> FCCpx: Warning: -mavx is an unrecognizable option.  
> “/usr/include/gnu/stubs.h”, line 7: Fatal error: Cannot open source file “gnu/stubs-32.h” .  
> # include \<gnu/stubs-32.h\>

I’m not the root user of this system, so I can not edit “/usr/include/gnu/”.

In directory /usr/include/gnu, there is  
lib-names-64.h lib-names.h libc-version.h stubs-64.h stubs.h

How can I solve this problem?  
Can I compile freefem without “gnu/stubs-32.h”?

Run commands are bellow:

> module load fj  
> module load fjmpi  
> module load odyssey  
> cd $HOME  
> export FF\_DIR=${PWD}/FreeFem-sources  
> export PETSC\_DIR=${PWD}/petsc  
> export PETSC\_ARCH=arch-FreeFem  
> export PETSC\_VAR=${PETSC\_DIR}/${PETSC\_ARCH}  
> cd ${PETSC\_DIR}  
> export CC=mpifccpx  
> export CXX=mpiFCCpx  
> export FC=mpifrtpx  
> export F77=mpifrtpx  
> ./configure --enable-download --without-hdf5 --host=aarch64 CC=$CC CXX=$CXX FC=$FC F77=$F77 --with-batch  
> make PETSC\_DIR=$HOME/petsc PETSC\_ARCH=arch-FreeFem all
> 
> cd $FF\_DIR  
> autoreconf -i  
> export CC=fccpx  
> export CXX=FCCpx  
> export FC=frtpx  
> export F77=frtpx  
> export MPICC=mpifccpx  
> export MPICXX=mpiFCCpx  
> export MPIFC=mpifrtpx
> 
> ./configure --without-hdf5 --with-petsc=${PETSC\_VAR}/lib CC=$CC CXX=$CXX FC=$FC F77=$F77 COPTFLAGS=“-Kfast” CXXOPTFLAGS=“-Kfast” FOPTFLAGS=“-Kfast” --prefix=$PWD --host=aarch64 MPICC=$MPICC MPICXX=$MPICXX MPIFC=$MPIFC --build=x86\_64
> 
> make

---

<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:** [February 11, 2022, 10:38am UTC](https://community.freefem.org/t/fatal-error-cannot-open-source-file-gnu-stubs-32-h/1488/2 "2022-02-11T10:38:45Z")

</div>

If you don’t need the GSL, you can edit `plugin/seq/gsl.cpp` and apply the following patch.

```auto
diff --git a/plugin/seq/gsl.cpp b/plugin/seq/gsl.cpp
index e9b09630..bc146966 100644
--- a/plugin/seq/gsl.cpp
+++ b/plugin/seq/gsl.cpp
@@ -23,7 +23,7 @@
 // Example C++ function "myfunction", dynamically loaded into "load.edp"

 /* clang-format off */
-//ff-c++-LIBRARY-dep: gsl
+//ff-c++-LIBRARY-dep: broken
 //ff-c++-cpp-dep:
 /* clang-format on */

```

---

<div class="post-metadata">

**Author:** ![mas](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/mas/32/2160_2.png) [@mas](https://community.freefem.org/u/mas)\
**Post date:** [February 11, 2022, 1:21pm UTC](https://community.freefem.org/t/fatal-error-cannot-open-source-file-gnu-stubs-32-h/1488/3 "2022-02-11T13:21:24Z")

</div>

Thank you very much! Compilation successfully completed.

Then, I tested FreeFem++-mpi,

> mpiexec FreeFem++-mpi **‘test.edp’** -ng

and get

> – FreeFem++ v4.1 (2022年 2月 11日 金曜日 19:44:33 JST - git v4.10)  
> file : test.edp  
> Load: lg\_fem no UMFPACK → replace by LU or GMRES lg\_mesh lg\_mesh3 parallelempi  
> 1 : // test.edp  
> 2 : load “PETSc”  
> Load error: PETSc  
> fail:  
> dlerror : PETSc.so: cannot open shared object file: No such file or directory  
> list prefix: ‘/xx/username/FreeFem-sources/plugin/seq:/xx/username/FreeFem-sources/plugin/mpi:/xx/username/petsc/arch-FreeFem/lib/’ ‘’ list suffix: ‘’ , ‘.so’  
> current line = 2 mpirank 0 / 1  
> Load error : PETSc  
> line number :2, PETSc  
> error Load error : PETSc  
> line number :2, PETSc  
> code = 2 mpirank: 0

Does this mean that the installation of PETSc is failing? Or am I still missing several steps?

---

<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:** [February 11, 2022, 4:58pm UTC](https://community.freefem.org/t/fatal-error-cannot-open-source-file-gnu-stubs-32-h/1488/4 "2022-02-11T16:58:05Z")

</div>

Does the file `/xx/username/FreeFem-sources/plugin/mpi/PETSc.so` exist?

---

<div class="post-metadata">

**Author:** ![mas](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/mas/32/2160_2.png) [@mas](https://community.freefem.org/u/mas)\
**Post date:** [February 12, 2022, 2:50am UTC](https://community.freefem.org/t/fatal-error-cannot-open-source-file-gnu-stubs-32-h/1488/5 "2022-02-12T02:50:08Z")

</div>

No, it doesn’t.  
It also does not exist in anywhere $HOME/petsc/  
The file `$HOME/petsc/arch-FreeFem/lib/libpetsc.so` exist.  
However, the file `/xx/username/FreeFem-sources/plugin/mpi/medit.so` exists, for example, but `load medit` returns `dlerror : medit.so`.

---

<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:** [February 12, 2022, 6:55am UTC](https://community.freefem.org/t/fatal-error-cannot-open-source-file-gnu-stubs-32-h/1488/6 "2022-02-12T06:55:23Z")

</div>

Then that means you have not compiled or enabled PETSc support, which in turn means you cannot `load "PETSc"` in your file.
