cuDSS in a Fortran MPI program leading to segfault

I think you are right! It seems to work on 1 thread 1 MPI. I am now trying to integrate the shared library for the threading and MPI backends in the CMake build, the problem I am facing now is that the provided script is giving me some errors on some math functions

➜  src git:(anotinv) module load nvhpc/25.5
➜  src git:(anotinv) echo $NVHPC_ROOT
/opt/nvidia/hpc_sdk/Linux_x86_64/25.5
➜  src git:(anotinv) ls $NVHPC_ROOT                                                         
cmake  comm_libs  compilers  cuda  examples  math_libs  profilers  REDIST
➜  src git:(anotinv) find -L $NVHPC_ROOT -name "omp.h"
/opt/nvidia/hpc_sdk/Linux_x86_64/25.5/compilers/include/omp.h
➜  src git:(anotinv) CUDA_PATH=${NVHPC_ROOT}/cuda OPENMP_PATH=${NVHPC_ROOT}/compilers ./cudss_build_mtlayer.sh gomp
Building communication layer with gomp backend
nvcc warning : Support for offline compilation for architectures prior to '<compute/sm/lto>_75' will be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/include/x86_64-linux-gnu/bits/mathcalls.h(79): error: exception specification is incompatible with that of previous function "cospi" (declared at line 2601 of /opt/nvidia/hpc_sdk/Linux_x86_64/25.5/cuda/include/crt/math_functions.h)
   extern double cospi (double __x) noexcept (true); extern double __cospi (double __x) noexcept (true);
                                    ^

/usr/include/x86_64-linux-gnu/bits/mathcalls.h(81): error: exception specification is incompatible with that of previous function "sinpi" (declared at line 2556 of /opt/nvidia/hpc_sdk/Linux_x86_64/25.5/cuda/include/crt/math_functions.h)
   extern double sinpi (double __x) noexcept (true); extern double __sinpi (double __x) noexcept (true);
                                    ^

/usr/include/x86_64-linux-gnu/bits/mathcalls.h(79): error: exception specification is incompatible with that of previous function "cospif" (declared at line 2623 of /opt/nvidia/hpc_sdk/Linux_x86_64/25.5/cuda/include/crt/math_functions.h)
   extern float cospif (float __x) noexcept (true); extern float __cospif (float __x) noexcept (true);
                                   ^

/usr/include/x86_64-linux-gnu/bits/mathcalls.h(81): error: exception specification is incompatible with that of previous function "sinpif" (declared at line 2579 of /opt/nvidia/hpc_sdk/Linux_x86_64/25.5/cuda/include/crt/math_functions.h)
   extern float sinpif (float __x) noexcept (true); extern float __sinpif (float __x) noexcept (true);
                                   ^

4 errors detected in the compilation of "cudss_mtlayer_omp.cu".
ls: cannot access 'libcudss_mtlayer_gomp.so': No such file or directory
➜  src git:(anotinv) 

Edit: to add a bit more context, the line referenced in the errors in mathcalls.h are the following (the ones with cospi and sinpi):

#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C23)
/* Arc cosine of X, divided by pi.  */
__MATHCALL (acospi,, (_Mdouble_ __x));
/* Arc sine of X, divided by pi.  */
__MATHCALL (asinpi,, (_Mdouble_ __x));
/* Arc tangent of X, divided by pi.  */
__MATHCALL (atanpi,, (_Mdouble_ __x));
/* Arc tangent of Y/X, divided by pi.  */
__MATHCALL (atan2pi,, (_Mdouble_ __y, _Mdouble_ __x));

/* Cosine of pi * X.  */
__MATHCALL_VEC (cospi,, (_Mdouble_ __x));
/* Sine of pi * X.  */
__MATHCALL_VEC (sinpi,, (_Mdouble_ __x));
/* Tangent of pi * X.  */
__MATHCALL_VEC (tanpi,, (_Mdouble_ __x));
#endif

I am on Ubuntu 25.04

Edit 2; apparently it’s a known bug: "error: exception specification is incompatible" for cospi/sinpi/cospif/sinpif with glibc-2.41 - #3 by stefantalpalaru