compilation error with mmg

Discussion about building and installing Elmer
oxi
Posts: 6
Joined: 16 Mar 2020, 11:46
Antispam: Yes

compilation error with mmg

Post by oxi »

Good afternoon,

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:1457: fem/src/libelmersolver.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:14514: fem/src/CMakeFiles/elmersolver.dir/all] Error 2
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
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: compilation error with mmg

Post by mzenker »

Hi,

is there a particular reason why you want to build Elmer from source? There are binaries in a ppa repository here: https://launchpad.net/~elmer-csc-ubuntu ... er-csc-ppa.

HTH,
Matthias
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: compilation error with mmg

Post by kevinarden »

My experience is that the PPA does not work on Debian. However the VM does work.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: compilation error with mmg

Post by kevinarden »

For debian

I was able to compile ElmerSolver using these instructions to install BLAS and LAPACK
https://wiki.debian.org/DebianScience/L ... aLibraries
I also had to install OPENMPI , gfortran, and cmake

Then I followed these instructions
https://www.csc.fi/web/elmer/sources-and-compilation
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: compilation error with mmg

Post by kevinarden »

I put a compiled Debian version of the ElmerSolver here.

https://github.com/mrkearden/ElmerSolverDebian

the executables are in bin you can add them to your path/home or usr/bin
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: compilation error with mmg

Post by kevinarden »

i was able to compile ElmerGUI with Debian by commenting out all of the options and making sure qt4 was installed

\
gui.png
gui.png (33.16 KiB) Viewed 7422 times
oxi
Posts: 6
Joined: 16 Mar 2020, 11:46
Antispam: Yes

Re: compilation error with mmg

Post by oxi »

Stupid me, it was in the mmg forum:

cmake -D LIBMMG_SHARED=ON -D USE_SCOTCH=ON -DTEST_LIBMMG=ON -D LIBMMG_STATIC=OFF ..

does the job.

Harald
oxi
Posts: 6
Joined: 16 Mar 2020, 11:46
Antispam: Yes

Re: compilation error with mmg

Post by oxi »

Generally, it can build it with these options:

cmake -DWITH_ELMERGUI:BOOL=FALSE -DWITH_MPI:BOOL=TRUE -DWITH_QWT:BOOL=TRUE -DWITH_VTK:BOOL=TRUE -DWITH_PARAVIEW:BOOL=TRUE -DWITH_OCC:BOOL=TRUE -DWITH_Hypre:BOOL=TRUE -DWITH_Mumps:BOOL=TRUE -DHypre_INCLUDE_DIR=/usr/include/hypre/ -DWITH_Zoltan:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=../install ../elmerfem

Except for mmg everything can be found in repositories and it is much more straight forward than fiddling around with the Ubuntu version.

Problem is rather QT4. I cannot install it on a recent Debian machine due to conflicts with QT5. So, ElmerGUI cannot be compiled.

Thanks for your help!
Harald
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: compilation error with mmg

Post by kevinarden »

-DWITH_QT5:BOOL=TRUE
oxi
Posts: 6
Joined: 16 Mar 2020, 11:46
Antispam: Yes

Re: compilation error with mmg

Post by oxi »

Ups! Cool. Thank you!
Post Reply