Installation of PreCICE on HPC

I am trying to install preCICE on ETHZ linux cluster building the code from source, however, I am facing some errors.
Here are the steps I did:

  • Load the following required modules:
    - gcc/12.2.0
    - cmake/3.27.7
    - eigen/3.4.0
    - boost/1.83.0
    - libxml2
    - openmpi/4.1.6
    - petsc/3.20.1
    - python/3.11.6
  • Get the code from source with: “wget https://github.com/precice/precice/archive/v3.1.2.tar.gz
    tar -xzvf v3.1.2.tar.gz
    cd precice-3.1.2”
  • Set the production configuration preset with : “cmake --preset=production”
  • Building the code with: “make”

However, this gives me the following error:

/usr/bin/ld: /tmp/cc9t4IyU.ltrans109.ltrans.o: undefined reference to symbol 'omp_get_max_threads@@OMP_1.0'
/usr/bin/ld: /cluster/software/stacks/2024-06/spack/opt/spack/linux-ubuntu22.04-x86_64_v3/gcc-11.4.0/gcc-12.2.0-bj2twcnwcownogkldo6ndfylxx5sqpbn/lib64/libgomp.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/testprecice.dir/build.make:6611: testprecice] Error 1
make[1]: *** [CMakeFiles/Makefile2:276: CMakeFiles/testprecice.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

Also when running ctest the following tests fails:

        1 - precice.acceleration (Failed)
        2 - precice.action (Failed)
        3 - precice.com (Failed)
        4 - precice.cplscheme (Failed)
        5 - precice.io (Failed)
        6 - precice.m2n (Failed)
        7 - precice.mapping (Failed)
        8 - precice.mapping.petrbf (Failed)
        9 - precice.math (Failed)
       10 - precice.mesh (Failed)
       11 - precice.partition (Failed)
       12 - precice.interface (Failed)
       13 - precice.query (Failed)
       14 - precice.testing (Failed)
       15 - precice.time (Failed)
       16 - precice.utils (Failed)
       17 - precice.xml (Failed)
       18 - precice.integration.GeometricMultiscale (Failed)
       19 - precice.integration.Parallel (Failed)
       20 - precice.integration.QuasiNewton (Failed)
       21 - precice.integration.Serial (Failed)

Thank You for Your help!

Hi there,

The issue shows that the preCICE test executable fails to link as the linker cannot find the shared library of GNU OpenMP, leading to undefined symbols.
This is also the reason the tests fail, as the executable is missing.

The issue is tricky as preCICE 3.2.1 doesn’t use OpenMP without activating the Ginkgo mappings. So, this could be forwarded from another dependency. Maybe it is part of the PETSc pkg-config file.

The pragmatic solution to your issue is to ignore the tests executable. You wrote that you ran ctest and only the listed tests failed. Hence, the solverdummies successfully build and ran on your system.
So, you can use preCICE as is and even make install it if necessary.

You can disable the tests using cmake --preset=production -DBUILD_TESTING=OFF.

In case you really want to understand what went wrong, then I would recommend you to

  1. rebuild without link-time-optimization cmake --preset=production -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF which should make the error message more readable
  2. try rebuilding without PETSc cmake --preset=production -DPRECICE_FEATURE_PETSC_MAPPING=OFF which may forward some unwanted flags.

On a side-note:

It looks like your cluster is using spack to build the base packages. preCICE provides a spack package. You could ask your system admins if they would be willing to include preCICE in the base installation of the system. Then you can load preCICE like any other dependency, and you are ready to go.

Kind regards,
Frédéric

1 Like