]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
cmake : avoid -march=native when reproducible build is wanted (#11366)
authorBernhard M. Wiedemann <redacted>
Fri, 24 Jan 2025 11:21:35 +0000 (12:21 +0100)
committerGitHub <redacted>
Fri, 24 Jan 2025 11:21:35 +0000 (13:21 +0200)
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Without this patch, compiling on different machines produced different binaries, which made verification of results difficult.

Fixes: #11317
This patch was done while working on reproducible builds for openSUSE.

ggml/CMakeLists.txt

index 185079aa47c4ddb74a1058b2a8900a8ec8b908bc..ff68ddc21d9fa573206280a51e39e2f599d981d4 100644 (file)
@@ -58,7 +58,8 @@ else()
     set(GGML_BLAS_VENDOR_DEFAULT "Generic")
 endif()
 
-if (CMAKE_CROSSCOMPILING)
+if (CMAKE_CROSSCOMPILING OR DEFINED ENV{SOURCE_DATE_EPOCH})
+    message(STATUS "Setting GGML_NATIVE_DEFAULT to OFF")
     set(GGML_NATIVE_DEFAULT OFF)
 else()
     set(GGML_NATIVE_DEFAULT ON)