Cmake based Elmer distributions

Updates in software, documentation, sites etc.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Cmake based Elmer distributions

Post by raback »

Hi All,

Elmer project is still on the transition period from svn/gnu autotools to git/cmake. While most things work already better under cmake we haven't completely jumped to the wagon yet. However, most distributions that we support are currently already created using the cmake version. Here is a summary of the possible options:

1) Windows installer
There is a nightly build both with and without mpi.
http://www.nic.funet.fi/pub/sci/physics ... n/windows/
This is updated to the sf.net also accationally.

2) The is a Linux version at launchpad that can be used on Ubuntu and Debian based systems
$ sudo apt-add-repository ppa:elmer-csc-ubuntu/elmer-csc-ppa
$ sudo apt-get update
$ sudo apt-get install elmerfem-csc

3) Linux Mint based virtual machine
http://www.nic.funet.fi/pub/sci/physics ... in/Vmware/
The VM is huge in size but provides a certified user experience. We mainly use this on courses.

4) Compile yourself from the source files using cmake and the source codes at github (devel branch):
https://github.com/elmercsc/elmerfem

# Create directory where to download things
$ mkdir elmer
$ cd elmer

# clone the git repository.
git clone git://www.github.com/ElmerCSC/elmerfem

# create build directory
$ mkdir build
$ cd build

# let the cmake generate makefiles
$ cmake -DWITH_ELMERGUI:BOOL=FALSE -DWITH_MPI:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=../install ../elmerfem

# Cmake configures things, if it does not find something (e.g., lapack), you can help it by
$ cmake -DCMAKE_PREFIX_PATH=<path_to_lapack_installation> ../elmerfem

# Alternatively, you can tune the compilation parameters graphically with
$ ccmake .
# or
$ cmake-gui .

# If no errors are produced, compile:
$ make install
# or alternatively compile in parallel (4 procs)
$ make -j4 install

# finally you may test the newly compiled Elmer version
$ ctest

Warning: Be aware there are many outdated distributions for Elmer. For example, the default version you get with apt-get is problematic. Also CAELinux installation is rather old. We can only study bug reports that are based an a relatively fresh installation!

Best regards,
ElmerTeam
johnh
Posts: 1
Joined: 07 Jan 2015, 17:40
Antispam: Yes

Re: Cmake based Elmer distributions

Post by johnh »

Hi All,

I am an Elmer/linux/cmake newbie. Starting from older web-pages (e.g., http://elmerice.elmerfem.org/wiki/doku. ... ompilation) I have taken a rather meandering route here, with many dead ends. So, I have tried a few things (e.g., scripts and manual installs), and have looked around a fair amount. Apologies, however, if my question is still obvious.

I think it boils down to cmake, for some reason, not finding libraries. The text in black is from the post (above) by the Elmer team. I've worked through what they suggest starting at point 4) as I'm using CentOS. The text is blue are my notes on what I've done. The on screen output of cmake (running cmake from a clean build directory) is at the end of this post in case it helps.

Thank you, and any help would be appreciated

John

Preparation
> Installed openmpi


4) Compile yourself from the source files using cmake and the source codes at github (devel branch):
https://github.com/elmercsc/elmerfem

# Create directory where to download things
$ mkdir elmer
$ cd elmer

# clone the git repository.
git clone git://www.github.com/ElmerCSC/elmerfem

# create build directory
$ mkdir build
$ cd build

# let the cmake generate makefiles
$ cmake -DWITH_ELMERGUI:BOOL=FALSE -DWITH_MPI:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=../install ../elmerfem
> last bit of this command is path to source
> Ran this with the following error
CMake Error at /usr/share/cmake/Modules/FindBLAS.cmake:594 (message):
A required library with BLAS API not found. Please specify library
location.
Call Stack (most recent call first):
CMakeLists.txt:117 (FIND_PACKAGE)
> yum indicates that 'blas.x86_64' (3.4.2-4.el7) is installed as is 'lapack.x86_64' (3.4.2-4.el7). These both appear to be in /usr/lib64/ e.g., for blas, the 'locate' command gives
/usr/lib64/libblas.so.3
/usr/lib64/libblas.so.3.4
/usr/lib64/libblas.so.3.4.2
/usr/lib64/libgslcblas.so.0
/usr/lib64/libgslcblas.so.0.0.0



