Undefined symbols while builidng OpenFoam adapter

Yes, I’m still can’t build the adapter.

I’ ve installed/compiled on my system:

  • Fedora 34 (Linux version 5.14.17-201.fc34.x86_64)
  • OpenFOAM-v2106
  • gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1)
  • precice 2.3.0
  • cmake version 3.20.5

Yeah, I know that the ABI has happened quite a while ago. My comment was meant as a hint. It seems that during building the adapter it tries to use the old ABI. Would it be possible/an option to explicitly enforce the use of the new ABI in the adapter ( _GLIBCXX_USE_CXX11_ABI=1 or so?)?

I also agree that it does not seem that is a problem with the compiler versions at the moment. Maybe it is a wmake problem/feature? I have not used Fedora in a while an also do not have time to test myself at the moment so I do not know how the OpenFOAM build system behaves on Fedora.

Alternatively, one could try installing OpenFOAM and preCICE using Spack in a Spack envrionment or maybe use an Ubuntu VM to use the premade/compiled OpenFOAM and preCICE packages. Then, one could try compiling the adapter in that environment. However, this is also work and also quite some extra complexity if one does not use Spack already.

1 Like

The adapter uses the same compilation options as OpenFOAM, defined (on my system) in /usr/lib/openfoam/openfoam2106/wmake/rules/linux64Gcc.

@hgcastro you could try setting -std=c++11 somewhere in the Make/options, just in case.

1 Like

@ajaust and @Makis, I compiled the adapter with _GLIBCXX_USE_CXX11_ABI=1 by editing the OpenFOAM/OpenFOAM-v2106/wmake/rules/linux64Gcc/c++ file . Same message error, but different undefined symbols. I’m attaching the ldd.log and wmake.log files.

ldd.log (9.3 KB)
wmake.log (38.6 KB)

Now it seems to complain because OpenFOAM uses the old ABI?! Did you also try _GLIBCXX_USE_CXX11_ABI=0?

$ c++filt _ZN4Foam9UOPstream11writeQuotedERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb
Foam::UOPstream::writeQuoted(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)
$ c++filt _ZN4FoamlsERNS_7OstreamERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Foam::operator<<(Foam::Ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)

The whole behavior seems weird to me.

Edit: Ignore the suggestion to set _GLIBCXX_USE_CXX11_ABI=0. I guess this is our base case when it complains about the cxx11 symbols in preCICE.

1 Like