Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1. If you are using intel compiler set elmer-opts.cmake to be as follows:


2. Load the relevant modules e.g.

Code Block
$ module list
Currently Loaded Modulefiles:
  1) cmake/3.13.4       2) intel/2018.5.274   3) hpcx/2.4.0         4) mkl/2018.5.274


Procedure 


1. Retrieve the source and unpack it. Here we clone the whole repository:

Code Block
$ git clone https://www.github.com/ElmerCSC/elmerfem 


2. Create build directory

Code Block
$ mkdir elmer-build


3. Elmer compilation system is built upon CMake which utilizes out of source builds strongly.

Create pre-cache file, and save it as, f.ex, elmer-opts.cmake for CMake which contains something like this:

Code Block
SET(CMAKE_INSTALL_PREFIX "$ENV{PWD}/../elmer-install" CACHE PATH "")
SET(CMAKE_C_COMPILER "iccgcc" CACHE STRING "")
SET(CMAKE_CXX_COMPILER "icpcg++" CACHE STRING "")
SET(CMAKE_Fortran_COMPILER "ifortgfortran" CACHE STRING "")

2. Load the relevant modules e.g.

...


Here you can choose the installation directory for Elmer as well by modifying variable the CMAKE_INSTALL_PREFIX.


In case, you are using intel compiler set elmer-opts.cmake to be as follows:

Code Block
SET(CMAKE_INSTALL_PREFIX "../elmer-install" CACHE PATH "")
SET(CMAKE_C_COMPILER "icc" CACHE STRING "")
SET(CMAKE_CXX_COMPILER "icpc" CACHE STRING "")
SET(CMAKE_Fortran_COMPILER "ifort" CACHE STRING "")


4. Generate build scripts

Code Block
$ cd elmer-build

--- For elmer use
$ cmake -C ../elmer-opts.cmake ../elmerfem 

--- For elmer/ice add the bool flag
$ cmake -C ../elmer-opts.cmake ../elmerfem -DWITH_ElmerIce:BOOL=TRUE


The cmake tool will now inform if any libraries are missing. The build configuration can be further edited using e.g. ccmake tool or cmake-gui application.


5. Build and install

Code Block
$ make -j8 install