Skip to content

Commit 1af6945

Browse files
authored
cmake : avoid -march=native when reproducible build is wanted (#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: #11317 This patch was done while working on reproducible builds for openSUSE.
1 parent 01f37ed commit 1af6945

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)