This is an old revision of the document!
You can get the release version of OOFEM from its download page. After downloading, unpack the distribution.
* In case of tar .tar.gz files you can use, for example, following command
gunzip -c oofem-x.y.tar.gz | tar xof -
* In case of .zip files use
Alternatively, you can get the bleeding edge version of OOFEM from the OOFEM Git repository. This step requires Git to be installed on your system (see our Git tutorial for more info). To grab a copy of the latest version of OOFEM using public git access, use following command:
# When a repository is cloned, git automatically creates a master branch that tracks origin/master git clone http://www.oofem.org/git/oofem.git oofem.git # If you would like to track develop branch git checkout -b develop origin/develop
The oofem.git directory has been created with OOFEM source tree.
Once you've checked out a copy of the source tree, you can update your source tree at any time so it is in sync with the latest and greatest by entering your oofem directory and running the command:
git fetch origin
Be aware, however, that develop branch of the code is not guaranteed to be stable. This option is intended mainly for active oofem developers, giving access to the most up-to-date version.
Pre-build packages are available in the PPA for Václav Šmilauer.
deb http://ppa.launchpad.net/eudoxos/ppa/ubuntu karmic main deb-src http://ppa.launchpad.net/eudoxos/ppa/ubuntu karmic main
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 92DE8183
sudo apt-get update && sudo apt-get install oofem oofem-mpi oofem-oofeg oofem-doc
sudo apt-get install build-essential xorg-dev
mkdir -p ~/build/debug/
cd ~/build/debug cmake ~/oofem.git/
cd ~/build/debug; make
mkdir -p ~/build/release/ cd ~/build/release/ cmake -DCMAKE_BUILD_TYPE=Release ~/oofem.git/ make
To make configuration options, either use the ncurses interface
ccmake or the graphical interface
cmake-gui or supply additional commands directly
cmake -DCMAKE_CXX_FLAGS="-Werror" ~/oofem.git
Some common build options
Full list of configure options can be obtained running 'ccmake' or any other CMake GUI. See the CMake page for more details.
Run make to compile the required targets as:
cd ~/build/target; make
Supply valid target directory (as set up in configuration)“.
The target executable will be created in ~/build/target directory.
To test solver compiled under “target_name” target, change working directory to target directory:
Run ctest to run the internal tests (takes a while)
You can run specific tests by using the -R flag for ctest
ctest -R spring
or for example, only the parallel tests (only availble when parallel support is compiled)
ctest -R partest
There are also two custom targets added, “tests” and “benchmarks” which can be accessed
make tests make benchmarks
which only runs the mandatory tests and the optional benchmark examples respectively. These custom targets are also accessible from KDevelop, Visual Studio and other IDEs.
$git.exe clone http://www.oofem.org/git/oofem.git oofem.git
$cmake.exe -G"MinGW Makefiles" ..
It is needed sometimes to run this command twice. This ensures creating makefiles for MinGW.
$cmake.exe -G "MinGW Makefiles" ..
a few times. Cmake starts to complain about a missing RC compiler. Edit CMakeCache.txt and edit line specifying RC compiler, to make e.g. CMAKE_RC_COMPILER:FILEPATH=c:/MinGW/bin/windres.exe. Run
$mingw32-make.exe. A shared library is created. To compile oofem with CEMHYD and TinyXML2 support, run
$cmake.exe -G"MinGW Makefiles" -DUSE_CEMHYD="ON" -DTINYXML2_DIR="/c/oofem/tinyxml/" ..
$cmake.exe -G"MinGW Makefiles" -DCMAKE_CXX_FLAGS="-O2" -DUSE_IML="ON" -DUSE_STATIC_LIB="ON" .. $mingw32-make.exe
If you want smoothless transfer of oofem.exe to another windows computer, you need to put all *.dll from c:\MinGW\bin in the same directory as oofem.exe.