Skip to content
juhanikataja edited this page Dec 7, 2016 · 8 revisions

Compilation

Here you can find step by step instructions how to download and compile the development version of elmer.

Linux/*NIX

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

    $ git clone https://www.github.com/ElmerCSC/elmerfem
  2. Create build directory

$ mkdir elmer-build

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

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

    SET(CMAKE_INSTALL_PREFIX "$ENV{PWD}/../elmer-install" CACHE PATH "")
    SET(CMAKE_C_COMPILER "gcc" CACHE STRING "")
    SET(CMAKE_CXX_COMPILER "g++" CACHE STRING "")
    SET(CMAKE_Fortran_COMPILER "gfortran" CACHE STRING "")

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

  2. Generate build scripts

    $ cd elmer-build
    $ cmake -C ../elmer-opts.cmake ../elmerfem

    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.

  3. Build and install

    $ make -jN install

    Where N is the number of threads to be used.

  4. Set environment variable ELMER_HOME point to installation directory and add $ELMER_HOME/bin to PATH.

Clone this wiki locally