]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
cmake : fix ppc64 check (whisper/0)
authorGeorgi Gerganov <redacted>
Fri, 15 Nov 2024 13:35:22 +0000 (15:35 +0200)
committerGeorgi Gerganov <redacted>
Fri, 15 Nov 2024 13:44:06 +0000 (15:44 +0200)
ggml-ci

ggml/src/ggml-cpu/CMakeLists.txt

index 8b0d60d4ec7b9ae7d9617a026a30123a65130987..30de6c99abe400f056cd72337507f127a11c37a5 100644 (file)
@@ -211,10 +211,13 @@ elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64" OR CMAKE_GENERATOR_PLATFORM_LW
     endif()
 elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64")
     message(STATUS "PowerPC detected")
-    execute_process(COMMAND bash -c "grep POWER10 /proc/cpuinfo | head -n 1"
-                   OUTPUT_VARIABLE POWER10_M)
-    string(FIND ${POWER10_M} "POWER10" substring_index)
-    if(${substring_index} GREATER_EQUAL 0)
+    execute_process(COMMAND bash -c "grep POWER10 /proc/cpuinfo | head -n 1" OUTPUT_VARIABLE POWER10_M)
+    string(FIND "${POWER10_M}" "POWER10" substring_index)
+    if (NOT DEFINED substring_index OR "${substring_index}" STREQUAL "")
+        set(substring_index -1)
+    endif()
+
+    if (${substring_index} GREATER_EQUAL 0)
        list(APPEND ARCH_FLAGS -mcpu=power10)
     elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64le")
        list(APPEND ARCH_FLAGS -mcpu=powerpc64le)