Installing OpenFOAM adapter for OpenFOAM v1912 on a cluster

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

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

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


it still gives me this:

Building the OpenFOAM-preCICE adapter…

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

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

Could you upload the Allwmake.log?

Allwmake.log (82 Bytes)

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

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 file?

Would appreciate y’ all’s help.

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:

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

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

I ran this and it gave me ‘1’

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

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?


A new release is out, it also fixes this issue:

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/
/opt/apps/gcc/6.3.0/bin/ld: cannot find -lprecice
make: *** [/home1/08321/mmr0230/OpenFOAM/mmr0230-v1912/platforms/linux64IccDPInt64Opt/lib/] 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 but still not sure what to do.

Would appreciate your help

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. In any case, we also have a (maybe not very straight-forward) page for linking to preCICE.

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:

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