From 9d8fcb127b36bb0a5b5dc0e835dfe02ca14a14b5 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Mon, 13 May 2024 15:41:04 +0300 Subject: [PATCH] Fix AVX2 support detection. (#4969) [SC-47213](https://app.shortcut.com/tiledb-inc/story/47213) A typo in #4449 prevented AVX2 from being detected in GCC. This PR fixes the typo and adds logging to allow validating whether AVX2 was detected. Fixes #4967. --- TYPE: BUILD DESC: Fix AVX2 support detection. --- cmake/Modules/CheckAVX2Support.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/CheckAVX2Support.cmake b/cmake/Modules/CheckAVX2Support.cmake index b91fcf7acf4..2954b2f66da 100644 --- a/cmake/Modules/CheckAVX2Support.cmake +++ b/cmake/Modules/CheckAVX2Support.cmake @@ -53,7 +53,7 @@ function (CheckAVX2Support) endif() cmake_push_check_state() - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}") + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${COMPILER_AVX2_FLAG}") check_cxx_source_runs(" #include int main() { @@ -64,4 +64,9 @@ function (CheckAVX2Support) COMPILER_SUPPORTS_AVX2 ) cmake_pop_check_state() + if (COMPILER_SUPPORTS_AVX2) + message(STATUS "AVX2 support detected.") + else() + message(STATUS "AVX2 support not detected.") + endif() endfunction()