File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,7 +176,12 @@ elseif(USE_SW)
176176 ${SW_MATH} /libswblas.a
177177 gfortran)
178178else ()
179- if (ENABLE_MPI)
179+ # The DSP ScaLAPACK bundles BLAS objects built without OpenMP support.
180+ # The linker resolves BLAS symbols from the first library that provides
181+ # them, so the standalone BLAS must precede ScaLAPACK on the link line;
182+ # otherwise the bundled non-OpenMP BLAS wins and OpenBLAS aborts with
183+ # "Detect OpenMP Loop" once ABACUS calls it from an OpenMP region.
184+ if (ENABLE_MPI AND NOT USE_DSP)
180185 list (APPEND _abacus_linalg_libs ScaLAPACK::ScaLAPACK)
181186 endif ()
182187 if (ENABLE_OPENMP)
@@ -186,6 +191,9 @@ else()
186191 FFTW3::FFTW3
187192 LAPACK::LAPACK
188193 BLAS::BLAS)
194+ if (ENABLE_MPI AND USE_DSP)
195+ list (APPEND _abacus_linalg_libs ScaLAPACK::ScaLAPACK)
196+ endif ()
189197 list (APPEND _abacus_linalg_include_dirs ${FFTW3_INCLUDE_DIRS} )
190198 if (ENABLE_FLOAT_FFTW)
191199 list (APPEND _abacus_linalg_libs FFTW3::FFTW3_FLOAT)
You can’t perform that action at this time.
0 commit comments