Undefined symbols when building openfoam-adapter in Debian WSL

Hi there,

Recently I have tried to install precice, openfoam, and the openfoam-adapter in a debian subsystem on my windows 10 laptop. Following the quick guide worked up to the point where I want to run the ./Allwmake command in the openfoam-adapter directory.

When trying to build the adapter, it first shows an error saying:

Building the OpenFOAM-preCICE adapter...

If not already known by the system, preCICE may be located using:
  pkg-config --cflags libprecice  =
  pkg-config --libs libprecice    = -lprecice

Current OpenFOAM environment:
  WM_PROJECT =
  WM_PROJECT_VERSION =
  WM_NCOMPPROCS = 1 (number of threads for parallel builds)

=== ERROR: It looks like no OpenFOAM environment is available. ===
Possible reasons:
- Have you loaded the OpenFOAM etc/bashrc file?
- Are you using a compatible OpenFOAM version?
  See https://www.precice.org/adapter-openfoam-support.html

I then try to load the bashrc file with source /lib/openfoam/openfoam2306/etc/bashrc, which then changes my ./Allwmake output to:

Building the OpenFOAM-preCICE adapter...

If not already known by the system, preCICE may be located using:
  pkg-config --cflags libprecice  =
  pkg-config --libs libprecice    = -lprecice

Current OpenFOAM environment:
  WM_PROJECT = OpenFOAM
  WM_PROJECT_VERSION = v2306
  WM_NCOMPPROCS = 1 (number of threads for parallel builds)

The adapter will be built into /home/falco/OpenFOAM/falco-v2306/platforms/linux64GccDPInt32Opt/lib
Additional preprocessor/compiler options:

Building with WMake (see the wmake.log log file)...

wmake libso (openfoam-adapter)
Everything looks fine in wmake.log.
=== ERROR: Building completed with linking problems: there were undefined symbols. ===
Possible causes:
- Is preCICE discoverable at runtime? Check the content of pkg-config output above.
- Did anything go wrong while installing preCICE? Can you run any other preCICE tutorials?
- Did anything go wrong while installing OpenFOAM? Can you run any other OpenFOAM tutorials?
See wmake.log and ldd.log for more details.
Attach your Allwmake.log, wmake.log, and ldd.log when asking for help.

I have added my Allwmake.log and ldd.log files from this last run to this post.
Allwmake.log (6.6 KB)
ldd.log (15.9 KB)

Welcome, @FRMeulen!

How did you install preCICE? Our “Debian” packages are specific to each supported distribution, all of which are currently Ubuntu versions. They link to specific versions of dependencies, which may not be the same versions available on your Debian system. Sorry for the terminology, but Ubuntu also uses the same format and also calls them Debian packages.

The best solution for you would be to:

  1. Install the dependencies from APT, if they are not already installed: Building from source - Dependencies | preCICE - The Coupling Library
  2. Build preCICE from source with the generation of Debian packages enabled: Building from source - Advanced | preCICE - The Coupling Library
  3. Install the generated packages (sudo apt install ./libprecice2<blah>.deb)

Don’t forget to first uninstall your current package before installing the new one: sudo apt remove libprecice2.