Error with building OF adapter for v1912

I installed precice using spack on an HPC platform and also OFv1912.
I also pulled the openfoam-adapter from the master branch and tried to build it using Allwmake. The build is with error since there are some undefined symbols. Please find attached the ldd.log file. The wmake.log file is error-free.

Let me know what the error could be.
Thanks
Arpan
ldd.log (102.3 KB)

Hi Arpan,

this might be caused by the install script mixing up compilers by accident. It looks like preCICE and boost have been compiled with a newer compiler than OpenFOAM is trying to use.

Could you also attach the wmake.log and Allwmake.log to have a look what is going on there? It would also nice if you could post the output of spack find before you start building the adapter. This way we can see what packages built by spack are in use.

Alex

1 Like

Hi Alex

Thanks for your prompt response. Yeah the compilers could be different since I installed OF through some compilers available in my platform and preCICE through Spack. Would you recommend installing OF using Spack packages?

Please find attached the three log files you requested. Hopefully there is an easier fix than re-building OF.

Allwmake.log (7.4 KB) ldd.log (102.3 KB) spack_find.log (1.1 KB) wmake.log (35.5 KB)

Hey,

you could try the following things:

  • The log files say that you compile with g++. You could try to check where the compiler is located using which g++ and what version it is by using g++ -v. Your spack seems to have compiled everything with GCC 8.3.0 so that is the version you should/want to see when using these commands. For me it looks something like that
> which g++
/usr/bin/g++
> g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
... (I removed some stuff here)
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
  • If the output indicates that you are not using GCC 8.3.0 you, you could try to load that compiler and then compile the adapter again.
  • I am not sure how you use spack, but it could maybe help to build the adapter making sure that the correct spack packages (especially compilers) are loaded via a spack environment or loading them manually. I am not completely sure though.
  • This might all fail because there is a chance that wmake always uses the same compiler that was used for compiling OpenFOAM. I am not an expert in this though.
  • You could also recompile preCICE with the compiler used for compiling OpenFOAM, but if that works depends also in the compiler version used.
  • If you have loaded GCC 8.3.0 and it does not work, I guess it would be safest to compile OpenFOAM with spack as well and to ensure that the same GCC and MPI is used for both packages.

Alex

Edit: Changed wording a bit to make my statements more clear.

1 Like

Hi Alex

Thanks for your help. I added the path to the gcc version (8.3.0) I used to build Spack and rebuilt OF with that. Now the adapter is built without any errors. Thanks again!
Looking forward to running some simulations with preCICE.

Regards
Arpan

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