-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:baallan/distribution
- Loading branch information
Showing
9 changed files
with
289 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
This is an rpm recipe for use with TOSS Linux version 3. | ||
|
||
It provides a module to add cython 0.28.5 | ||
support via /opt/cython to the stock python 2.7 in /usr. | ||
|
||
To install, create the typical rpmbuild environment and (after installing the TOSS 3 cython in /opt): | ||
``` | ||
wget https://github.com/cython/cython/archive/0.28.5/cython-0.28.5.tar.gz | ||
cp toss-python2-Cython.spec ~/rpmbuild/SPECS | ||
cp cython-0.28.5.tar.gz ~/rpmbuild/SOURCES | ||
cp module.toss-cython ~/rpmbuild/SOURCES | ||
cd ~/rpmbuild/SPECS | ||
rpmbuild -ba toss-python2-numpy.spec | ||
``` | ||
When successful, you can yum install the resulting rpm. | ||
In the TOSS 3 modules environment, | ||
``` | ||
module load cython | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#%Module1.0 | ||
# vi:set filetype=tcl: | ||
# | ||
|
||
# global control file | ||
if { [file exists $env(MODULESHOME)/etc/control] } { | ||
source $env(MODULESHOME)/etc/control | ||
} | ||
|
||
# local variables | ||
set name cython | ||
set version 0.28.5 | ||
set prefix /opt/$name/$version | ||
set bindir $prefix/bin | ||
set libdir $prefix/lib64 | ||
|
||
prepend-path PATH $bindir | ||
prepend-path LD_LIBRARY_PATH $libdir | ||
prepend-path PYTHONPATH $libdir/python2.7/site-packages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
%global srcname cython | ||
%global upname Cython | ||
|
||
%define pkgname python2-%{srcname} | ||
|
||
Name: %{pkgname} | ||
Version: 0.28.5 | ||
Release: 1%{?dist} | ||
Summary: Language for writing Python extension modules | ||
|
||
License: ASL 2.0 | ||
URL: http://www.cython.org | ||
Source0: https://github.com/cython/cython/archive/%{version}/%{srcname}-%{version}.tar.gz | ||
Source1: module.toss-cython | ||
|
||
BuildRequires: gcc | ||
|
||
# override /usr in installation, but Prefix isn't working for this. | ||
%define cy_root /opt/cython/%{version} | ||
%define cy_bin %{cy_root}/bin | ||
%define cy_sitepackages %{cy_root}/%{_lib}/python%{python2_version}/site-packages | ||
%define cy_sitelib %{cy_root}/%{_lib}/python%{python2_version}/site-packages | ||
%define moddir /opt/modules/modulefiles/cython/%{version} | ||
|
||
|
||
%global _description \ | ||
This is a development version of Pyrex, a language\ | ||
for writing Python extension modules. | ||
|
||
%description %{_description} | ||
|
||
# % package | ||
Summary: %{summary} | ||
Obsoletes: python2-Cython < 0.28.5 | ||
BuildRequires: python-devel | ||
BuildRequires: python-setuptools | ||
Prefix: / | ||
|
||
%description -n %{pkgname} %{_description} | ||
Python 2 cython 0.28 for TOSS 3. | ||
|
||
%prep | ||
mkdir -p %{buildroot}%{cy_root} | ||
%autosetup -n %{srcname}-%{version} -p1 | ||
|
||
%build | ||
%py2_build | ||
|
||
%install | ||
mkdir -p %{buildroot}/%{moddir} | ||
%{__install} -m 755 %{_sourcedir}/module.toss-cython %{buildroot}/%{moddir} | ||
|
||
# % py2_install ; redefining the macro didn't work, so inline it here | ||
CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install --prefix=%{cy_root} -O1 --skip-build --root %{buildroot} | ||
|
||
# support forward compatibility with rhel 8 | ||
for bin in cython cythonize cygdb; do | ||
(cd %{buildroot}%{cy_bin}; ln -s ${bin} ${bin}-%{python2_version}) | ||
(cd %{buildroot}%{cy_bin}; ln -s ${bin}-%{python2_version} ${bin}-2) | ||
done | ||
rm -rf %{buildroot}%{cy_root}%{cy_sitelib}/setuptools/tests | ||
|
||
%files -n %{pkgname} | ||
%license LICENSE.txt | ||
%doc *.txt Demos Doc Tools | ||
%{moddir}/* | ||
%{cy_bin}/cython | ||
%{cy_bin}/cython-2 | ||
%{cy_bin}/cython-%{python2_version} | ||
%{cy_bin}/cygdb | ||
%{cy_bin}/cygdb-2 | ||
%{cy_bin}/cygdb-%{python2_version} | ||
%{cy_bin}/cythonize | ||
%{cy_bin}/cythonize-2 | ||
%{cy_bin}/cythonize-%{python2_version} | ||
%{cy_sitepackages}/%{upname}-*.egg-info/ | ||
%{cy_sitepackages}/%{upname}/ | ||
%{cy_sitepackages}/pyximport/ | ||
%{cy_sitepackages}/%{srcname}.py* | ||
|
||
%changelog | ||
* Thu Jun 20 2019 Ben Allan <[email protected]> | ||
Cython 0.28.5 for TOSS3 system python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
This is an rpm recipe for use with TOSS linux version 3. | ||
|
||
It provides a module to add numpy 1.14 (less f2py) | ||
support via /opt/numpy to the stock python 2.7 in /usr. | ||
|
||
It requires Cython 0.28.5 for TOSS also be installed. | ||
|
||
To install, create the typical rpmbuild environment and (after installing the toss3 cython in /opt): | ||
``` | ||
wget https://github.com/numpy/numpy/releases/download/v1.14.6/numpy-1.14.6.tar.gz | ||
cp toss-python2-numpy.spec ~/rpmbuild/SPECS | ||
cp numpy-1.14.6.tar.gz ~/rpmbuild/SOURCES | ||
cp module.toss-numpy ~/rpmbuild/SOURCES | ||
cd ~/rpmbuild/SPECS | ||
rpmbuild -ba toss-python2-numpy.spec | ||
``` | ||
When successful, you can yum install the resulting rpm. | ||
|
||
In the TOSS 3 modules environment, | ||
``` | ||
module load cython | ||
module load numpy | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#%Module1.0 | ||
# vi:set filetype=tcl: | ||
# | ||
|
||
# global control file | ||
if { [file exists $env(MODULESHOME)/etc/control] } { | ||
source $env(MODULESHOME)/etc/control | ||
} | ||
|
||
# local variables | ||
set name numpy | ||
set version 1.14.6 | ||
set prefix /opt/$name/$version | ||
set libdir $prefix/lib64 | ||
|
||
prepend-path PYTHONPATH $libdir/python2.7/site-packages | ||
prereq cython | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
Name: numpy | ||
Version: 1.14.6 | ||
Release: 1%{?dist} | ||
Epoch: 1 | ||
Summary: A fast multidimensional array facility for Python | ||
|
||
# override /usr in installation, but Prefix isn't working for this with python macros | ||
# we need the path to include cython from the required package, or numpy may use the system cython | ||
# incorrectly. | ||
%define cy_root /opt/cython/%{version} | ||
%define cy_bin %{cy_root}/bin | ||
%define cy_sitepackages %{cy_root}/%{_lib}/python%{python2_version}/site-packages | ||
|
||
%define moddir /opt/modules/modulefiles/numpy/%{version}/ | ||
%define numpy_root /opt/numpy/%{version} | ||
%define numpy_sitepackages %{numpy_root}/%{_lib}/python%{python2_version}/site-packages | ||
%define moddir /opt/modules/modulefiles/numpy/%{version}/ | ||
|
||
# Everything is BSD except for class SafeEval in numpy/lib/utils.py which is Python | ||
License: BSD and Python | ||
URL: http://www.numpy.org/ | ||
Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz | ||
Source1: module.toss-numpy | ||
|
||
BuildRequires: python-devel python-setuptools python2-cython gcc | ||
BuildRequires: lapack-devel | ||
BuildRequires: atlas-devel | ||
|
||
%description | ||
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. | ||
|
||
There are also basic facilities for discrete fourier transform, | ||
basic linear algebra and random number generation. | ||
|
||
%package -n python2-numpy | ||
Summary: A fast multidimensional array facility for Python | ||
|
||
%description -n python2-numpy | ||
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. | ||
|
||
There are also basic facilities for discrete fourier transform, | ||
basic linear algebra and random number generation. | ||
|
||
%prep | ||
%setup -q -n %{name}-%{version}%{?relc} | ||
|
||
# workaround for rhbz#849713 | ||
# http://mail.scipy.org/pipermail/numpy-discussion/2012-July/063530.html | ||
rm numpy/distutils/command/__init__.py && touch numpy/distutils/command/__init__.py | ||
|
||
|
||
%build | ||
env ATLAS=%{_libdir} \ | ||
PATH=%{cy_bin}:$PATH \ | ||
PYTHONPATH=%{cy_sitepackages}:$PYTHONPATH \ | ||
FFTW=%{_libdir} BLAS=%{_libdir} \ | ||
BLAS=%{_libdir} \ | ||
LAPACK=%{_libdir} CFLAGS="%{optflags}" \ | ||
%{__python2} setup.py build | ||
|
||
%install | ||
mkdir -p %{buildroot}/%{moddir} | ||
%{__install} -m 755 %{_sourcedir}/module.toss-numpy %{buildroot}/%{moddir}/py%{python2_version} | ||
|
||
env ATLAS=%{_libdir} \ | ||
PATH=%{cy_bin}:$PATH \ | ||
PYTHONPATH=%{cy_sitepackages}:$PYTHONPATH \ | ||
FFTW=%{_libdir} BLAS=%{_libdir} \ | ||
LAPACK=%{_libdir} CFLAGS="%{optflags}" \ | ||
%{__python2} setup.py install --prefix=%{numpy_root} --root %{buildroot} | ||
|
||
rm -rf %{buildroot}/%{numpy_sitepackages}/numpy/f2py | ||
rm -rf %{buildroot}/%{numpy_root}/bin | ||
|
||
%check | ||
pushd doc &> /dev/null | ||
PATH="%{buildroot}%{_bindir}:${PATH}" PYTHONPATH="%{buildroot}%{numpy_sitepackages}:%{cy_sitepackages}" %{__python2} -c "import pkg_resources, numpy ; numpy.test(verbose=2)" \ | ||
# don't remove this comment | ||
popd &> /dev/null | ||
|
||
%files -n python2-numpy | ||
%license LICENSE.txt | ||
%doc THANKS.txt site.cfg.example | ||
%dir %{numpy_sitepackages}/%{name} | ||
%{moddir}/* | ||
%{numpy_sitepackages}/%{name}/*.py* | ||
%{numpy_sitepackages}/%{name}/core | ||
%{numpy_sitepackages}/%{name}/distutils | ||
%{numpy_sitepackages}/%{name}/doc | ||
%{numpy_sitepackages}/%{name}/fft | ||
%{numpy_sitepackages}/%{name}/lib | ||
%{numpy_sitepackages}/%{name}/linalg | ||
%{numpy_sitepackages}/%{name}/ma | ||
%{numpy_sitepackages}/%{name}/random | ||
%{numpy_sitepackages}/%{name}/testing | ||
%{numpy_sitepackages}/%{name}/tests | ||
%{numpy_sitepackages}/%{name}/compat | ||
%{numpy_sitepackages}/%{name}/matrixlib | ||
%{numpy_sitepackages}/%{name}/polynomial | ||
%{numpy_sitepackages}/%{name}-*.egg-info | ||
%exclude %{numpy_sitepackages}/%{name}/LICENSE.txt | ||
|
||
%changelog | ||
* Fri Jun 21 2019 Ben Allan <[email protected]> - 1.14.6-1 | ||
- package modern numpy for toss3 system python as module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# | ||
# | ||
packing=toss3 | ||
ovis_branch=v3.4.12 | ||
ovis_branch=v3.4.13 | ||
sos_branch=master | ||
NetworkRequires=github.com | ||
#[email protected]:tom/SOS.git | ||
|
@@ -141,7 +141,8 @@ else | |
git submodule init sos && git submodule update sos && tar cf ../$SOSTAR sos | ||
fi | ||
|
||
patches="ovis_self.patch" | ||
#patches="ovis_self.patch" | ||
patches= | ||
for i in $patches; do | ||
patch -p1 < ../patches/$i | ||
git commit -a -m "add $packing distribution patches" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters