Skip to content

Commit 6a3c074

Browse files
authored
-march=cooperlake requires gcc10
1 parent 430f741 commit 6a3c074

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmake/system.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,14 @@ endif ()
4646

4747
if (DEFINED TARGET)
4848
if (${TARGET} STREQUAL "COOPERLAKE" AND NOT NO_AVX512)
49-
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=cooperlake")
49+
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
50+
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
51+
if (${GCC_VERSION} VERSION_GREATER 10.1 OR ${GCC_VERSION} VERSION_EQUAL10.1)
52+
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=cooperlake")
53+
else()
54+
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=skylake-avx512")
55+
endif()
56+
endif()
5057
endif()
5158
if (${TARGET} STREQUAL "SKYLAKEX" AND NOT NO_AVX512)
5259
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -march=skylake-avx512")

0 commit comments

Comments
 (0)