2009-02-12 04:52:59 +01:00
|
|
|
#
|
2011-02-04 20:12:16 +01:00
|
|
|
# spec file for package python-numpy
|
2009-02-12 04:52:59 +01:00
|
|
|
#
|
2017-01-25 22:34:53 +01:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2009-02-12 04:52:59 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2017-04-19 18:08:20 +02:00
|
|
|
|
2017-10-20 14:38:55 +02:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
|
|
|
|
%define ver 1.13.3
|
|
|
|
%define _ver 1_13_3
|
|
|
|
%define pname python-numpy
|
|
|
|
|
|
|
|
%bcond_with ringdisabled
|
|
|
|
|
2017-11-17 10:36:10 +01:00
|
|
|
%define hpc_upcase_trans_hyph() %(echo %{**} | tr [a-z] [A-Z] | tr '-' '_')
|
|
|
|
|
2017-10-20 14:38:55 +02:00
|
|
|
%if "%flavor" == ""
|
|
|
|
ExclusiveArch: do_not_build
|
2016-09-17 14:34:03 +02:00
|
|
|
%endif
|
2017-10-20 14:38:55 +02:00
|
|
|
|
|
|
|
%if "%flavor" == "standard"
|
|
|
|
%bcond_with hpc
|
|
|
|
%ifarch armv6l s390x
|
|
|
|
%bcond_with openblas
|
|
|
|
%else
|
|
|
|
%bcond_without openblas
|
|
|
|
%endif
|
2017-01-25 22:34:53 +01:00
|
|
|
%endif
|
2017-10-20 14:38:55 +02:00
|
|
|
|
|
|
|
%if "%flavor" == "gnu-hpc"
|
|
|
|
%bcond_without hpc
|
2016-09-17 14:34:03 +02:00
|
|
|
%endif
|
2017-10-20 14:38:55 +02:00
|
|
|
|
|
|
|
%if "%flavor" == "gnu6-hpc"
|
|
|
|
%bcond_without hpc
|
|
|
|
%define c_f_ver 6
|
2016-09-17 14:34:03 +02:00
|
|
|
%endif
|
2017-10-20 14:38:55 +02:00
|
|
|
|
|
|
|
%if %{without hpc}
|
|
|
|
%define package_name %{pname}
|
|
|
|
%define p_python_sitearch %python_sitearch
|
|
|
|
%define p_prefix %_prefix
|
|
|
|
%define p_bindir %_bindir
|
|
|
|
%else
|
|
|
|
# Magic for OBS Staging. Only build the flavors required by
|
|
|
|
# other packages in the ring.
|
|
|
|
%if %{with ringdisabled}
|
|
|
|
ExclusiveArch: do_not_build
|
|
|
|
%endif
|
|
|
|
%{!?compiler_family:%global compiler_family gnu}
|
|
|
|
%{hpc_init -c %compiler_family %{?c_f_ver:-v %{c_f_ver}} %{?mpi_ver:-V %{mpi_ver}}}
|
|
|
|
%define package_name %{hpc_package_name %_ver}
|
|
|
|
%define p_python_sitearch %hpc_python_sitearch
|
|
|
|
%define p_prefix %hpc_prefix
|
|
|
|
%define p_bindir %hpc_bindir
|
2017-01-25 22:34:53 +01:00
|
|
|
%endif
|
|
|
|
|
2017-04-19 18:08:20 +02:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2017-10-20 14:38:55 +02:00
|
|
|
Name: %{package_name}
|
|
|
|
Version: %ver
|
2011-09-22 10:58:19 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: NumPy array processing for numbers, strings, records and objects
|
|
|
|
License: BSD-3-Clause
|
|
|
|
Group: Development/Libraries/Python
|
2016-09-17 14:34:03 +02:00
|
|
|
Url: http://www.numpy.org/
|
2017-01-25 22:34:53 +01:00
|
|
|
Source: https://pypi.io/packages/source/n/numpy/numpy-%{version}.zip
|
2014-09-10 17:02:05 +02:00
|
|
|
# PATCH-FIX-OPENSUSE numpy-buildfix.patch -- openSUSE-specific build fixes
|
2013-11-14 08:43:27 +01:00
|
|
|
Patch0: numpy-buildfix.patch
|
2014-09-10 17:02:05 +02:00
|
|
|
# PATCH-FIX-OPENSUSE numpy-1.9.0-remove-__declspec.patch -- fix for spurious compiler warnings that cause build failure
|
|
|
|
Patch1: numpy-1.9.0-remove-__declspec.patch
|
2017-06-20 11:00:48 +02:00
|
|
|
%if 0%{?suse_version}
|
2017-04-19 18:08:20 +02:00
|
|
|
BuildRequires: fdupes
|
2017-06-20 11:00:48 +02:00
|
|
|
%endif
|
2017-10-20 14:38:55 +02:00
|
|
|
%if %{without hpc}
|
|
|
|
%if 0%{?suse_version}
|
2017-04-19 18:08:20 +02:00
|
|
|
BuildRequires: gcc-fortran
|
2017-10-20 14:38:55 +02:00
|
|
|
%else
|
2017-06-20 11:00:48 +02:00
|
|
|
BuildRequires: gcc-gfortran
|
2017-10-20 14:38:55 +02:00
|
|
|
%endif
|
|
|
|
%if %{with openblas}
|
|
|
|
BuildRequires: openblas-devel
|
|
|
|
%else
|
|
|
|
BuildRequires: blas-devel
|
|
|
|
BuildRequires: lapack-devel
|
|
|
|
%endif
|
|
|
|
%else
|
|
|
|
BuildRequires: %{compiler_family}%{?c_f_ver}-compilers-hpc-macros-devel
|
|
|
|
BuildRequires: libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc-devel
|
|
|
|
BuildRequires: lua-lmod
|
|
|
|
BuildRequires: suse-hpc
|
2017-11-17 10:36:10 +01:00
|
|
|
Requires: libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc
|
|
|
|
Requires: lua-lmod
|
2017-06-20 11:00:48 +02:00
|
|
|
%endif
|
2017-04-19 18:08:20 +02:00
|
|
|
BuildRequires: %{python_module Cython}
|
|
|
|
BuildRequires: %{python_module devel}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
2017-10-07 17:47:16 +02:00
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
BuildRequires: unzip
|
2017-10-20 14:38:55 +02:00
|
|
|
%{?with_hpc:%{hpc_requires}}
|
2017-01-25 22:34:53 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2009-02-12 04:52:59 +01:00
|
|
|
|
2017-04-19 18:08:20 +02:00
|
|
|
%python_subpackages
|
|
|
|
|
2009-02-12 04:52:59 +01:00
|
|
|
%description
|
2010-03-05 15:57:57 +01:00
|
|
|
NumPy is a general-purpose array-processing package designed to
|
|
|
|
efficiently manipulate large multi-dimensional arrays of arbitrary
|
|
|
|
records without sacrificing too much speed for small multi-dimensional
|
|
|
|
arrays. NumPy is built on the Numeric code base and adds features
|
|
|
|
introduced by numarray as well as an extended C-API and the ability to
|
|
|
|
create arrays of arbitrary type which also makes NumPy suitable for
|
|
|
|
interfacing with general-purpose data-base applications.
|
2009-02-12 04:52:59 +01:00
|
|
|
|
2010-03-05 15:57:57 +01:00
|
|
|
There are also basic facilities for discrete fourier transform,
|
|
|
|
basic linear algebra and random number generation.
|
2009-02-12 04:52:59 +01:00
|
|
|
|
2017-10-20 14:38:55 +02:00
|
|
|
%{?with_hpc:%{hpc_python_master_package -L -a }}
|
2017-04-19 18:08:20 +02:00
|
|
|
|
2010-03-05 15:57:57 +01:00
|
|
|
%package devel
|
2014-08-13 17:19:54 +02:00
|
|
|
Summary: Development files for numpy applications
|
2010-03-05 15:57:57 +01:00
|
|
|
Group: Development/Libraries/Python
|
|
|
|
Requires: %{name} = %{version}
|
2017-04-19 18:08:20 +02:00
|
|
|
Requires: python-devel
|
2017-10-20 14:38:55 +02:00
|
|
|
%if %{without hpc}
|
|
|
|
%if %{with openblas}
|
2017-04-19 18:08:20 +02:00
|
|
|
Requires: openblas-devel
|
2017-10-20 14:38:55 +02:00
|
|
|
%else
|
|
|
|
Requires: blas-devel
|
|
|
|
Requires: lapack-devel
|
|
|
|
%endif
|
|
|
|
%else
|
2017-11-09 13:53:36 +01:00
|
|
|
Requires: libopenblas%{?hpc_ext}-%{compiler_family}%{?c_f_ver}-hpc-devel
|
2017-10-20 14:38:55 +02:00
|
|
|
%hpc_requires_devel
|
2011-09-22 10:58:19 +02:00
|
|
|
%endif
|
2009-02-12 04:52:59 +01:00
|
|
|
|
2010-03-05 15:57:57 +01:00
|
|
|
%description devel
|
2014-08-13 17:19:54 +02:00
|
|
|
This package contains files for developing applications using numpy.
|
2009-02-12 04:52:59 +01:00
|
|
|
|
2017-10-20 14:38:55 +02:00
|
|
|
%{?with_hpc:%{hpc_python_master_package devel -a }}
|
2017-04-19 18:08:20 +02:00
|
|
|
|
2009-02-12 04:52:59 +01:00
|
|
|
%prep
|
2014-08-13 17:19:54 +02:00
|
|
|
%setup -q -n numpy-%{version}
|
2013-11-14 08:43:27 +01:00
|
|
|
%patch0 -p1
|
2014-09-10 17:02:05 +02:00
|
|
|
%patch1 -p1
|
2013-11-14 08:43:27 +01:00
|
|
|
# Fix non-executable scripts
|
2017-10-20 14:38:55 +02:00
|
|
|
sed -i '1s/^#!.*$//' numpy/{compat/setup,distutils/{conv_template,cpuinfo,exec_command,from_template,setup,system_info},f2py/{__init__,auxfuncs,capi_maps,cb_rules,cfuncs,common_rules,crackfortran,diagnose,f2py2e,f90mod_rules,func2subr,rules,setup,use_rules},ma/setup,matrixlib/setup,setup,testing/{print_coercion_tables,setup}}.py
|
2009-02-12 04:52:59 +01:00
|
|
|
|
|
|
|
%build
|
2017-10-20 14:38:55 +02:00
|
|
|
%if %{with hpc}
|
|
|
|
%hpc_setup
|
|
|
|
module load openblas
|
|
|
|
export CFLAGS="$(pkg-config --cflags openblas) %{optflags} -fno-strict-aliasing" LIBS="$(pkg-config --libs openblas)"
|
|
|
|
cat > site.cfg <<EOF
|
|
|
|
[openblas]
|
|
|
|
libraries = openblas
|
|
|
|
library_dirs = $OPENBLAS_LIB
|
|
|
|
include_dirs = $OPENBLAS_INC
|
|
|
|
EOF
|
|
|
|
%else
|
2017-04-19 18:08:20 +02:00
|
|
|
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
2017-10-20 14:38:55 +02:00
|
|
|
%endif
|
|
|
|
|
2017-04-19 18:08:20 +02:00
|
|
|
%python_build
|
|
|
|
|
2009-02-12 04:52:59 +01:00
|
|
|
%install
|
2017-10-20 14:38:55 +02:00
|
|
|
%{?with_hpc:%{hpc_setup}}
|
|
|
|
%{?with_hpc:module load openblas}
|
|
|
|
|
|
|
|
%python_exec setup.py install --prefix=%{p_prefix} --root=%{buildroot}
|
|
|
|
|
2017-06-20 11:00:48 +02:00
|
|
|
%if 0%{?suse_version}
|
2017-10-20 14:38:55 +02:00
|
|
|
%fdupes %{buildroot}%{p_prefix}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{without hpc}
|
|
|
|
|
|
|
|
%python_expand rm -rf %{buildroot}%{$python_sitearch}/numpy/{,core,distutils,f2py,fft,lib,linalg,ma,matrixlib,oldnumeric,polynomial,random,testing}/tests # Don't package testsuite
|
|
|
|
|
|
|
|
%else
|
|
|
|
|
|
|
|
%define hpc_module_pname python${py_ver/.*/}-numpy
|
|
|
|
%{python_expand # Don't package testsuite
|
|
|
|
py_ver=%{$python_version}
|
|
|
|
sitesearch_path=`$python -c "import sysconfig as s; print(s.get_paths(vars={'platbase':'%{hpc_prefix}','base':'%{hpc_prefix}'}).get('platlib'))"`
|
|
|
|
rm -rf %{buildroot}${sitesearch_path}/numpy/{,core,distutils,f2py,fft,lib,linalg,ma,matrixlib,oldnumeric,polynomial,random,testing}/tests
|
|
|
|
%hpc_write_modules_files
|
|
|
|
#%%Module1.0#####################################################################
|
|
|
|
|
|
|
|
proc ModulesHelp { } {
|
|
|
|
|
|
|
|
puts stderr " "
|
|
|
|
puts stderr "This module loads the %{pname} library built with the %{compiler_family} compiler"
|
|
|
|
puts stderr "toolchain."
|
|
|
|
puts stderr "\nVersion %{version}\n"
|
|
|
|
|
|
|
|
}
|
|
|
|
module-whatis "Name: %{pname} built with %{compiler_family} compiler"
|
|
|
|
module-whatis "Version: %{version}"
|
|
|
|
module-whatis "Category: python module"
|
|
|
|
module-whatis "Description: %{summary}"
|
|
|
|
module-whatis "URL %{url}"
|
|
|
|
|
|
|
|
set version %{version}
|
|
|
|
|
|
|
|
if [ expr [ module-info mode load ] || [module-info mode display ] ] {
|
|
|
|
if { ![is-loaded intel] && ![is-loaded openblas] } {
|
|
|
|
module load openblas
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
prepend-path PATH %{hpc_bindir}
|
|
|
|
prepend-path PYTHONPATH ${sitesearch_path}
|
|
|
|
|
2017-11-17 10:36:10 +01:00
|
|
|
setenv %{hpc_upcase_trans_hyph %pname}_DIR %{hpc_prefix}
|
|
|
|
setenv %{hpc_upcase_trans_hyph %pname}_BIN %{hpc_bindir}
|
2017-10-20 14:38:55 +02:00
|
|
|
|
2017-11-23 09:34:11 +01:00
|
|
|
family "NumPy"
|
2017-10-20 14:38:55 +02:00
|
|
|
EOF
|
|
|
|
}
|
2017-06-20 11:00:48 +02:00
|
|
|
%endif
|
2009-02-12 04:52:59 +01:00
|
|
|
|
2017-04-19 18:08:20 +02:00
|
|
|
%files %{python_files}
|
2010-03-05 15:57:57 +01:00
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc *.txt
|
2017-10-20 14:38:55 +02:00
|
|
|
%python2_only %{p_bindir}/f2py2
|
|
|
|
%python3_only %{p_bindir}/f2py3
|
|
|
|
%{p_python_sitearch}/numpy/
|
|
|
|
%{p_python_sitearch}/numpy-%{version}-py*.egg-info
|
|
|
|
%exclude %{p_python_sitearch}/numpy/*/*/*.c
|
|
|
|
%exclude %{p_python_sitearch}/numpy/*/*.h
|
|
|
|
%exclude %{p_python_sitearch}/numpy/*/*/*.h
|
|
|
|
%exclude %{p_python_sitearch}/numpy/*/*/*/*.h
|
|
|
|
%exclude %{p_python_sitearch}/numpy/core/lib/libnpymath.a
|
|
|
|
|
|
|
|
%if %{with hpc}
|
|
|
|
%define hpc_module_pname python%(a=%{hpc_python_version}; echo -n ${a/.*/})-numpy
|
|
|
|
%{hpc_modules_files}
|
|
|
|
%{hpc_dirs}
|
|
|
|
%dir %hpc_bindir
|
|
|
|
%dir %{hpc_libdir}/python%{hpc_python_version}
|
|
|
|
%dir %{p_python_sitearch}
|
|
|
|
%endif
|
2010-03-05 15:57:57 +01:00
|
|
|
|
2017-04-19 18:08:20 +02:00
|
|
|
%files %{python_files devel}
|
2009-02-12 04:52:59 +01:00
|
|
|
%defattr(-,root,root)
|
2017-04-19 18:08:20 +02:00
|
|
|
%doc LICENSE.txt
|
2017-10-20 14:38:55 +02:00
|
|
|
%{p_python_sitearch}/numpy/*/*/*.c
|
|
|
|
%{p_python_sitearch}/numpy/*/*.h
|
|
|
|
%{p_python_sitearch}/numpy/*/*/*.h
|
|
|
|
%{p_python_sitearch}/numpy/*/*/*/*.h
|
|
|
|
%{p_python_sitearch}/numpy/core/lib/libnpymath.a
|
2009-02-12 04:52:59 +01:00
|
|
|
|
|
|
|
%changelog
|