From 051c3a04498f89483edc43b468ae25748a7032a4 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Wed, 21 Apr 2021 14:36:13 -0400
Subject: [PATCH] Find{BLAS,LAPACK}: Add test case covering BLA_STATIC with
 Intel MKL

---
 .gitlab/ci/configure_intelcompiler_common.cmake | 2 ++
 Tests/FindBLAS/Test/CMakeLists.txt              | 2 +-
 Tests/FindLAPACK/Test/CMakeLists.txt            | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.gitlab/ci/configure_intelcompiler_common.cmake b/.gitlab/ci/configure_intelcompiler_common.cmake
index be3d15b6d1..79f657be92 100644
--- a/.gitlab/ci/configure_intelcompiler_common.cmake
+++ b/.gitlab/ci/configure_intelcompiler_common.cmake
@@ -1,4 +1,6 @@
 set(CMake_TEST_FindBLAS "Intel10_64lp" CACHE STRING "")
+set(CMake_TEST_FindBLAS_STATIC "Intel10_64lp" CACHE STRING "")
 set(CMake_TEST_FindLAPACK "Intel10_64lp" CACHE STRING "")
+set(CMake_TEST_FindLAPACK_STATIC "Intel10_64lp" CACHE STRING "")
 
 include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/Tests/FindBLAS/Test/CMakeLists.txt b/Tests/FindBLAS/Test/CMakeLists.txt
index 1bebf8e99c..98e12d5947 100644
--- a/Tests/FindBLAS/Test/CMakeLists.txt
+++ b/Tests/FindBLAS/Test/CMakeLists.txt
@@ -13,7 +13,7 @@ target_link_libraries(test_var PRIVATE ${BLAS_LIBRARIES})
 add_test(NAME test_var COMMAND test_var)
 
 if(BLA_VENDOR STREQUAL "Intel10_64lp")
-  if(NOT BLAS_LIBRARIES MATCHES "^[^;]*mkl_intel_lp64")
+  if(NOT BLAS_LIBRARIES MATCHES "^(-Wl,--start-group;)?[^;]*mkl_intel_lp64")
     message(FATAL_ERROR "BLAS_LIBRARIES does not start in mkl_intel_lp64:\n ${BLAS_LIBRARIES}")
   endif()
 endif()
diff --git a/Tests/FindLAPACK/Test/CMakeLists.txt b/Tests/FindLAPACK/Test/CMakeLists.txt
index 67fb9bd6d0..bb334824bc 100644
--- a/Tests/FindLAPACK/Test/CMakeLists.txt
+++ b/Tests/FindLAPACK/Test/CMakeLists.txt
@@ -13,7 +13,7 @@ target_link_libraries(test_var PRIVATE ${LAPACK_LIBRARIES})
 add_test(NAME test_var COMMAND test_var)
 
 if(BLA_VENDOR STREQUAL "Intel10_64lp")
-  if(NOT LAPACK_LIBRARIES MATCHES "^[^;]*mkl_intel_lp64")
+  if(NOT LAPACK_LIBRARIES MATCHES "^(-Wl,--start-group;)?[^;]*mkl_intel_lp64")
     message(FATAL_ERROR "LAPACK_LIBRARIES does not start in mkl_intel_lp64:\n ${LAPACK_LIBRARIES}")
   endif()
 endif()
-- 
GitLab