Skip to content

Building

Makis Chourdakis edited this page May 2, 2018 · 26 revisions

To build the adapter, you need to install a few dependencies and then execute the Allwmake script.

  1. Download the adapter or (better) install git and clone this repository: git clone https://github.com/precice/openfoam-adapter.git.
  2. Install the latest yaml-cpp headers and shared library, preferably from your Linux distribution's repository. (at least yaml-cpp 0.5.x)
    • If you use Boost >= 1.67, you also need yaml-cpp >= 0.6 (read more here).
    • If you are using Ubuntu (and Boost < 1.67), 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.
  3. Install the preCICE headers and library, following its building instructions.
    • If you want to use preCICE as a static library, check and adjust its dependencies in Allwmake (ADAPTER_PRECICE_DEP).
  4. Install an OpenFOAM distribution. Read more in Notes on OpenFOAM.
  5. Execute the build script: ./Allwmake.
    • See and adjust the configuration in the beginning of the script first, if needed.
    • 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.

Note: If any dependencies are not installed in the standard system paths, the locations of their headers need to be specified in the CPLUS_INCLUDE_PATH and of their libraries in the LIBRARY_PATH or LD_LIBRARY_PATH.

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.

Next: configure and load the adapter or run a tutorial.