summaryrefslogtreecommitdiff
path: root/misc/llama-cpp
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2025-04-10 18:09:26 -0700
committerYuri Victorovich <yuri@FreeBSD.org>2025-04-10 18:26:36 -0700
commit892ce9827770be54592389891c5fe6d005b19b2e (patch)
treedf6d3c38ba318eef403f020b9ac19020acff97c9 /misc/llama-cpp
parentscience/libint2: update 2.9.0 → 2.10.2 (diff)
misc/llama-cpp: Fix run-time on older CPUs
... by disabling explicit flags that enable them.
Diffstat (limited to 'misc/llama-cpp')
-rw-r--r--misc/llama-cpp/Makefile3
-rw-r--r--misc/llama-cpp/files/patch-ggml_src_ggml-cpu_CMakeLists.txt11
2 files changed, 13 insertions, 1 deletions
diff --git a/misc/llama-cpp/Makefile b/misc/llama-cpp/Makefile
index f59d16d148d3..3230207092e5 100644
--- a/misc/llama-cpp/Makefile
+++ b/misc/llama-cpp/Makefile
@@ -1,7 +1,7 @@
PORTNAME= llama-cpp
DISTVERSIONPREFIX= b
DISTVERSION= 5097
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= misc # machine-learning
MAINTAINER= yuri@FreeBSD.org
@@ -26,6 +26,7 @@ SHEBANG_GLOB= *.py
CMAKE_ON= BUILD_SHARED_LIBS
CMAKE_OFF= GGML_NATIVE \
+ FREEBSD_ALLOW_ADVANCED_CPU_FEATURES \
LLAMA_BUILD_TESTS
CMAKE_TESTING_ON= LLAMA_BUILD_TESTS
diff --git a/misc/llama-cpp/files/patch-ggml_src_ggml-cpu_CMakeLists.txt b/misc/llama-cpp/files/patch-ggml_src_ggml-cpu_CMakeLists.txt
new file mode 100644
index 000000000000..5e6ff248184a
--- /dev/null
+++ b/misc/llama-cpp/files/patch-ggml_src_ggml-cpu_CMakeLists.txt
@@ -0,0 +1,11 @@
+--- ggml/src/ggml-cpu/CMakeLists.txt.orig 2025-04-10 23:26:06 UTC
++++ ggml/src/ggml-cpu/CMakeLists.txt
+@@ -236,7 +236,7 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
+ else ()
+ if (GGML_NATIVE)
+ list(APPEND ARCH_FLAGS -march=native)
+- else ()
++ elseif (FREEBSD_ALLOW_ADVANCED_CPU_FEATURES)
+ list(APPEND ARCH_FLAGS -msse4.2)
+ list(APPEND ARCH_DEFINITIONS GGML_SSE42)
+ if (GGML_F16C)