Skip to content

add explicit link to OpenMP for runs with DART in CUPyDO

Boman Romain requested to merge boman into master

When the newest version of MKL (OneAPI) is used in the fluid solver (e.g. DART) of a CUPyDO run, the current version of NativeSolid is not able to find OpenMP which is required by OpenBLAS and Lapacke. Indeed, (GNU) OpenMP is not explicitly linked to NativeSolid during the build.

/usr/bin/python3.10: symbol lookup error: /opt/intel/oneapi/mkl/2022.1.0/lib/intel64/libmkl_intel_thread.so.2: undefined symbol: omp_in_parallel

In this PR, I have added an explicit link to OpenMP during the link phase of the build of NativeSolid. I have also added the classical --no-as-needed flag to explicitly force this link (The --no-as-needed flag exists to force the linker to link in libraries, including shared libraries, even if the linker thinks the library is not needed).

Thanks to this small fix, DART and NativeSolid can work together in the frame of CUPyDO on a machine using OneAPI for DART (this is the case of my desktop PC).

I have checked that this modification still provides a working executable when older MKL libraries are used (on gaston and vaillant).

Merge request reports

Loading