8000 Fail if CPU is older than Sandy Bridge and ASM optimizations are enab… · arangodb/arangodb@cb5156c · GitHub
[go: up one dir, main page]

Skip to content

Commit cb5156c

Browse files
committed
Fail if CPU is older than Sandy Bridge and ASM optimizations are enabled.
1 parent e47db67 commit cb5156c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmake/OptimizeForArchitecture.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,13 @@ macro(AutodetectHostArchitecture)
151151
set(TARGET_ARCHITECTURE "ivy-bridge")
152152
elseif(_cpu_model EQUAL 42 OR _cpu_model EQUAL 45)
153153
set(TARGET_ARCHITECTURE "sandy-bridge")
154+
elseif(_cpu_model GREATER 42)
155+
message(WARNING "Your CPU (family ${_cpu_family}, model ${_cpu_model}) is not known. Auto-detection of optimization flags failed and will use the minimum required microarchitecture(sandy-bridge).")
156+
elseif(NOT ASM_OPTIMIZATIONS)
157+
message(WARNING "Your CPU (family ${_cpu_family}, model ${_cpu_model}) is not known. This is not fatal because ASM_OPTIMIZATIONS are disabled. If you want to use ASM_OPTIMIZATIONS make sure you have a compliant CPU(sandy-bridge or newer) and review the \"cmake/OptimizeForArchitecture.cmake\" script.")
158+
set(TARGET_ARCHITECTURE "generic")
154159
else()
155-
message(WARNING "Your CPU (family ${_cpu_family}, model ${_cpu_model}) is not known. Auto-detection of optimization flags failed and will use the minimum required microarchitecture(sandy-bridge).")
156-
set(TARGET_ARCHITECTURE "sandy-bridge")
160+
message(FATAL_ERROR "Your CPU (family ${_cpu_family}, model ${_cpu_model}) is not known. This is fatal, because ASM_OPTIMIZATIONS are ON. If your CPU microarchitecture is sandy-bridge or newer, please review the \"cmake/OptimizeForArchitecture.cmake\" script. If you have an older CPU, use -DASM_OPTIMIZATIONS=Off.")
157161
endif()
158162
elseif(_cpu_family EQUAL 7) # Itanium (not supported)
159163
message(WARNING "Your CPU (Itanium: family ${_cpu_family}, model ${_cpu_model}) is not supported by OptimizeForArchitecture.cmake.")

0 commit comments

Comments
 (0)
0