-
Notifications
You must be signed in to change notification settings - Fork 317
Compilation
Here you can find step by step instructions how to download and compile the development version of elmer.
-
Retrieve the source and unpack it. Here we clone the whole repository:
$ git clone https://www.github.com/ElmerCSC/elmerfem
-
Create build directory
$ mkdir elmer-build
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: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 CMAKE_INSTALL_PREFIX.
-
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 orcmake-gui
application. -
Build and install
$ make -jN install
Where
N
is the number of threads to be used. -
Set environment variable
ELMER_HOME
point to installation directory and add$ELMER_HOME/bin
toPATH
.