diff --git a/python-openTSNE-disable-CPU-autodetection.patch b/python-openTSNE-disable-CPU-autodetection.patch new file mode 100644 index 0000000..8d71b2f --- /dev/null +++ b/python-openTSNE-disable-CPU-autodetection.patch @@ -0,0 +1,26 @@ +Author: Bernhard M. Wiedemann +Date: 2021-04-01 + +Do not build code using instructions because they are available on a random build worker. + +Instead we pin the CPU type to a reasonable compromise +to allow people to run it on >50% of systems, +but also to use CPU instructions available since 10+ years +to speed up processing. + +diff --git a/setup.py b/setup.py +index c00d331..35542b6 100644 +--- a/setup.py ++++ b/setup.py +@@ -168,9 +168,9 @@ class CythonBuildExt(build_ext): + # package is being built locally, this is desired + if not ("AZURE_BUILD" in os.environ or "CONDA_BUILD" in os.environ): + if platform.machine() == "ppc64le": +- extra_compile_args += ["-mcpu=native"] ++ extra_compile_args += ["-mcpu=power8"] + if platform.machine() == "x86_64": +- extra_compile_args += ["-march=native"] ++ extra_compile_args += ["-march=corei7"] + + # We will disable openmp flags if the compiler doesn"t support it. This + # is only really an issue with OSX clang diff --git a/python-openTSNE.changes b/python-openTSNE.changes index 5eef0d5..ccca8ba 100644 --- a/python-openTSNE.changes +++ b/python-openTSNE.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Apr 1 07:36:31 UTC 2021 - Bernhard Wiedemann + +- Add python-openTSNE-disable-CPU-autodetection.patch (boo#1100677) + ------------------------------------------------------------------- Fri Jan 29 19:18:18 UTC 2021 - Ben Greiner diff --git a/python-openTSNE.spec b/python-openTSNE.spec index 4d5fe8d..fdc931f 100644 --- a/python-openTSNE.spec +++ b/python-openTSNE.spec @@ -28,6 +28,7 @@ License: BSD-3-Clause URL: https://github.com/pavlin-policar/openTSNE # tests are not packaged in the PyPI sdist, use GitHub instead Source: %{url}/archive/v%{version}.tar.gz#/openTSNE-%{version}-gh.tar.gz +Patch0: python-openTSNE-disable-CPU-autodetection.patch BuildRequires: python-rpm-macros BuildRequires: %{python_module setuptools} BuildRequires: %{python_module devel} @@ -52,7 +53,7 @@ Obsoletes: python-fastTSNE < %{version} Extensible, parallel implementations of t-SNE %prep -%setup -q -n openTSNE-%{version} +%autosetup -p1 -n openTSNE-%{version} %build export CFLAGS="%{optflags}"