File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,6 +198,9 @@ endif()
198198if (TARGET vrg-build-external-projects)
199199 add_dependencies (ttg-imported-packages-build vrg-build-external-projects )
200200endif ()
201+ # {PaRSEC,MADNESS} rely on usability of {BLAS,LAPACK}_LIBRARIES
202+ include (SanitizeLinalgLibraries )
203+ SanitizeLinalgLibraries ()
201204# PaRSEC
202205include (FindOrFetchPARSEC )
203206if (TARGET PaRSEC::parsec)
Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: BSD-3-Clause
2+
3+ # {BLAS,LAPACK}_LIBRARIES may include IMPORTED targets such as OpenMP::OpenMP_C
4+ # these targets are usually exist when these variables are "discovered", but they may not if they are already in CACHE
5+
6+ include (CMakeFindDependencyMacro )
7+ include (CheckLanguage )
8+
9+ function (SanitizeLinalgLibraries )
10+ if (BLAS_LIBRARIES OR LAPACK_LIBRARIES)
11+ # look for OpenMP
12+ foreach (lang IN ITEMS C CXX Fortran)
13+ if (BLAS_LIBRARIES MATCHES OpenMP::OpenMP_${lang} OR LAPACK_LIBRARIES MATCHES OpenMP::OpenMP_${lang} )
14+ check_language (${lang} )
15+ if (CMAKE_${lang} _COMPILER)
16+ enable_language (${lang} )
17+ find_dependency (OpenMP )
18+ else ()
19+ message (FATAL_ERROR "No support for LANGUAGE ${lang} but {BLAS,LAPACK}_LIBRARIES contains IMPORTED target OpenMP::OpenMP_${lang} that requires it" )
20+ endif ()
21+ endif ()
22+ endforeach ()
23+ endif ()
24+ endfunction ()
You can’t perform that action at this time.
0 commit comments