Accepting request 882539 from devel:languages:python:numeric

OBS-URL: https://build.opensuse.org/request/show/882539
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-openTSNE?expand=0&rev=2
This commit is contained in:
Richard Brown 2021-04-06 15:29:43 +00:00 committed by Git OBS Bridge
commit e66cd42b49
3 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,26 @@
Author: Bernhard M. Wiedemann <bwiedemann suse de>
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

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Apr 1 07:36:31 UTC 2021 - Bernhard Wiedemann <bwiedemann@suse.com>
- Add python-openTSNE-disable-CPU-autodetection.patch (boo#1100677)
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jan 29 19:18:18 UTC 2021 - Ben Greiner <code@bnavigator.de> Fri Jan 29 19:18:18 UTC 2021 - Ben Greiner <code@bnavigator.de>

View File

@ -28,6 +28,7 @@ License: BSD-3-Clause
URL: https://github.com/pavlin-policar/openTSNE URL: https://github.com/pavlin-policar/openTSNE
# tests are not packaged in the PyPI sdist, use GitHub instead # tests are not packaged in the PyPI sdist, use GitHub instead
Source: %{url}/archive/v%{version}.tar.gz#/openTSNE-%{version}-gh.tar.gz 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-rpm-macros
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module devel} BuildRequires: %{python_module devel}
@ -52,7 +53,7 @@ Obsoletes: python-fastTSNE < %{version}
Extensible, parallel implementations of t-SNE Extensible, parallel implementations of t-SNE
%prep %prep
%setup -q -n openTSNE-%{version} %autosetup -p1 -n openTSNE-%{version}
%build %build
export CFLAGS="%{optflags}" export CFLAGS="%{optflags}"