Openfoam-adapter failed to compile with intel compiler

Hi, everyone.

I compile openfoam-v2112 with intel compile, and openfoam-adapter as well. openfoam is compiled successfully, but I got some error when compiling the openfoam-adater.

Building the OpenFOAM-preCICE adapter...

If not already known by the system, preCICE may be located using:
pkg-config --cflags libprecice  = -I/home/tfblab/precice-2.3.0/work/include
pkg-config --libs libprecice    = -L/home/tfblab/precice-2.3.0/work/lib -lprecice

Current OpenFOAM environment:
WM_PROJECT = OpenFOAM
WM_PROJECT_VERSION = v2112

The adapter will be built into /home/tfblab/OpenFOAM/tfblab-v2112/platforms/linux64IccDPInt32Opt/lib
Additional preprocessor/compiler options: 

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

Compiling enabled on 4 cores
wmake libso (openfoam-adapter_v1.1.0_OpenFOAMv1812-v2112-newer)
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 ADAPTER_PKG_CONFIG_LIBS above.
See wmake.log and ldd.log for more details.

the compiled logs wmake.log and ldd.log are attached.

ldd.log (9.6 KB)
wmake.log (93 Bytes)
It seems that the symbol of libprecice.so and other symbol of openfoam can’t be found. But I have compile the deal.ii-adapter successfully. I think the precise is compiled right.

Could anyone help me out?

Best
Chen

The intel compile is the intel oneAPI with the version of 2022.1.1.119.

Hi @hkchm,

I don’t have any quick fix on top of my head, but what is happening here, is that the system cannot link the OpenFOAM adapter to preCICE (only) at runtime. When you run wmake for the adapter, in the end it calls ldd <adapter>.so, which reports these errors.

The deal.II adapter uses CMake, which usually takes care of such issues in a much better way.

Try setting in your ~/.bashrc (or equivalent):

export LD_LIBRARY_PATH="/home/tfblab/precice-2.3.0/work/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="/home/tfblab/precice-2.3.0/work/lib/pkgconfig:$PKG_CONFIG_PATH"

See also the page Linking to preCICE | preCICE - The Coupling Library

Note that preCICE v2.4.0 makes using preCICE from a local from-source build even easier: Highlights of the new preCICE release v2.4