Skip to content

Commit d40359f

Browse files
committed
BLD: Sort svml objects to keep builds reproducible
The output ordering of glob.glob() is not guaranteed to be deterministic. In scenarios where it is not, the _multiarray_umath library is not reproducible. This change simply sorts the svml objects returned by glob.glob() to make sure order is deterministic.
1 parent ae8b9ce commit d40359f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

numpy/core/setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,10 @@ def generate_umath_doc_header(ext, build_dir):
11131113
svml_objs = glob.glob(svml_path + '/**/*.s', recursive=True)
11141114
svml_objs = [o for o in svml_objs if not o.endswith(svml_filter)]
11151115

1116+
# The ordering of names returned by glob is undefined, so we sort
1117+
# to make builds reproducible.
1118+
svml_objs.sort()
1119+
11161120
config.add_extension('_multiarray_umath',
11171121
# Forcing C language even though we have C++ sources.
11181122
# It forces the C linker and don't link C++ runtime.

0 commit comments

Comments
 (0)