Skip to content

Commit 94a3506

Browse files
committed
chore: sync with llama.cpp upstream
1 parent 6bf5dd5 commit 94a3506

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

llama.cpp

smollm/src/main/cpp/CMakeLists.txt

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ set(SMOLLM_SOURCES
3333
${LLAMA_DIR}/src/llama-model-loader.cpp
3434
${LLAMA_DIR}/src/llama-impl.cpp
3535
${LLAMA_DIR}/src/llama-memory.cpp
36+
${LLAMA_DIR}/src/llama-memory-recurrent.cpp
37+
${LLAMA_DIR}/src/llama-memory-hybrid.cpp
3638
${LLAMA_DIR}/src/llama-mmap.cpp
3739
${LLAMA_DIR}/src/llama-hparams.cpp
3840
${LLAMA_DIR}/src/llama-hparams.cpp
39-
${LLAMA_DIR}/src/llama-kv-cache-recurrent.cpp
4041
${LLAMA_DIR}/src/llama-kv-cache-unified-iswa.cpp
4142
${LLAMA_DIR}/src/llama-kv-cache-unified.cpp
4243
${LLAMA_DIR}/src/llama-batch.cpp
@@ -104,9 +105,17 @@ function(build_library target_name)
104105
${VENDOR_DIR}
105106
)
106107

107-
# set the compile options for the target `ggml`
108-
# targets `llama` and `common` are linked to `ggml`,
109-
# thus inheriting the same compile options
108+
# Constants GGML_COMMIT and GGML_VERSION in ggml.c
109+
# are supplied through llama.cpp's CMake script (that in turn gets them from git)
110+
# As we are NOT using llama.cpp's CMake script, we need to define them here
111+
# The functions used to access these constants are unused, hence setting them
112+
# to empty strings does not affect any functionality.
113+
target_compile_definitions(
114+
${target_name}
115+
PRIVATE
116+
GGML_COMMIT=""
117+
GGML_VERSION=""
118+
)
110119

111120
# -fvisibility=hidden: hide all symbols by default
112121
# -fvisibility-inlines-hidden: hide all inline symbols by default
@@ -193,6 +202,17 @@ target_include_directories(
193202
${GGML_DIR}/src
194203
${GGML_DIR}/src/ggml-cpu
195204
)
205+
# Constants GGML_COMMIT and GGML_VERSION in ggml.c
206+
# are supplied through llama.cpp's CMake script (that in turn gets them from git)
207+
# As we are NOT using llama.cpp's CMake script, we need to define them here
208+
# The functions used to access these constants are unused, hence setting them
209+
# to empty strings does not affect any functionality.
210+
target_compile_definitions(
211+
${TARGET_NAME_GGUF_READER}
212+
PRIVATE
213+
GGML_COMMIT=""
214+
GGML_VERSION=""
215+
)
196216
target_compile_options(
197217
${TARGET_NAME_GGUF_READER}
198218
PUBLIC

0 commit comments

Comments
 (0)