Skip to content

Commit 71c6c08

Browse files
bmwiedemannmglambda
authored andcommitted
cmake : avoid -march=native when reproducible build is wanted (ggml-org#11366)
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: ggml-org#11317 This patch was done while working on reproducible builds for openSUSE.
1 parent eb500e7 commit 71c6c08

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ggml/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ else()
5858
set(GGML_BLAS_VENDOR_DEFAULT "Generic")
5959
endif()
6060

61-
if (CMAKE_CROSSCOMPILING)
61+
if (CMAKE_CROSSCOMPILING OR DEFINED ENV{SOURCE_DATE_EPOCH})
62+
message(STATUS "Setting GGML_NATIVE_DEFAULT to OFF")
6263
set(GGML_NATIVE_DEFAULT OFF)
6364
else()
6465
set(GGML_NATIVE_DEFAULT ON)

0 commit comments

Comments
 (0)