User Tools

Site Tools


installation

This is an old revision of the document!


Getting oofem

Getting release version

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

unzip oofem-x.y.zip

Getting development version

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.

cd oofem.git; 

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.

Unix / Linux Installation

Installation on Ubuntu system (9.10 Karmic and later)

Pre-build packages are available in the PPA for Václav Šmilauer.

  • First add the folowing lines to your sources.list:
  deb http://ppa.launchpad.net/eudoxos/ppa/ubuntu karmic main 
  deb-src http://ppa.launchpad.net/eudoxos/ppa/ubuntu karmic main 
  • Second: tell ubuntu to trust this PPA (Obvious: you must make sure you trust the PPA owner before installing their software…)
  sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 92DE8183
  • Third: update and install:
  sudo apt-get update && sudo apt-get install oofem oofem-mpi oofem-oofeg oofem-doc

Quick Installation

  • You will need the build-essential (to build) and the xorg-dev (for use of oofeg) packages. On a Ubuntu/Debian system run:
  sudo apt-get install build-essential xorg-dev
  • Create a build directory
  mkdir -p ~/build/debug/
  • Configure oofem target
  cd ~/build/debug
  cmake ~/oofem.git/
  • Run make to compile the required targets as
  cd ~/build/debug; make 
  • The oofem executable will be created in ~/build/debug directory
  • Important notice: Use the debug build while you get everything to work, but make sure to compile an optimized version for running serious simulations (CMAKE_BUILD_TYPE=Release). The optimized version will be orders of magnitudes faster than the Debug build.
  mkdir -p ~/build/release/
  cd ~/build/release/
  cmake -DCMAKE_BUILD_TYPE=Release ~/oofem.git/
  make
  

Build options

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

  • CMAKE_BUILD_TYPE specifies between Debug, Release
  • CMAKE_CXX_FLAGS="flags" allows to specify compiler flags
  • USE_DSS="ON" will include sparse direct solver.
  • USE_IML="ON" IML_DIR=dir use this option to compile with IML++ (template library for iterative methods). This requires to download and install IML library. The iml sources are supposed to be located in directory dir.
  • USE_OOFEG="ON" configures and later builds built-in graphical post-processor called oofeg. Requires X-Windows, Ckit, and Elixir libraries to be installed.
    • Use CKIT_DIR=dir and ELIXIR_DIR=dir allow to specify location of Ckit and Elixir installation directories, needed by oofeg.
    • More about oofeg installation can be found here
  • USE_PARALLEL="ON" configures parallel support in oofem.
    • If you want to use ParMETIS, use USE_PARMETIS="ON".
    • Follow this link for pre-requisities and installation instructions.
    • If you want to use PETSc library use USE_PETSC="ON" together with MY_PETSC_DIR=dir and MY_PETSC_ARCH=arch options to configure PETSC support (dir is the path to PETSC installation directory, arch is PETSC architecture. See PETSC installation manual for details.)

Full list of configure options can be obtained running 'ccmake' or any other CMake GUI. See the CMake page for more details.

Compiling targets

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.

Verifying installation - running tests

Testing solver

To test solver compiled under “target_name” target, change working directory to target directory:

cd ~/build/target_name

Run ctest to run the internal tests (takes a while)

ctest

Running specific tests

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.

Windows version

  • Cygwin/X is a Linux-like environment for Windows including a port of X Window System
  • Dev-C++ is is a full-featured Integrated Development Environment (IDE) for the C/C++ programming language. It uses Mingw port of GCC (GNU Compiler Collection) as its compiler. It creates native Win32 executables. Dev-C++ is Free Software.
  • CMake is the cross-platform build tool OOFEM uses, and is able to generate build files for Visual Studio. See further instructions on the CMake wiki page.
  • TortoiseGit is the most intuitive Git client for Windows.
  • ParaView is a good and free replacement for oofeg.

Windows installation under MinGW environment

  • MinGW uses standard GNU g++ compiler. In a standard MinGW instalation, a few libraries included in oofem are missing (sys/resource.h, execinfo.h). These are not included during cmakeing and compilation for MinGW compilation.
  • Under Windows, install mingw, C, C++ and MSys as a terminal. Download these from installator.
  • You may want installing windows version of Git. Getting the development version of oofem is through a command
    $git.exe clone http://www.oofem.org/git/oofem.git oofem.git
  • Under oofem.git directory, create a new directory, e.g. target. Under target run
    $cmake.exe -G"MinGW Makefiles" ..

    It is needed sometimes to run this command twice. This ensures creating makefiles for MinGW.

  • Run $mingw32-make.exe to compile. oofem.exe is created.
  • TinyXML2 is required to read input files for CEMHYD3D module. TinyXML2 can be installed. For windows it needs to be compiled into a shared library libtinyxml2.dll. Proceed in a standard way for cmake files. Create a new subdirectory , e.g. target. Under target run
    $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/" ..

    and than

    $mingw32-make.exe
  • If oofem.exe complains about missing libtinyxml2.dll, add the location to the system path or copy libtinyxml2.dll in the same directory as oofem.exe.
  • oofem.exe with static libraries, iml support and optimized version is build via
    $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.

Windows installation with Visual Studio

  • Visual Studio 2013 is advised, since it fully supports C++11 specifications, see here. You can use the Express for Windows Desktop edition, free available here.
  • Get oofem code from Git repository as explained previously or, if you're using TortoiseGit, simply create a new folder (e.g. C:\oofem), right-click on it and select Git clone… from the contextual menu. In the window that appears, use the address:
    http://www.oofem.org/git/oofem.git
  • Start the VS2013 command prompt (choose x86 if you want a 32-bit compilation), and type cmake-gui and 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.
  • In the CMake window, insert the path the previously downloaded oofem.git copy (e.g. C:\oofem) in the fieds Where is the source code: and Where to build the binaries: and click Configure twice. 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 Generate and choose in the window that would appear Visual Studio 12 2013 and Use native compiler.
  • Now in the oofem folder (e.g. C:\oofem) double-click on oofem.sln to start VS; right-click on the oofem project and click on Set as StartUp Project. Compile the solution. You can find the resulting oofem.exe inside the Debug, Release, MinSizeRel or RelWithDebInfo folder.
  • If you want to smoothless transfer oofem.exe to another windows computer, you may have to install VC++ 2012 redistributable package.
installation.1417262468.txt.gz · Last modified: 2014/11/29 13:01 by johnnyontheweb