# Cmake configures things, if it does not find something (e.g., lapack), you can help it by
$ cmake -DCMAKE_PREFIX_PATH=<path_to_lapack_installation> ../elmerfem
> Tried
cmake -DWITH_ELMERGUI:BOOL=FALSE -DWITH_MPI:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_PREFIX_PATH=/usr/lib64 ../elmerfem
But that didn't work as the lib64 is not used by any of the FIND_XXX() parts
> Try to set FIND_LIBRARY_USE_LIB64_PATHS
cmake -DWITH_ELMERGUI:BOOL=FALSE -DWITH_MPI:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=../install -DFIND_LIBRARY_USE_LIB64_PATHS:BOOL=TRUE ../elmerfem
> Still didn't work! Try to set the base CMAKE_PREFIX_PATH as well
cmake -DWITH_ELMERGUI:BOOL=FALSE -DWITH_MPI:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=../install -DFIND_LIBRARY_USE_LIB64_PATHS:BOOL=TRUE -DCMAKE_PREFIX_PATH=/usr ../elmerfem

> This gives the same error as above, so now I'm stuck


# Alternatively, you can tune the compilation parameters graphically with
$ ccmake .
# or
$ cmake-gui .
> Installed and tried to work things out with the cmake-gui, but I'm afraid that I don't know enough to get this to work (even using pages like viewtopic.php?f=2&t=3742)

********************
Current on-screen output of cmake

[gyjh5@gy-221-0 build]$ cmake -DWITH_ELMERGUI:BOOL=FALSE -DWITH_MPI:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=../install -DFIND_LIBRARY_USE_LIB64_PATHS:BOOL=TRUE -DCMAKE_PREFIX_PATH=/usr ../elmerfem
-- The Fortran compiler identification is GNU
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working Fortran compiler: /usr/bin/f95
-- Check for working Fortran compiler: /usr/bin/f95 -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/f95 supports Fortran 90
-- Checking whether /usr/bin/f95 supports Fortran 90 -- yes
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Error at /usr/share/cmake/Modules/FindBLAS.cmake:594 (message):
A required library with BLAS API not found. Please specify library
location.
Call Stack (most recent call first):
CMakeLists.txt:117 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
[gyjh5@gy-221-0 build]$
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Cmake based Elmer distributions

Post by annier »

Hi John,
-LAPACK libraries will have BLAS API library included within them.

-CMake integration for LAPACK libraries has been done only after the LAPACK version 3.2.1. Your machine requires the installation of latest vesions of LAPACK libraries (>=3.5) before you start the installation of Elmer.(Similar context is described here in Ubuntu 10.04. This may be solved by installing newer versions of LAPACK libraries(>= 3.5) as discussed in this post).

Yours
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
xborras7
Posts: 37
Joined: 02 Sep 2013, 21:44
Antispam: Yes

Re: Cmake based Elmer distributions

Post by xborras7 »

Hej!

I am aslo using a CentOS machine and I am a newbie too so I found it proper to post my error message here:

I followed the steps you describe in the previous post:

1) Create directory Elmer
2) Get files from gib
3) I did the following:


$ cmake -DWITH_ELMERGUI:BOOL=FALSE -DWITH_MPI:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=~/xavier/Downloads/Software/Elmer_CMAKE/elmerfem


4) I found the following error when doing:

$ make -j4 install

[xavier@CE-CLYX01 elmerfem]$ make -j4 install
[ 0%] Built target amdf77
[ 0%] [ 2%] Built target umfpack_srcs
Built target matc
[ 6%] Built target amd
[ 7%] Built target binio
[ 9%] Built target Mesh2D
[ 15%] [ 15%] [ 16%] Built target arpack
Built target mpi_stubs
Built target fhuti
[ 17%] Built target view3d
[ 18%] [ 18%] Built target viewaxis
Built target Matc_bin
[ 22%] Built target metis
[ 23%] Built target ElmerGrid
[ 71%] Built target umfpack
[ 71%] Building Fortran object fem/src/CMakeFiles/elmersolver.dir/LoadMod.F90.o
[ 71%] [ 71%] Building Fortran object fem/src/CMakeFiles/elmersolver.dir/SParIterGlobals.F90.o
Building Fortran object fem/src/CMakeFiles/elmersolver.dir/PElementBase.F90.o
/home/xavier/Downloads/Software/Elmer_CMAKE/elmerfem/fem/src/LoadMod.F90:509.22:

