Quick Installation

From opm
Jump to: navigation, search

This page contains a quick guide to installing the core module in the OPM simualtion suite.

DOWNLOADING


For a read-only download: git clone git://github.com/OPM/opm-core.git

If you want to contribute, fork OPM/opm-core on github.


BUILDING


There are two ways to build the opm-core library.

1. As a stand-alone library. In this setup we recommend creating an entirely separate directory outside the directory containing the source code and doing the build from that separate directory (termed "the build directory"). This configuration is sometimes referred to as an "out-of-source build".

As an example, consider the following layout in which "opm-core" refers to the directory containing the package source code as downloaded from GitHub

  workspace
     |
     +-- build
     |
     +-- opm-core
     |     |
     |     +-- ...
     |     |
     |     +-- opm
     |     |
     |     +-- ...

We will configure a release-type (optimised) build using traditional Unix Makefiles within the "build" directory. The following command configures the build

   cd path/to/build
   cmake ../opm-core -DCMAKE_BUILD_TYPE=Release

If you want to debug the library you should specify the build type "Debug" instead of "Release" in the command above. This will disable optimizations and make it easier to step through the code.

Building the software then amounts to typing

   make

in the top-level "build" directory; i.e., the directory from which we invoked the "cmake" utility. On a multi-core computer system you may want to build the software in parallel (make(1)'s "job-server" mode) in order to reduce the total amount of time needed to complete the build. To do so, replace the above "make" command with

   make -j N

or, possibly,

   nice -20 make -j N

in which "N" is an integer that should typically not exceed the number of cores in the system.

n which "N" is an integer that should typically not exceed the number of cores in the system.

Once the library has been built, it can be installed in a central, system-wide location (often in "/usr/local") through the command

   sudo make install


2. As a dune module.

- Put the opm-core directory in the same directory
  as the other dune modules to be built (e.g. dune-commmon,
  dune-grid). Note that for Ubuntu you can install Dune
  from the ppa as outlined above.
- Run dunecontrol as normal. For more information on
  the dune build system, see
  http://www.dune-project.org/doc/installation-notes.html

DOCUMENTATION


Efforts have been made to document the code with Doxygen. In order to build the documentation, enter the command

make doc

in the topmost directory.


REPORTING ISSUES


Issues can be reported in the Git issue tracker online at:

   http://github.com/OPM/opm-core/issues

To help diagnose build errors, please provide a link to a build log together with the issue description.

You can capture such a log from the build using the `script' utility, e.g.:

   LOGFILE=$(date +%Y%m%d-%H%M-)build.log ;

cmake -E cmake_echo_color --cyan --bold "Log file: $LOGFILE" ;

   script -q $LOGFILE -c 'cmake ../opm-core -DCMAKE_BUILD_TYPE=Debug' &&
   script -q $LOGFILE -a -c 'ionice nice make -j 4 -l 3' ||
   cat CMakeCache.txt CMakeFiles/CMake*.log >> $LOGFILE

The resulting file can be uploaded to for instance gist.github.com.