OpenFOAM adaptor compile error

  • OpenFOAM ver: 2106 (64bits-floating)
  • preCICE version: 2.5.0
  • Operating system or platform: Centos 8
  • Installation method: Spack
  • Dependency versions (gcc-10.2.1, Boost-1.82.0, PETSc-3.19.1, MPI-4.1.5)

./Allwmake gives the following linking errors:

undefined symbol: _ZN4Foam9UOPstream11writeQuotedERKSsb|(/scratcha-fdgs/lux/OpenFOAM/lux-v2106/platforms/linux64GccDPInt32Opt/lib/libpreciceAdapterFunctionObject.so)
undefined symbol: _ZN4FoamlsERNS_7OstreamERKSs|(/scratcha-fdgs/lux/OpenFOAM/lux-v2106/platforms/linux64GccDPInt32Opt/lib/libpreciceAdapterFunctionObject.so)

Allwmake.log (6.3 KB)
ldd.log (11.7 KB)
wmake.log (46 Bytes)

log files are uploaded as attachments.

The compilation passed on another workstation which runs same OpenFOAM version in 64 bits.

Good to know! Aren’t both machines 64bit?

When I see undefined OpenFOAM symbols, it typically means that something in the OpenFOAM installation is incomplete, which typically happens when building OpenFOAM itself from source.

both are runing 64 bits OpenFOAM.

the undefined symbols seem to come from the communication classes. I recall different versions of OpenMPI are used to compile OpenFOAM and the adapter. Could this be the reason?

Not sure, but you should use:

  • the same dependencies for the adapter as you used for OpenFOAM, as OpenFOAM links to the adapter as a shared library, and
  • the same MPI for preCICE as you used for OpenFOAM, as preCICE will use the MPI communicators set up by OpenFOAM.

Thanks for attention. Problems solved after recompiling OpenFOAM.

1 Like

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