Openfoam-adapter linking problems OpenFOAM v2312

Hello,
I would like to link OpenFOAMv2312 (build from source) to solids4foam

My system:

I stuck to the Quickstart-Wiki apart from point 2. because OpenFOAMv2312 I compiled from source after removing FFTW from the ThirdParty-v2312 directory.

By compiling the openfoam-adapter-1.3.1, the following error appears:

=== 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.

OpenFOAM v2312 runs fine.
preCiCE dos not run:

cd tutorials/quickstart/fluid-openfoam && ./run.sh

leads to:

pimpleFoam: symbol lookup error: /home/mrt1/OpenFOAM/mrt1-v2312/platforms/linux64GccDPInt32Opt/lib/libpreciceAdapterFunctionObject.so: undefined symbol: _ZN7precice11ParticipantC1ENS_4spanIKcLm18446744073709551615EEES3_ii

Testing libprecice3_3.1.2_jammy.deb leads to the sam Error.

Allwmake.log (1.0 KB)
ldd.log (17.0 KB)
wmake.log (14.2 KB)

What could be the problem?
Best regards, Lucas

Hi @Lucas,

it looks like the adapter finds preCICE while building, but the system does not find preCICE while running: looking at the bottom of the ldd.log, there are multiple symbols related to preCICE that cannot be resolved.

However, looking closer, I also see the following line:

libprecice.so.2 => /usr/local/lib/libprecice.so.2 (0x00007ecf65e00000)

This means that you have two versions of preCICE installed:

  • v2 in /usr/local/ (probably you built that from source and did a sudo make install in the default prefix)
  • v3, from the Debian package.

and somehow your system prioritizes the one at /usr/local/.

I suggest the following:

  • Remove /usr/local/ from your PATH-related env variables, if you only added those for preCICE (check your ~/.bashrc)
  • Rebuild the adapter using ./Allclean before running ./Allwmake.

Hello @Makis , thank you very much for the quick help!
Indeed, just removing /usr/local/lib/libprecice.so.2 solved my problem.

1 Like

Still, you probably also want to remove all other related files, including the include headers (from /usr/local/include) and the pkg-config file (from /usr/local/lib).

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.