# Openfoam-adapter failed to compile with intel compiler

**URL:** <https://precice.discourse.group/t/openfoam-adapter-failed-to-compile-with-intel-compiler/1044>\
**Category:** Official adapters and tutorials\
**Tags:** openfoam, adapters, configuration\
**Created:** [May 13, 2022, 2:53am UTC](https://precice.discourse.group/t/openfoam-adapter-failed-to-compile-with-intel-compiler/1044 "2022-05-13T02:53:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hkchm](https://avatars.discourse-cdn.com/v4/letter/h/7cd45c/32.png) [@hkchm](https://precice.discourse.group/u/hkchm)\
**Post date:** [May 13, 2022, 2:53am UTC](https://precice.discourse.group/t/openfoam-adapter-failed-to-compile-with-intel-compiler/1044/1 "2022-05-13T02:53:47Z")

</div>

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.

```nohighlight
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](https://precice.discourse.group/uploads/short-url/tcRZcfxBkb9gXtR2MpY5AdhXPpJ.log) (9.6 KB)  
[wmake.log](https://precice.discourse.group/uploads/short-url/qdPO71uX1qmJlim4fYhYDaoWejO.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

---

<div class="post-metadata">

**Author:** ![hkchm](https://avatars.discourse-cdn.com/v4/letter/h/7cd45c/32.png) [@hkchm](https://precice.discourse.group/u/hkchm)\
**Post date:** [May 13, 2022, 3:00am UTC](https://precice.discourse.group/t/openfoam-adapter-failed-to-compile-with-intel-compiler/1044/2 "2022-05-13T03:00:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [May 22, 2022, 9:21am UTC](https://precice.discourse.group/t/openfoam-adapter-failed-to-compile-with-intel-compiler/1044/3 "2022-05-22T09:21:30Z")

</div>

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):

```bash
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](https://precice.org/installation-linking.html#make-and-scripts-in-general)

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](https://precice.discourse.group/t/highlights-of-the-new-precice-release-v2-4/1047)
