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" ..
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/" ..
C:\oofem), right-click on it and select
Git clone…from the contextual menu. In the window that appears, use the address:
cmake-guiand press enter to load the graphic interface for CMake. The bin folder in CMake installation directory must in system path; if the command does not work, add it and restart the prompt.
C:\oofem) in the fieds
Where is the source code:and
Where to build the binaries:and click
Configuretwice. Select in the data line now displayed in the main panel all the packages you want to include in your built (
USE_…flags). You can also leave the default checks. Finally press
Generateand choose in the window that would appear
Visual Studio 12 2013and
Use native compiler.
C:\oofem) double-click on
oofem.slnto start VS; right-click on the
oofemproject and click on
Set as StartUp Project. Compile the solution. You can find the resulting
USE_SHARED_LIBin CMake to generate a monolithic executable.
If you plan to redistribute the OOFEM executable to Windows XP machines, you must set the property
Visual Studio 2013 - Windows XP (v120_xp) in
Configuration Properties\General\Platform Toolset from the
oofem project settings.
If you're interested in parallel version for Windows, go here.