Warning: Undefined array key 1 in /home/np29546/public_html/elmerice/wiki/inc/auth.php on line 78

Warning: Cannot modify header information - headers already sent by (output started at /home/np29546/public_html/elmerice/wiki/inc/auth.php:78) in /home/np29546/public_html/elmerice/wiki/inc/auth.php on line 431

Warning: Cannot modify header information - headers already sent by (output started at /home/np29546/public_html/elmerice/wiki/inc/auth.php:78) in /home/np29546/public_html/elmerice/wiki/inc/actions.php on line 38
compilation:compilationcmake [Elmer/Ice Wiki]

This is an old revision of the document!


Compilation with Cmake

As a prerequisite to use Elmer/Ice package, you need to have Elmer installed on your computer. If it is not the case, have a look on the quick guide on Sources and compilation page. The elmerfem Wiki page still contains infromation on the old autotools, but shall be updated soon.

Download

Elmer/Ice can be retrieved through the whole Elmer package via GitHub. From the shell of a system that has git installed, the command

 git clone git://www.github.com/ElmerCSC/elmerfem

Please, bear in mind that there are different branches in this repository. The most recent Elmer branch, devel, usually does not contain the latest Elmer/Ice developments. In order to be sure to have an Elmer/Ice development that doesn't interfere with the main Elmer branch development, we created a branch named elmerice. In order to check, which branch one is in, one can give the command

 git status

In order to change into the elmerice branch, one has to type

 git checkout elmerice

Building Elmer/Ice

Elmer/Ice - in contrary to the earlier autotools version - is best built alongside the main Elmer using cmake. Consequently, the prerequisites match those needed for building Elmer in the first instance:

  • A Fortran 90 compiler
  • (GNU) Make
  • cmake

In order to have Elmer/Ice automatically built alongside Elmer, add the following option to the cmake build command:

-DWITH_ElmerIce:BOOL=TRUE

The following script can act as a guideline to compile Elmer with Elmer/Ice included:

#!/bin/bash

CMAKE=cmake

# Installation directory (set these!)
TIMESTAMP=$(date +"%m-%d-%y")
ELMER_REV="Elmer_devel_${TIMESTAMP}"
ELMERSRC="/path/to/Elmer/Source/elmerfem"
BUILDDIR="$ELMERSRC/builddir"
IDIR="/usr/local/$ELMER_REV"
# next line is optional
TOOLCHAIN="/path/to/your/own/toolchainfile/yourtoolchainfile.cmake"

echo "Building Elmer from within " ${BUILDDIR}
echo "using following toolchain file " ${TOOLCHAIN}
echo "installation into " ${IDIR}
cd ${BUILDDIR}
pwd
ls -ltr

echo $CMAKE $ELMERSRC -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN

$CMAKE $ELMERSRC -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN \
    -DCMAKE_INSTALL_PREFIX=$IDIR \
    -DWITH_MPI:BOOL=TRUE \
    -DWITH_MUMPS:BOOL=TRUE \
    -DWITH_Hypre:BOOL=TRUE \
    -DWITH_TRILINOS:BOOL=FALSE \
    -DWITH_ELMERGUI:BOOL=FALSE \
    -DWITH_ElmerIce:BOOL=TRUE

pwd                              
make -j4 && sudo make install
sudo rm /usr/local/Elmer-devel
sudo ln -s $IDIR /usr/local/Elmer-devel

Hint: if you need to use sudo rights to install, sometimes the -E option is in order to redirect the current environment to the process.

Usage

To use the Elmer/Ice Solvers and User functions, simply modify your sif files to point on the ElmerIceSolvers and ElmerIceUSF object files:

Procedure =  File "ElmerIceSolvers" "NameSolver"

where NameSolver is the name of the solver you want to execute.

License

The complete tree elmerice is released under GPL 2 (or later), just like the rest of the code. The main difference of the elmerice branch with respect to the rest of Elmer is that for Elmer/Ice the intellectual property lies not with CSC, but with the community. In short that means that no non-GPL branch can be derived from anyone (including CSC). This also means, that Elmer/Ice code has to stay within the elmerice tree.

compilation/compilationcmake.1424872577.txt.gz · Last modified: 2015/02/25 13:56 by tzwinger
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0