Skip to content

LLM inference in C/C++

C++ ggml

cmake(s390x): disable z17 target for unsupported compilers (#30297)

Aaron Teoabee0c8476b5
diff --git a/ggml/src/CMakeLists.txt b/ggml/src/CMakeLists.txt
index 0c52539288..b34fbad727 100644
--- a/ggml/src/CMakeLists.txt
+++ b/ggml/src/CMakeLists.txt
@@ -573,11 +573,11 @@ if (GGML_CPU_ALL_VARIANTS)
ggml_add_cpu_backend_variant(z16 Z16 VXE2 NNPA)
# check if compiler supports "-march=z17" codename
- check_cxx_compiler_flag("-march=z17" GGML_CXX_SUPPORTS_Z17)
+ check_cxx_compiler_flag("-march=arch15" GGML_CXX_SUPPORTS_Z17)
if (GGML_CXX_SUPPORTS_Z17)
- ggml_add_cpu_backend_variant(z17 Z17 VXE2 NNPA)
- else()
ggml_add_cpu_backend_variant(arch15 Z17 VXE2 NNPA)
+ else()
+ message(WARNING "Skipping z17 target: compiler must be GCC 15.1 and later")
endif()
else()
message(FATAL_ERROR "Unsupported s390x target OS: ${CMAKE_SYSTEM_NAME}")