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

I’m installing FreeFEM on my HPC cluster environment, following the discussion " MPI fail on HPC cluster", 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

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

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 */

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?

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

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.

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

1 Like