{"id":239,"date":"2015-10-26T10:32:27","date_gmt":"2015-10-26T10:32:27","guid":{"rendered":"http:\/\/95.85.43.55\/?page_id=239"},"modified":"2026-03-02T12:19:31","modified_gmt":"2026-03-02T12:19:31","slug":"prerequisites","status":"publish","type":"page","link":"https:\/\/opm-project.org\/?page_id=239","title":{"rendered":"Prerequisites"},"content":{"rendered":"<p>OPM uses various third-party libraries and frameworks, these include:<\/p>\n<ul>\n<li>BLAS and LAPACK<\/li>\n<li>Boost (1.58 or later)<\/li>\n<li>SuiteSparse with UMFPACK<\/li>\n<li>The Dune core modules dune-common, dune-geometry, dune-grid and dune-istl. We currently support Dune 2.9, 2.10 and 2.11. \u00a0Dune can be installed from binary packages (see the &#8220;Ubuntu binary&#8221; section below) or from source (see the <a href=\"https:\/\/dune-project.org\/doc\/installation\/\">Dune documentation<\/a>).<\/li>\n<li>The Zoltan library from Trilinos (for grid partitioning and load balancing)<\/li>\n<\/ul>\n<p>Note that some parts of OPM (opm-common) can be built without Dune. No part of OPM requires any optional Dune prerequisites, such as Alberta, ALUGrid, UG or psurface. Also, some libraries that used to be prerequisites (libecl, SuperLU and Eigen) are no longer needed.<\/p>\n<h5>Required tools<\/h5>\n<p>In addition, you need some tools:<\/p>\n<ul>\n<li>git (for cloning the repo)<\/li>\n<li>a C++ compiler (must support C++17) and cmake (for building the software),<\/li>\n<li>doxygen and latex (for building the docs).<\/li>\n<\/ul>\n<p>The easiest way to satisfy prerequisites is to install them from binary packages, we provide instructions for Ubuntu, OpenSUSE and Mac OS X. The developers use either the g++ (version 7 or later required) or clang++ (version 5 or later required) compiler.<span style=\"color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 15px;\">\u00a0<\/span><\/p>\n<h1>Ubuntu binaries (for Ubuntu 22.04 or 24.04)<\/h1>\n<p>To install binary packages of the OPM prerequisites you can follow the recipe below. Note that for some of these packages we provide our own versions, which is why you must add the OPM PPA repository even if you want to build OPM yourself. In particular, note that the Dune packages in Ubuntu 20.04 are Dune version 2.6, which is not supported with\u00a0OPM, but if you install it from the OPM PPA you get version 2.8.<\/p>\n<pre># Make sure we have updated URLs to packages etc.\nsudo apt-get update -y\n\n# For server edition of Ubuntu add-apt-repository depends on\nsudo apt-get install -y software-properties-common\n\n# Add PPA for OPM packages\nsudo add-apt-repository -y ppa:opm\/ppa\nsudo apt-get update -y\n\n# Packages necessary for building\nsudo apt-get install -y build-essential \\\n  gfortran pkg-config cmake\n\n# Packages necessary for documentation\nsudo apt-get install -y doxygen ghostscript \\\n  texlive-latex-recommended gnuplot\n\n# Packages necessary for version control\nsudo apt-get install -y git-core\n\n# MPI for parallel programs\nsudo apt-get install -y mpi-default-dev\n# Prerequisite libraries\nsudo apt-get install -y libblas-dev \\\n  libboost-all-dev libsuitesparse-dev \\\n  libtrilinos-zoltan-dev libfmt-dev libcjson-dev \n\n# Parts of Dune needed\nsudo apt-get install libdune-common-dev \\\n  libdune-geometry-dev libdune-istl-dev \\\n  libdune-grid-dev<\/pre>\n<h1>OpenSUSE<\/h1>\n<pre># libraries\nsudo zypper in blas libblas3 lapack liblapack3 libboost umfpack\n\n# tools\nsudo zypper in gcc automake autoconf git doxygen\n\n# DUNE libraries\nsudo zypper ar \\\nhttp:\/\/download.opensuse.org\/repositories\/science\/openSUSE_12.2\/science.repo\nsudo zypper in dune-common dune-istl<\/pre>\n<h1>macOS<\/h1>\n<p>There are only some\u00a0binary packages available for macOS\u00a0for the prerequisites. The following steps should\u00a0\u00a0install all needed utilities and libraries. The steps have been tested on macOS 10.15 (Catalina).<\/p>\n<ul>\n<li>Install XCode, make sure that you can run <em>clang<\/em>\u00a0and <em>git<\/em> from the Terminal.<\/li>\n<li>Install Homebrew. You can\u00a0visit their <a href=\"http:\/\/brew.sh\">home page<\/a>\u00a0for simple (one-line) install instructions and information.<\/li>\n<li>Install various tools and libraries:<\/li>\n<\/ul>\n<pre><tt>brew install cmake pkg-config doxygen\n<\/tt><tt>brew install boost suite-sparse cjson\n<\/tt><\/pre>\n<ul>\n<li>Optional: install OpenMPI. For some reason this seems to install gcc, and therefore takes a long time. Can be skipped, but then you will not be able to build a parallel version of the OPM programs.<\/li>\n<\/ul>\n<pre>brew install open-mpi<\/pre>\n<ul>\n<li>Optional: install Zoltan (requires that you have installed MPI). The Zoltan library is used for partitioning the grid for load balancing in parallel runs. Without Zoltan, it is possible to run in parallel but the partitioning will be bad and the gain very limited. To install Zoltan, you must clone the Trilinos repository containing Zoltan and build it, which can be done with this script:<\/li>\n<\/ul>\n<pre>#!\/bin\/bash\n\n# Edit the next two variables to match your wishes and system.\ninstall_prefix=\"\/Users\/YOURUSERNAME\/duneinstall\"\nparallel_build_tasks=4\n\ngit clone https:\/\/github.com\/trilinos\/Trilinos.git\ngit checkout trilinos-release-12-8-1\nmkdir build\n(\n  cd build\n  cmake \\\n    -D CMAKE_INSTALL_PREFIX=$install_prefix \\\n    -D TPL_ENABLE_MPI:BOOL=ON \\\n    -D MPI_BASE_DIR:PATH=\/usr\/local \\\n    -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \\\n    -D Trilinos_ENABLE_Zoltan:BOOL=ON \\\n    ..\/\n  make -j $parallel_build_tasks\n)\n<\/pre>\n<ul>\n<li>Install Dune. This is documented on the <a href=\"https:\/\/www.dune-project.org\">Dune webpage<\/a>, but you can use\u00a0the following shell-script.\u00a0To run the script, copy it into a file (buildDune.bash for example) and run it with &#8220;<tt>bash buildDune.bash<\/tt>&#8220;. The lines are broken below, but selecting the text\u00a0and copying to a text editor should show the script in a readable way.<\/li>\n<\/ul>\n<pre>#!\/bin\/bash\n\n# Edit the next two variables to match your wishes and system.\ninstall_prefix=\"\/Users\/YOURUSERNAME\/duneinstall\"\nparallel_build_tasks=4\n\n# Set of modules to build\nmodules=\"dune-common dune-geometry dune-grid dune-istl\"\n\n# Clone modules, check out the 2.10 release.\nfor m in $modules; do\n    echo \"===================================================\"\n    echo \"=        Cloning module: $m\"\n    echo \"===================================================\"\n    (\n        if [ ! -d \"$m\" ]; then\n            git clone -b releases\/2.10 https:\/\/gitlab.dune-project.org\/core\/$m.git\n        else\n            echo \"******** Skipping $m, module already cloned.\"\n        fi\n    )\ndone\n\n# Build the modules, and install them to the chosen directory\nfor m in $modules; do\n    echo \"===================================================\"\n    echo \"=        Building module: $m\"\n    echo \"===================================================\"\n    (\n        cd $m\n        builddir=\"build-cmake\"\n        if [ ! -d \"$builddir\" ]; then\n            mkdir \"$builddir\"\n            cd \"$builddir\"\n            cmake -DCMAKE_INSTALL_PREFIX=$install_prefix \"..\"\n            make -j $parallel_build_tasks\n            make install\n        else\n            echo \"******** Skipping $m, build dir $builddir already exists.\"\n        fi\n    )\ndone\n<\/pre>\n<ul>\n<li>Note that unless you choose to install Dune to a standard location (not recommended since you may want to install and experiment with newer\u00a0versions while keeping the old one), you must tell cmake where to find Dune when building OPM! This is done by passing the option<br \/>\n<tt>-DCMAKE_PREFIX_PATH=\"\/Users\/foo\/bar\"<\/tt> to cmake <em>when you build OPM<\/em> (replacing \/Users\/foo\/bar with the location where you installed Dune). The same applies to Zoltan, if you need to specify two different paths you can do so with <tt>-DCMAKE_PREFIX_PATH=\"\/first\/dir;\/second\/dir\"<\/tt>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>OPM uses various third-party libraries and frameworks, these include: BLAS and LAPACK Boost (1.58 or later) SuiteSparse with UMFPACK The Dune core modules dune-common, dune-geometry, dune-grid and dune-istl. We currently support Dune 2.9, 2.10 and 2.11. \u00a0Dune can be installed from binary packages (see the &#8220;Ubuntu binary&#8221; section below) or from source (see the Dune &hellip; <a href=\"https:\/\/opm-project.org\/?page_id=239\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Prerequisites<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/pages\/239"}],"collection":[{"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/opm-project.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=239"}],"version-history":[{"count":51,"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/pages\/239\/revisions"}],"predecessor-version":[{"id":2070,"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/pages\/239\/revisions\/2070"}],"wp:attachment":[{"href":"https:\/\/opm-project.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}