Skip to content

Commit f6b7767

Browse files
committed
fix: version detection for BLA_SIZEOF_INTEGER, recover min version of cmake
1 parent ee72eaf commit f6b7767

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

CMakeLists.txt

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.25) # Don't bump this version for no reason
1+
cmake_minimum_required(VERSION 3.12) # Don't bump this version for no reason
22
project("llama.cpp" C CXX)
33

44
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
@@ -150,19 +150,24 @@ if (LLAMA_BLAS)
150150
if (LLAMA_STATIC)
151151
set(BLA_STATIC ON)
152152
endif()
153-
set(BLA_SIZEOF_INTEGRER 8)
153+
if ($(CMAKE_VERSION) VERSION_GREATER_EQUAL 3.22)
154+
set(BLA_SIZEOF_INTEGRER 8)
155+
endif()
154156
set(BLA_VENDOR ${LLAMA_BLAS_VENDOR})
155157
find_package(BLAS)
156158
if (BLAS_FOUND)
157159
message(STATUS "BLAS found, Libraries: ${BLAS_LIBRARIES}")
158160

161+
add_compile_options(${BLAS_LINKER_FLAGS})
159162
add_compile_definitions(GGML_USE_OPENBLAS)
160163
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} ${BLAS_LIBRARIES})
161164

162165
message("${BLAS_LIBRARIES}")
163166
include_directories(${BLAS_INCLUDE_DIRS})
164167
else()
165-
message(WARNING "BLAS not found, please refer to https://cmake.org/cmake/help/latest/module/FindBLAS.html#blas-lapack-vendors to set correct LLAMA_BLAS_VENDOR")
168+
message(WARNING "BLAS not found, please refer to "
169+
"https://cmake.org/cmake/help/latest/module/FindBLAS.html#blas-lapack-vendors"
170+
" to set correct LLAMA_BLAS_VENDOR")
166171
endif()
167172
endif()
168173

0 commit comments

Comments
 (0)