hello,
I got a compilation error during the treatment of cpp/dolfinx/la/superlu_dist.cpp while I was compiling dolfinx@0.11. In my context, I use OpenMP. The extern "C" block is used in the code to include superlu_ddefs.h, superlu_sdefs.h and superlu_zdefs.h. All those headers include superlu_defs.h, which includes omp.h. The problem is that omp.h contains C++ stuff and thus can’t be inside an extern "C" block.
The following patch is a simple workaround:
This compiles, but I have not yet tested the runtime behaviour, as I am unsure whether to keep this OpenMP context. I don’t know if it is the cleanest way to treat this OpenMP context failure but if it helps …
Thanks for the report and the patch. I can’t reproduce this: with GCC 13/14 and LLVM OpenMP 22, omp.h compiles fine inside extern "C". Could you share:
The first compiler error, copied in full (the first ~20 lines of the failing superlu_dist.cpp compile, starting from the first error:).
Your compiler and version, the output of $CXX --version (or mpicxx --version).
Your OpenMP implementation (GCC’s libgomp, LLVM libomp, Intel, …) and how you turn OpenMP on, e.g. -fopenmp in CMAKE_CXX_FLAGS, or a Spack variant.
Your SuperLU_DIST version, how it was installed (Spack, PETSc --download-superlu_dist, conda, from source), and whether it was built with OpenMP or with GPU support (CUDA/HIP).
For now you could apply the patch yourself locally and sandbox spack, or downgrade to a gcc pre 15 until it is merged and patched onto the 0.11 release.