intval = pptr(model, solver, mtr, b, x, n, DOFs, nrm)
1
/home/xavier/Downloads/Software/Elmer_CMAKE/elmerfem/fem/src/LoadMod.F90:572.54:

M, D, S, F, element, nrow, ncol)
2
Error: Global name 'pptr' at (1) is already being used as a SUBROUTINE at (2)
/home/xavier/Downloads/Software/Elmer_CMAKE/elmerfem/fem/src/LoadMod.F90:458.22:

realval = pptr(model, element, nodes, n, nd, &
1
/home/xavier/Downloads/Software/Elmer_CMAKE/elmerfem/fem/src/LoadMod.F90:572.54:

M, D, S, F, element, nrow, ncol)
2
Error: Global name 'pptr' at (1) is already being used as a SUBROUTINE at (2)
/home/xavier/Downloads/Software/Elmer_CMAKE/elmerfem/fem/src/LoadMod.F90:371.22:

realval = pptr(model, node, val)
1
/home/xavier/Downloads/Software/Elmer_CMAKE/elmerfem/fem/src/LoadMod.F90:572.54:

M, D, S, F, element, nrow, ncol)
2
Error: Global name 'pptr' at (1) is already being used as a SUBROUTINE at (2)
/home/xavier/Downloads/Software/Elmer_CMAKE/elmerfem/fem/src/LoadMod.F90:345.22:

realval = pptr(model, x, y, z)
1
/home/xavier/Downloads/Software/Elmer_CMAKE/elmerfem/fem/src/LoadMod.F90:572.54:

M, D, S, F, element, nrow, ncol)
2
Error: Global name 'pptr' at (1) is already being used as a SUBROUTINE at (2)
/home/xavier/Downloads/Software/Elmer_CMAKE/elmerfem/fem/src/LoadMod.F90:321.21:

intval = pptr(model)
1
/home/xavier/Downloads/Software/Elmer_CMAKE/elmerfem/fem/src/LoadMod.F90:572.54:

M, D, S, F, element, nrow, ncol)
2
Error: Global name 'pptr' at (1) is already being used as a SUBROUTINE at (2)
make[3]: *** [fem/src/CMakeFiles/elmersolver.dir/LoadMod.F90.o] Error 1
make[2]: *** [fem/src/CMakeFiles/elmersolver.dir/LoadMod.F90.o.provides] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [fem/src/CMakeFiles/elmersolver.dir/all] Error 2
make: *** [all] Error 2


Any idea? What I am doing wrong?

6) It fails to pass the test:

$ -ctest -j4

0% tests passed, 293 tests failed out of 293

Thanks in advance! Big fan of Elmer Multiphisics!

/Xavier Borras
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Cmake based Elmer distributions

Post by raback »

Hi

Some potential problems/solutions:

You should do out-of-source compilation i.e. the install directory and the source directory should be different, not same.

CentOS and RedHat may require some fiddling if they are too old. Versions >= 7 should be able to compile Elmer out-of-box (gcc version >= 4.8). Also cmake version should be new enough (>= 2.8.9) but I think it will report if it is too old.

-Peter
xborras7
Posts: 37
Joined: 02 Sep 2013, 21:44
Antispam: Yes

Re: Cmake based Elmer distributions

Post by xborras7 »

Hej Peter,

I copied and paste the

Code: Select all

cmake -DWITH_ELMERGUI:BOOL=FALSE -DWITH_MPI:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=../install ../elmerfem
then

Code: Select all

make -j4 install
and the same error message. Any other idea?

You can see in the error message which repeats is:
Error: Global name 'pptr' at (1) is already being used as a SUBROUTINE at (2)

Does this help?

I was told to update the GCC ($gcc -v). I did it using the installing the "devtoolset".

Code: Select all

$ scl enable devtoolset-2 bash
However, I am still receiving the same error message when I try to install it.

/Xavi

Error message:

Code: Select all

[xavier@CE-CLYX01 build]$ make install
[  1%] Built target matc
[  1%] Built target Matc_bin
[  1%] Built target umfpack_srcs
[ 49%] Built target umfpack
[ 53%] Built target amd
[ 53%] Built target amdf77
[ 54%] Built target fhuti
[ 56%] Built target Mesh2D
[ 62%] Built target arpack
[ 62%] Built target binio
[ 63%] Built target mpi_stubs
[ 63%] Building Fortran object fem/src/CMakeFiles/elmersolver.dir/LoadMod.F90.o
/home/xavier/Downloads/Software/Elmer_CMAKE/build/fem/src/LoadMod.F90:509.22:

            intval =  pptr(model, solver, mtr, b, x, n, DOFs, nrm)
                      1
