misc/llama-cpp: Fix run-time on older CPUs

... by disabling explicit flags that enable them.
This commit is contained in:
Yuri Victorovich
2025-04-10 18:26:36 -07:00
parent 14c6c4284f
commit 892ce98277
2 changed files with 13 additions and 1 deletions
+2 -1
View File
@@ -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
@@ -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)