Skip to content

Commit f94863e

Browse files
committed
cmake : fix ppc64 check (#0)
1 parent 463849a commit f94863e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ggml/src/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,10 +1265,13 @@ elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64" OR CMAKE_GENERATOR_PLATFORM_LW
12651265
endif()
12661266
elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64")
12671267
message(STATUS "PowerPC detected")
1268-
execute_process(COMMAND bash -c "grep POWER10 /proc/cpuinfo | head -n 1"
1269-
OUTPUT_VARIABLE POWER10_M)
1270-
string(FIND ${POWER10_M} "POWER10" substring_index)
1271-
if(${substring_index} GREATER_EQUAL 0)
1268+
execute_process(COMMAND bash -c "grep POWER10 /proc/cpuinfo | head -n 1" OUTPUT_VARIABLE POWER10_M)
1269+
string(FIND "${POWER10_M}" "POWER10" substring_index)
1270+
if (NOT DEFINED substring_index OR "${substring_index}" STREQUAL "")
1271+
set(substring_index -1)
1272+
endif()
1273+
1274+
if (${substring_index} GREATER_EQUAL 0)
12721275
list(APPEND ARCH_FLAGS -mcpu=power10)
12731276
elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64le")
12741277
list(APPEND ARCH_FLAGS -mcpu=powerpc64le)

0 commit comments

Comments
 (0)