8000 Compile for M1 · abetlen/llama-cpp-python@0db47b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0db47b4

Browse files
committed
Compile for M1
1 parent 9339929 commit 0db47b4

File tree

1 file changed

+9
-27
lines changed

1 file changed

+9
-27
lines changed

CMakeLists.txt

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,13 @@
1+
set(CMAKE_SYSTEM_PROCESSOR "arm64")
2+
13
cmake_minimum_required(VERSION 3.4...3.22)
24

35
project(llama_cpp)
46

5-
option(FORCE_CMAKE "Force CMake build of Python bindings" OFF)
6-
7-
set(FORCE_CMAKE $ENV{FORCE_CMAKE})
8-
9-
if (UNIX AND NOT FORCE_CMAKE)
10-
add_custom_command(
11-
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/vendor/llama.cpp/libllama.so
12-
COMMAND make libllama.so
13-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/vendor/llama.cpp
14-
)
15-
add_custom_target(
16-
run ALL
17-
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/vendor/llama.cpp/libllama.so
18-
)
19-
install(
20-
FILES ${CMAKE_CURRENT_SOURCE_DIR}/vendor/llama.cpp/libllama.so
21-
DESTINATION llama_cpp
22-
)
23-
else()
24-
set(BUILD_SHARED_LIBS "On")
25-
add_subdirectory(vendor/llama.cpp)
26-
install(
27-
TARGETS llama
28-
LIBRARY DESTINATION llama_cpp
29-
RUNTIME DESTINATION llama_cpp
30-
)
31-
endif(UNIX)
7+
set(BUILD_SHARED_LIBS "On")
8+
add_subdirectory(vendor/llama.cpp)
9+
install(
10+
TARGETS llama
11+
LIBRARY DESTINATION llama_cpp
12+
RUNTIME DESTINATION llama_cpp
13+
)

0 commit comments

Comments
 (0)
0