I am trying to build elmer from source on Debian Linux, 64 bit and it gives me some headache.
I installed mmg tools via
git clone https://github.com/MmgTools/mmg.git
cd mmg
mkdir build
cd build/
cmake ..
make
sudo make install
... and all seems fine.
When I then try to build elmer with the commands described in https://www.csc.fi/web/elmer/sources-and-compilation, I throws the following error and quits:
[ 67%] Building Fortran object fem/src/CMakeFiles/elmersolver.dir/SolverActivate_x.F90.o
[ 67%] Building Fortran object fem/src/CMakeFiles/elmersolver.dir/ElmerSolver.F90.o
[ 67%] Linking Fortran shared library libelmersolver.so
/usr/bin/ld: /usr/local/lib/libmmg.a(inout_3d.c.o): relocation R_X86_64_PC32 against symbol `stdout@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [fem/src/CMakeFiles/elmersolver.dir/build.make
make[1]: *** [CMakeFiles/Makefile2
make: *** [Makefile:163: all] Error 2
That started when I sed mmg, before all compiled fine.
I sthere anyone out there knowing a solution? To be honest, I do not know where to put the -fPIC option when compiling like recommended by the error message.
Thanks for helping!
Harald