/home/xavier/Downloads/Software/Elmer_CMAKE/build/fem/src/LoadMod.F90:572.54:

                      M, D, S, F, element, nrow, ncol)
                                                      2
Error: Global name 'pptr' at (1) is already being used as a SUBROUTINE at (2)
/home/xavier/Downloads/Software/Elmer_CMAKE/build/fem/src/LoadMod.F90:458.22:

            realval = pptr(model, element, nodes, n, nd, &
                      1
/home/xavier/Downloads/Software/Elmer_CMAKE/build/fem/src/LoadMod.F90:572.54:

                      M, D, S, F, element, nrow, ncol)
                                                      2
Error: Global name 'pptr' at (1) is already being used as a SUBROUTINE at (2)
/home/xavier/Downloads/Software/Elmer_CMAKE/build/fem/src/LoadMod.F90:371.22:

            realval = pptr(model, node, val)
                      1
/home/xavier/Downloads/Software/Elmer_CMAKE/build/fem/src/LoadMod.F90:572.54:

                      M, D, S, F, element, nrow, ncol)
                                                      2
Error: Global name 'pptr' at (1) is already being used as a SUBROUTINE at (2)
/home/xavier/Downloads/Software/Elmer_CMAKE/build/fem/src/LoadMod.F90:345.22:

            realval = pptr(model, x, y, z)
                      1
/home/xavier/Downloads/Software/Elmer_CMAKE/build/fem/src/LoadMod.F90:572.54:

                      M, D, S, F, element, nrow, ncol)
                                                      2
Error: Global name 'pptr' at (1) is already being used as a SUBROUTINE at (2)
/home/xavier/Downloads/Software/Elmer_CMAKE/build/fem/src/LoadMod.F90:321.21:

            intval = pptr(model)
                     1
/home/xavier/Downloads/Software/Elmer_CMAKE/build/fem/src/LoadMod.F90:572.54:

                      M, D, S, F, element, nrow, ncol)
                                                      2
Error: Global name 'pptr' at (1) is already being used as a SUBROUTINE at (2)
make[3]: *** [fem/src/CMakeFiles/elmersolver.dir/LoadMod.F90.o] Error 1
make[2]: *** [fem/src/CMakeFiles/elmersolver.dir/LoadMod.F90.o.provides] Error 2
make[1]: *** [fem/src/CMakeFiles/elmersolver.dir/all] Error 2
make: *** [all] Error 2

KaiMartin
Posts: 42
Joined: 02 Jun 2013, 00:07
Antispam: Yes
Location: Hannover, Germany
Contact:

Cmake compile on Debian/Jessie

Post by KaiMartin »

This post is meant as a heads up for fellow Debian users.
I just did a fresh compile on a fairly current Debian box according the instructions above. The build went smoothly with no errors. Very impressive for such a large and complex package.

This is my first exposure to cmake and I like it. Finally a build system that does not flood me with messages, or alternatively stay just silent. It even gives hints on the progress.
---<)kaimartin(>---
dekoder87
Posts: 31
Joined: 22 Oct 2014, 19:42
Antispam: Yes
Location: United Kingdom

Re: Cmake based Elmer distributions

Post by dekoder87 »

Hello,

I don't know if this information will be helpfull, but I have noticed that compiling elmer with using just one core eliminate some errors, so it is better to use make command rather than make -j 4.

Regards,

Jacek
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Cmake based Elmer distributions

Post by annier »

Hi Jacek,
Could you be more specific on " type of errors that the procedure of compilation for single processor resolve"?

Yours
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
dekoder87
Posts: 31
Joined: 22 Oct 2014, 19:42
Antispam: Yes
Location: United Kingdom

Re: Cmake based Elmer distributions

Post by dekoder87 »

Hi Anil,

I didn't save error messages, but generally I was getting errors with linking modules or missing files on multicore compiling. When I used single core those errors didn't appear.
Maybe it was caused by using old compilers and old version of linux (CAELinux 2013).

Regards,

Jacek
Post Reply