From 3ad1bbe565e6be310124aff90913c41abd49b1526267d25b5ba10e40cbaef65b Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 2 Jun 2022 08:08:56 +0000 Subject: [PATCH] Accepting request 980329 from home:bmwiedemann:branches:devel:languages:python Add reproducible.patch to not depend on build machine CPU (boo#1100677) package maintainer may want to work with upstream to drop it there or to make it a compile-time option. OBS-URL: https://build.opensuse.org/request/show/980329 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fasttext?expand=0&rev=5 --- python-fasttext.changes | 5 +++++ python-fasttext.spec | 1 + reproducible.patch | 45 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 reproducible.patch diff --git a/python-fasttext.changes b/python-fasttext.changes index c918c70..f922e11 100644 --- a/python-fasttext.changes +++ b/python-fasttext.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jun 1 09:51:33 UTC 2022 - Bernhard Wiedemann + +- Add reproducible.patch to not depend on build machine CPU (boo#1100677) + ------------------------------------------------------------------- Tue May 24 18:16:16 UTC 2022 - Matej Cepl diff --git a/python-fasttext.spec b/python-fasttext.spec index 1e0915d..a9fde74 100644 --- a/python-fasttext.spec +++ b/python-fasttext.spec @@ -27,6 +27,7 @@ Summary: Library for fast text representation and classification License: MIT URL: https://github.com/facebookresearch/fastText Source: https://github.com/facebookresearch/%{modname}/archive/refs/tags/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz +Patch0: reproducible.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module pip} BuildRequires: %{python_module pybind11-devel} diff --git a/reproducible.patch b/reproducible.patch new file mode 100644 index 0000000..15c8959 --- /dev/null +++ b/reproducible.patch @@ -0,0 +1,45 @@ +Date: 2022-06-01 +Author: Bernhard M. Wiedemann + +disable march=native to avoid +https://bugzilla.opensuse.org/show_bug.cgi?id=1100677 packages do not build reproducibly from compile-time CPU-detection + +Index: fastText-0.9.2/CMakeLists.txt +=================================================================== +--- fastText-0.9.2.orig/CMakeLists.txt ++++ fastText-0.9.2/CMakeLists.txt +@@ -15,7 +15,7 @@ set (fasttext_VERSION_MINOR 1) + + include_directories(fasttext) + +-set(CMAKE_CXX_FLAGS " -pthread -std=c++11 -funroll-loops -O3 -march=native") ++set(CMAKE_CXX_FLAGS " -pthread -std=c++11 -funroll-loops -O3") + + set(HEADER_FILES + src/args.h +Index: fastText-0.9.2/setup.py +=================================================================== +--- fastText-0.9.2.orig/setup.py ++++ fastText-0.9.2/setup.py +@@ -76,7 +76,7 @@ ext_modules = [ + ], + language='c++', + extra_compile_args=["-O0 -fno-inline -fprofile-arcs -pthread -march=native" if coverage else +- "-O3 -funroll-loops -pthread -march=native"], ++ "-O3 -funroll-loops -pthread"], + ), + ] + +Index: fastText-0.9.2/Makefile +=================================================================== +--- fastText-0.9.2.orig/Makefile ++++ fastText-0.9.2/Makefile +@@ -7,7 +7,7 @@ + # + + CXX = c++ +-CXXFLAGS = -pthread -std=c++11 -march=native ++CXXFLAGS = -pthread -std=c++11 + OBJS = args.o autotune.o matrix.o dictionary.o loss.o productquantizer.o densematrix.o quantmatrix.o vector.o model.o utils.o meter.o fasttext.o + INCLUDES = -I. +