# Installing OpenFOAM adapter for OpenFOAM v1912 on a cluster

**URL:** <https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896>\
**Category:** Official adapters and tutorials\
**Tags:** openfoam\
**Created:** [January 19, 2022, 4:18pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896 "2022-01-19T16:18:29Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [January 19, 2022, 4:18pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/1 "2022-01-19T16:18:29Z")

</div>

Hello  
I have openFOAM v1912 and am trying to install the openfoam-adapter\_v1.0.0\_OpenFOAM4\_5\_v1806 because I did not find one for v1912 but I get the exact same Allwmake.log  
I am able to run cases in openFOAM so not sure why I am still getting this error.  
Does this have something to do with the compiler or the first section of the Allwmake file that may require change?

Would appreciate your help

---

<div class="post-metadata">

**Author:** ![DavidSCN](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@DavidSCN](https://precice.discourse.group/u/DavidSCN)\
**Post date:** [January 20, 2022, 8:56pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/2 "2022-01-20T20:56:16Z")

</div>

Hi @mishal49 ,

that’s indeed not the correct adapter version for your OpenFOAM version. You can find all adapter versions here [Releases · precice/openfoam-adapter · GitHub](https://github.com/precice/openfoam-adapter/releases). The version on the bottom is the one you are looking for. Note that the dash `-`includes also all versions in between the mentioned one, meaning that the last adapter version is for all OpenFOAM versions starting from v1812 up to 2106

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [January 21, 2022, 2:11pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/3 "2022-01-21T14:11:20Z")

</div>

Hello @DavidSCN  
I did the folllowing:

> Downloaded openfoam-adapter\_v1.0.0\_OpenFOAMv1812-v2106.tar.gz
> 
> tar -xzf openfoam-adapter\_v1.0.0\_OpenFOAMv1812-v2106.tar.gz
> 
> cd openfoam-adapter\_v1.0.0\_OpenFOAMv1812-v2012/
> 
> v1912 //to activate my OpenFOAM
> 
> ./Allwmake

it still gives me this:

> Building the OpenFOAM-preCICE adapter…

---

<div class="post-metadata">

**Author:** ![DavidSCN](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@DavidSCN](https://precice.discourse.group/u/DavidSCN)\
**Post date:** [January 21, 2022, 11:36pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/4 "2022-01-21T23:36:02Z")

</div>

@mishal49 may I ask you to provide your `wmake.log` file and your `ldd.log` file, which are generated when executing the `Allwmake` script?

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [January 22, 2022, 12:01am UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/5 "2022-01-22T00:01:36Z")

</div>

@DavidSCN, It does not generate any of those files. Just an Allwmake.log

 ![image](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/9/93969bd403ce194ea289aefc37cb9a1d2f0f6c5a.png)

---

<div class="post-metadata">

**Author:** ![DavidSCN](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@DavidSCN](https://precice.discourse.group/u/DavidSCN)\
**Post date:** [January 22, 2022, 9:01am UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/6 "2022-01-22T09:01:11Z")

</div>

Could you upload the `Allwmake.log`?

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [January 22, 2022, 1:40pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/7 "2022-01-22T13:40:21Z")

</div>

[Allwmake.log](https://precice.discourse.group/uploads/short-url/xbjDzMvMrROnUKf8tUKW3PUbztk.log) (82 Bytes)

---

<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:** [February 1, 2022, 10:33pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/8 "2022-02-01T22:33:22Z")

</div>

@mishal49 this output looks very strange and unexpected. I don’t understand:

- why it prints this line two times
- why it does not print any of the next lines (they are just `echo` commands).

Since I see you are running on a remote system, I suspect that something went wrong there temporarily. Did you manage to resolve it?

Please open a new thread for every new question / topic.

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [February 7, 2022, 4:39pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/9 "2022-02-07T16:39:12Z")

</div>

Hello @Makis  
I was able to solve this issue; got some technical support to help. I would share the solution however, I am not sure how they solved the problem; still following up.  
To test the installations, I tried running the perpendicular plate simulation. The Calculix side worked just fine and was waiting for coupling but the fluid side just ran like a regular OpenFOAM simulation.  
Does this still entail an issue with the OpenFOAM adapter? the installation? Or do I have to change something in the run.sh file?

Would appreciate y’ all’s help.

---

<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:** [February 7, 2022, 7:28pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/10 "2022-02-07T19:28:28Z")

</div>

Hi @mishal49,

the same issue just now appeared on me and it is actually fixed on develop (adapter v1.1.0 coming up tomorrow/this week).

What happens if you run the following:

```bash
pkg-config --silence-errors --cflags libprecice
echo $?

```

This will apparently happen when pkg-config does not know about preCICE.

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [February 7, 2022, 11:02pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/11 "2022-02-07T23:02:26Z")

</div>

> [@Makis](#):
>
> ```
> pkg-config --silence-errors --cflags libprecice
> echo $?
> 
> ```

Hello  
I ran this and it gave me ‘1’

---

<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:** [February 8, 2022, 12:56pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/12 "2022-02-08T12:56:58Z")

</div>

Then this means that the `pkg-config` command failed. This is exactly the error I had in mind and the fix is coming.

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [February 8, 2022, 4:13pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/13 "2022-02-08T16:13:16Z")

</div>

Hello @Makis  
So is there anything that can be done on my side to solve the issue/help? By when do you think a fix will be found?

Thanks

---

<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:** [February 8, 2022, 10:38pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/14 "2022-02-08T22:38:52Z")

</div>

A new release is out, it also fixes this issue: [https://github.com/precice/openfoam-adapter/releases/tag/v1.1.0](https://github.com/precice/openfoam-adapter/releases/tag/v1.1.0)

---

<div class="post-metadata">

**Author:** ![mishal49](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mishal49](https://precice.discourse.group/u/mishal49)\
**Post date:** [February 11, 2022, 5:56pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/15 "2022-02-11T17:56:45Z")

</div>

Thank you @Makis  
I used the new version to carry out my installation however I first got the following error:

> Interface.H(8): catastrophic error: cannot open source file “precice/SolverInterface.hpp”  
> #include “precice/SolverInterface.hpp”  
> ^  
> compilation aborted for Interface.C (code 4)  
> make: \*\*\* [Make/linux64IccDPInt32Opt/Interface.o] Error 4

I then changed this to the relevant path:

> #include “…/precice-2.3.0-src/src/precice/SolverInterface.hpp”

Then it gave me a similar error for Adapter.H so I changed that path too however, it then gave me the following error:

> Building with WMake (see the wmake.log log file)…\n  
> Compiling enabled on 4 cores  
> wmake libso (openfoam-adapter\_v1.1.0\_OpenFOAMv1812-v2112-newer)  
> icpc -std=c++11 -fp-trap=common -fp-model precise -DOPENFOAM=1912 -DWM\_DP -DWM\_LABEL\_SIZE=64 -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-unknown-pragmas -diag-disable 327,654,1125,1292,2289,2304,11062,11074,11076 -O3 -DNoRepository -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/finiteVolume/lnInclude -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/meshTools/lnInclude -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/transportModels/ -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/transportModels/incompressible/lnInclude -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/transportModels/compressible/lnInclude -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/transportModels/twoPhaseMixture/lnInclude -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/transportModels/interfaceProperties/lnInclude -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/thermophysicalModels/basic/lnInclude -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/TurbulenceModels/turbulenceModels/lnInclude -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/TurbulenceModels/compressible/lnInclude -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/TurbulenceModels/incompressible/lnInclude -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/triSurface/lnInclude -I…/ -IlnInclude -I. -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude -I/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/src/OSspecific/POSIX/lnInclude -fPIC -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64IccDPInt64Opt/Utilities.o Make/linux64IccDPInt64Opt/Interface.o Make/linux64IccDPInt64Opt/CouplingDataUser.o Make/linux64IccDPInt64Opt/CHT/Temperature.o Make/linux64IccDPInt64Opt/CHT/KappaEffective.o Make/linux64IccDPInt64Opt/CHT/HeatFlux.o Make/linux64IccDPInt64Opt/CHT/HeatTransferCoefficient.o Make/linux64IccDPInt64Opt/CHT/SinkTemperature.o Make/linux64IccDPInt64Opt/CHT/CHT.o Make/linux64IccDPInt64Opt/FSI/FSI.o Make/linux64IccDPInt64Opt/FSI/ForceBase.o Make/linux64IccDPInt64Opt/FSI/Force.o Make/linux64IccDPInt64Opt/FSI/Stress.o Make/linux64IccDPInt64Opt/FSI/Displacement.o Make/linux64IccDPInt64Opt/FSI/DisplacementDelta.o Make/linux64IccDPInt64Opt/FF/FF.o Make/linux64IccDPInt64Opt/FF/Velocity.o Make/linux64IccDPInt64Opt/FF/VelocityGradient.o Make/linux64IccDPInt64Opt/FF/Pressure.o Make/linux64IccDPInt64Opt/FF/PressureGradient.o Make/linux64IccDPInt64Opt/Adapter.o Make/linux64IccDPInt64Opt/preciceAdapterFunctionObject.o -L/home1/08321/mmr0230/OpenFOAM/OpenFOAM-v1912/platforms/linux64IccDPInt64Opt/lib   
> -lfiniteVolume -lmeshTools -lcompressibleTurbulenceModels -lincompressibleTurbulenceModels -limmiscibleIncompressibleTwoPhaseMixture -lprecice -o /home1/08321/mmr0230/OpenFOAM/mmr0230-v1912/platforms/linux64IccDPInt64Opt/lib/libpreciceAdapterFunctionObject.so  
> /opt/apps/gcc/6.3.0/bin/ld: cannot find -lprecice  
> make: \*\*\* [/home1/08321/mmr0230/OpenFOAM/mmr0230-v1912/platforms/linux64IccDPInt64Opt/lib/libpreciceAdapterFunctionObject.so] Error 1  
> Everything looks fine in wmake.log.

I saw this post [Cannot find -lprecice and precice/SolverInterface.hpp - Installing preCICE - preCICE Forum on Discourse](https://precice.discourse.group/t/cannot-find-lprecice-and-precice-solverinterface-hpp/384) but still not sure what to do.

Would appreciate your help

---

<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:** [February 13, 2022, 1:24pm UTC](https://precice.discourse.group/t/installing-openfoam-adapter-for-openfoam-v1912-on-a-cluster/896/16 "2022-02-13T13:24:40Z")

</div>

As far as I understand, you built preCICE from source manually, in some user directory and you did not afterwards install it to a system-known prefix (if you even configured any, which would have also configured pkg-config). This is the main reason everything else is difficult (not only with preCICE, but with any library that you build like this). Instead of building preCICE from source manually, you could use [let Spack built preCICE for you](https://precice.org/installation-spack.html). In any case, we also have a (maybe not very straight-forward) page for [linking to preCICE](https://precice.org/installation-linking.html).

If you don’t want to change anything related to you preCICE installation, you could do what I do, as I also build preCICE from source manually and don’t install it anywhere (to be able to easily switch between releases and development branches). In your `~/.bashrc`, add something like:

```bash
export LD_LIBRARY_PATH="/path/to/precice/build:$LD_LIBRARY_PATH"
export LIBRARY_PATH="/path/to/precice/build:$LIBRARY_PATH"
export C_INCLUDE_PATH="/path/to/precice/:$INCLUDE_PATH"
export CPLUS_INCLUDE_PATH="/path/to/precice/:$CPLUS_INCLUDE_PATH"
export CPATH="/path/to/precice/src/:/home/makish/github/precice/extras/bindings/c/include/:$CPATH"
export precice_DIR="/path/to/precice/build/"

```

this should cover most (if not all) cases. But again, **as a user, you are not supposed to do this** , but to use more proper methods, such as a package manager (APT on Ubuntu with admin rights, Spack on most other cases).
