Skip to content

Building

Makis Chourdakis edited this page Nov 26, 2017 · 26 revisions

To build the adapter, you need to install a few dependencies and then execute the Allwmake script. See and adjust the configuration in the beginning of the script, if needed (particularly the location of yaml-cpp). System paths such as LD_LIBRARY_PATH, LIBRARY_PATH or CPLUS_INCLUDE_PATH are currently not searched.

  1. Download the adapter or (better) install git and clone this repository: git clone https://github.com/precice/openfoam-adapter.git.
  2. Install the yaml-cpp headers and shared library, preferably from your Linux distribution's repository.
    • If you are using Ubuntu, you are looking for the package libyaml-cpp-dev.
    • If you want to build yaml-cpp from source, you need to build it as a shared library.
    • In both cases, you need to set its paths in Allwmake.
  3. Install the preCICE headers and library, following its building instructions.
    • If you want to use preCICE as a static library, remember to setup its dependencies and their paths in Allwmake. You need to set the path to Boost and PETSc (if needed) and uncomment the ADAPTER_PRECICE_DEP="..." line.
  4. Install an OpenFOAM distribution. OpenFOAM 5 is known to be compatible (TODO: read below for more).
  5. Adjust and then execute the build script: ./Allwmake.
    • If everything goes well, you will receive a success message.
    • If you receive a message that there were undefined symbols, this probably means that you used preCICE as a static library, but you didn't specify its dependencies correctly.

The -DADAPTER_DEBUG_MODE flag inside ADAPTER_PREP_FLAGS activates additional debug messages. You may also change the target directory or specify the number of threads to use for the compilation. See the comments in Allwmake for more.

In order to upgrade the adapter, or before you build for another OpenFOAM version, run ./Allclean first. Get the latest version using git pull.