From c63c2e729d2cfc9a482828e3fa59132a40377852 Mon Sep 17 00:00:00 2001 From: Jelmer Date: Thu, 2 Dec 2021 11:24:06 +0000 Subject: [PATCH] Fix AVX2 detection on macOS Fix for https://github.com/marian-nmt/marian-dev/issues/880 but currently I'm especially interested in it from a TranslateLocally point of view. --- cmake/FindSSE.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmake/FindSSE.cmake b/cmake/FindSSE.cmake index 82ee7f3e0..31c4681d3 100644 --- a/cmake/FindSSE.cmake +++ b/cmake/FindSSE.cmake @@ -74,9 +74,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") ENDIF (AVX512_TRUE) ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin") - EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE - CPUINFO) - + EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.features machdep.cpu.leaf7_features" OUTPUT_VARIABLE CPUINFO) STRING(REGEX REPLACE "^.*[^S](SSE2).*$" "\\1" SSE_THERE ${CPUINFO}) STRING(COMPARE EQUAL "SSE2" "${SSE_THERE}" SSE2_TRUE) IF (SSE2_TRUE)