Skip to content

Commit 09ecbcb

Browse files
committed
cmake : fix ppc64 check (whisper/0)
ggml-ci
1 parent 3225008 commit 09ecbcb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ggml/src/ggml-cpu/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,13 @@ elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64" OR CMAKE_GENERATOR_PLATFORM_LW
211211
endif()
212212
elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64")
213213
message(STATUS "PowerPC detected")
214-
execute_process(COMMAND bash -c "grep POWER10 /proc/cpuinfo | head -n 1"
215-
OUTPUT_VARIABLE POWER10_M)
216-
string(FIND ${POWER10_M} "POWER10" substring_index)
217-
if(${substring_index} GREATER_EQUAL 0)
214+
execute_process(COMMAND bash -c "grep POWER10 /proc/cpuinfo | head -n 1" OUTPUT_VARIABLE POWER10_M)
215+
string(FIND "${POWER10_M}" "POWER10" substring_index)
216+
if (NOT DEFINED substring_index OR "${substring_index}" STREQUAL "")
217+
set(substring_index -1)
218+
endif()
219+
220+
if (${substring_index} GREATER_EQUAL 0)
218221
list(APPEND ARCH_FLAGS -mcpu=power10)
219222
elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64le")
220223
list(APPEND ARCH_FLAGS -mcpu=powerpc64le)

0 commit comments

Comments
 (0)