Skip to content

Commit 430f741

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/cc.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ endif ()
107107
if (${CORE} STREQUAL "COOPERLAKE")
108108
if (NOT DYNAMIC_ARCH)
109109
if (NOT NO_AVX512)
110-
set (CCOMMON_OPT = "${CCOMMON_OPT} -march=cooperlake")
110+
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
111+
if (${GCC_VERSION} VERSION_GREATER 10.1 OR ${GCC_VERSION} VERSION_EQUAL 10.1)
112+
set (CCOMMON_OPT = "${CCOMMON_OPT} -march=cooperlake")
113+
endif()
111114
endif ()
112115
endif ()
113116
endif ()

0 commit comments

Comments
 (0)