ed22a57
%{?python_enable_dependency_generator}
ed22a57
Jerry James 2181a57
%global pkgname Theano
df74587
%global srcname theano
6acf609
%global commit  29d4caa168eaa213cb0b29fd2cb2bef8cd99b389
70e2d03
#%%global rctag a1
Jerry James 2181a57
Jerry James 2181a57
Name:           python-theano
3bcde08
Version:        1.0.5
3bcde08
Release:        1%{?rctag:.%{rctag}}%{?dist}
Jerry James 2181a57
Summary:        Mathematical expressions involving multidimensional arrays
Jerry James 2181a57
Jerry James 2181a57
License:        BSD
Jerry James 2181a57
URL:            http://deeplearning.net/software/theano/
94bdf82
Source0:        https://github.com/Theano/Theano/archive/rel-%{version}%{?rctag:%{rctag}}/%{pkgname}-%{version}%{?rctag:%{rctag}}.tar.gz
062ec9e
2f012fb
# Fix the blas interface; see https://github.com/Theano/Theano/issues/6518
2f012fb
Patch0:         %{name}-blas.patch
3bcde08
# Fix FutureWarnings from numpy
3bcde08
Patch1:         %{name}-future-warning.patch
6acf609
# Do not try to invoke git to find the commit
3bcde08
Patch2:         %{name}-git.patch
6acf609
# Fix documentation bugs resulting in sphinx warnings
3bcde08
Patch3:         %{name}-doc.patch
3bcde08
# Close files when they are no longer needed
3bcde08
Patch4:         %{name}-file-leak.patch
3bcde08
# Fix a call to a deprecated function in the printing code
3bcde08
Patch5:         %{name}-printing.patch
aca8903
Jerry James 2181a57
BuildArch:      noarch
Jerry James 2181a57
70e2d03
BuildRequires:  gcc-c++
70e2d03
BuildRequires:  gcc-gfortran
33d1a2b
BuildRequires:  git-core
3bcde08
BuildRequires:  pkgconfig(flexiblas)
062ec9e
BuildRequires:  tex(latex)
062ec9e
BuildRequires:  tex(anyfontsize.sty)
062ec9e
BuildRequires:  tex-dvipng
062ec9e
f7910ce
BuildRequires:  fontawesome-fonts-web
f7910ce
BuildRequires:  font(fontawesome)
f7910ce
BuildRequires:  font(lato)
f7910ce
BuildRequires:  font(robotoslab)
f7910ce
BuildRequires:  fontconfig
062ec9e
BuildRequires:  python3-devel
062ec9e
BuildRequires:  python3-pygpu-devel
3bcde08
BuildRequires:  %{py3_dist cython}
3bcde08
BuildRequires:  %{py3_dist nose}
3bcde08
BuildRequires:  %{py3_dist numpy}
3bcde08
BuildRequires:  %{py3_dist parameterized}
3bcde08
BuildRequires:  %{py3_dist pygments}
3bcde08
BuildRequires:  %{py3_dist scipy}
3bcde08
BuildRequires:  %{py3_dist setuptools}
3bcde08
BuildRequires:  %{py3_dist six}
3bcde08
BuildRequires:  %{py3_dist sphinx}
3bcde08
BuildRequires:  %{py3_dist sphinx-rtd-theme}
Jerry James 2181a57
2f2de8d
%global _desc %{expand:
df74587
Theano is a Python library that allows you to define, optimize, and
df74587
evaluate mathematical expressions involving multi-dimensional arrays
df74587
efficiently.  Theano features:
df74587
- tight integration with NumPy: Use numpy.ndarray in Theano-compiled
df74587
  functions.
df74587
- transparent use of a GPU: Perform data-intensive calculations up to
6acf609
  140x faster than with CPU (float32 only).
df74587
- efficient symbolic differentiation: Theano does your derivatives for
df74587
  function with one or many inputs.
df74587
- speed and stability optimizations: Get the right answer for log(1+x)
df74587
  even when x is really tiny.
df74587
- dynamic C code generation: Evaluate expressions faster.
df74587
- extensive unit-testing and self-verification: Detect and diagnose many
2f2de8d
  types of mistake.}
2f2de8d
2f2de8d
%description %_desc
df74587
df74587
%package -n python3-%{srcname}
ed22a57
Summary:        %{summary}
3bcde08
Requires:       flexiblas-devel
062ec9e
Requires:       gcc-c++
062ec9e
Requires:       gcc-gfortran
eda01ef
Recommends:     python%{python3_version}dist(pygpu)
eda01ef
Suggests:       python%{python3_version}dist(pydot)
e808ddb
2f2de8d
%description -n python3-%{srcname} %_desc
Jerry James be8f770
df74587
%package doc
df74587
Summary:        Theano documentation
2f2de8d
Requires:       fontawesome-fonts-web
2f2de8d
Requires:       font(fontawesome)
2f2de8d
Requires:       font(lato)
2f2de8d
Requires:       font(robotoslab)
df74587
df74587
%description doc
df74587
User documentation for Theano.
df74587
Jerry James 2181a57
%prep
2f012fb
%autosetup -n %{pkgname}-rel-%{version}%{?rctag:%{rctag}} -p0
Jerry James 2181a57
e808ddb
# We don't need to use /usr/bin/env
e808ddb
for fil in $(grep -FRl /bin/env .); do
ed22a57
  sed -ri.orig 's,( )?(/usr)?/bin/env[[:blank:]]*python.*,%{_bindir}/python3,' $fil
e808ddb
  touch -r $fil.orig $fil
e808ddb
  rm $fil.orig
e808ddb
done
e808ddb
6acf609
# We don't have a git checkout, so don't invoke git to find the commit
6acf609
sed -i 's/@@tag@@/%{commit}/' doc/conf.py
6acf609
e4a3f19
# Remove linter test
e4a3f19
rm theano/tests/test_flake8.py
e4a3f19
Jerry James 2181a57
%build
Jerry James ad8e482
# Regenerate the Cython files, and fix the numpy interfaces
062ec9e
cython -3 -o theano/scan_module/c_code/scan_perform.c \
062ec9e
             theano/scan_module/scan_perform.pyx
Jerry James ad8e482
sed -e 's/\(__pyx_v_self\)->descr/PyArray_DESCR(\1)/' \
Jerry James ad8e482
    -e 's/\(__pyx_v_arr\)->base = \(.*\);/PyArray_SetBaseObject(\1, \2);/' \
Jerry James ad8e482
    -e 's/\(__pyx_v_arr\)->base/PyArray_BASE(\1)/' \
062ec9e
    -i theano/scan_module/c_code/scan_perform.c
Jerry James be8f770
df74587
%py3_build
Jerry James 2181a57
Jerry James 2181a57
# Build the documentation
Jerry James 2181a57
export PYTHONPATH=$PWD
3bcde08
%{python3} doc/scripts/docgen.py --nopdf
2f2de8d
rst2html --no-datestamp README.rst README.html
Jerry James 2181a57
Jerry James 2181a57
# Remove build artifacts
Jerry James 2181a57
rm -fr html/.buildinfo html/.doctrees
Jerry James 2181a57
2f2de8d
# Do not bundle fonts into the documentation
2f2de8d
cd html/_static/fonts
2f2de8d
for suffix in eot svg ttf woff woff2; do
2f2de8d
  rm fontawesome-webfont.$suffix
2f2de8d
  ln -s %{_datadir}/fonts/fontawesome/fontawesome-webfont.$suffix .
2f2de8d
done
2f2de8d
rm {Lato,RobotoSlab}/*.ttf
f7910ce
ln -s $(fc-match -f "%%{file}" "lato:bold") Lato/lato-bold.ttf
f7910ce
ln -s $(fc-match -f "%%{file}" "lato:bold:italic") Lato/lato-bolditalic.ttf
f7910ce
ln -s $(fc-match -f "%%{file}" "lato:italic") Lato/lato-italic.ttf
f7910ce
ln -s $(fc-match -f "%%{file}" "lato") Lato/lato-regular.ttf
f7910ce
ln -s $(fc-match -f "%%{file}" "robotoslab:bold") RobotoSlab/roboto-slab-v7-bold.ttf
f7910ce
ln -s $(fc-match -f "%%{file}" "robotoslab") RobotoSlab/roboto-slab-v7-regular.ttf
2f2de8d
cd -
2f2de8d
Jerry James 2181a57
%install
df74587
%py3_install
Jerry James 2181a57
Jerry James 2181a57
# Restore executable permission on the scripts
Jerry James 2181a57
chmod a+x $(find %{buildroot} -name \*.py -o -name \*.sh | xargs grep -l '^#!')
Jerry James 2181a57
Jerry James ad8e482
%check
fe309e6
# FIXME: some tests fail on ppc64le
fe309e6
# The conv3d2d tests compute the wrong type of values (float32 instead of
fe309e6
# float64) and the wrong values.
b15c2bd
if [ "uname -m" = "ppc64le" ]; then
b15c2bd
  sed -i '/parameterized\.expand/,$d' ttheano/tensor/nnet/tests/test_conv3d2d.py
fe309e6
b15c2bd
  # An unexpected GradientError is thrown at theano/gradient.py line 1790
b15c2bd
  rm theano/tensor/nnet/tests/test_corr3d.py
b15c2bd
fi
fe309e6
3bcde08
%{python3} bin/theano-nose --processes=0 --process-restartworker
Jerry James 2181a57
df74587
%files -n python3-%{srcname}
2f2de8d
%doc DESCRIPTION.txt HISTORY.txt NEWS.txt README.html
f5f4997
%license doc/LICENSE.txt
Jerry James be8f770
%{_bindir}/theano-*
ed22a57
%{python3_sitelib}/Theano-*.egg-info/
ed22a57
%{python3_sitelib}/theano/
062ec9e
%{python3_sitelib}/bin/
Jerry James be8f770
df74587
%files doc
df74587
%doc html
df74587
Jerry James 2181a57
%changelog
3bcde08
* Fri Aug  7 2020 Jerry James <loganjerry@gmail.com> - 1.0.5-1
3bcde08
- Version 1.0.5
3bcde08
- Drop upstreamed patches: -ceil-floor-trunc, -clip, -format, -gammaq,
3bcde08
  -has-sorted-indices, -is, -iterable, -ordered-dict, -random, -sort, -sphinx3,
3bcde08
  -traceback
3bcde08
- Add patches: -file-leak, -printing
3bcde08
- Build with flexiblas instead of with openblas directly
3bcde08
d9f682f
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-6.2
d9f682f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
d9f682f
2238167
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.0.4-6.1
2238167
- Rebuilt for Python 3.9
2238167
c44d68e
* Tue Feb  4 2020 Jerry James <loganjerry@gmail.com> - 1.0.4-6
c44d68e
- Add -ordered-dict patch, thanks to Miro Hrončok (bz 1797982)
c44d68e
dc53b8f
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-5.1
dc53b8f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
dc53b8f
2f2de8d
* Mon Nov 25 2019 Jerry James <loganjerry@gmail.com> - 1.0.4-5
2f2de8d
- Drop epydoc BR since it has been retired
2f2de8d
- Unbundle fonts from the documentation
2f2de8d
- Ship an HTML form of the README
e1ee68e
- Add -has-sorted-indices patch
2f2de8d
c033815
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.4-4.1
c033815
- Rebuilt for Python 3.8.0rc1 (#1748018)
c033815
6acf609
* Thu Aug 29 2019 Jerry James <loganjerry@gmail.com> - 1.0.4-4
6acf609
- Add -iterable, -git, -format, -is, and -doc patches to fix warnings
6acf609
fe4076c
* Fri Aug 23 2019 Robert-André Mauchin <zebob.m@gmail.com> - 1.0.4-3
fe4076c
- Fix FTBFS with python-theano-sort patch (#1737011)
fe4076c
cb6e9ff
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.0.4-2.1
cb6e9ff
- Rebuilt for Python 3.8
cb6e9ff
3fb7ae8
* Fri Aug 16 2019 Jerry James <loganjerry@gmail.com> - 1.0.4-2
3fb7ae8
- Add -future-warning, -gammaq, -ceil-floor-trunc, -traceback, -clip, and
3fb7ae8
  -random patches to fix FTBFS (bz 1737011)
3fb7ae8
94f9412
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-1.2
94f9412
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
94f9412
08164f0
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.4-1.1
08164f0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
08164f0
9317182
* Sat Jan 19 2019 Jerry James <loganjerry@gmail.com> - 1.0.4-1
9317182
- New upstream release
9317182
eda01ef
* Thu Dec 27 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.3-2
eda01ef
- Drop duplicated dependencies
eda01ef
062ec9e
* Sat Oct  6 2018 Jerry James <loganjerry@gmail.com> - 1.0.3-1
062ec9e
- New upstream release
062ec9e
- Partially revert the previous commit; the gcc Requires is needed
062ec9e
- Build with openblas instead of atlas
062ec9e
- Send cython output to the correct directory
062ec9e
- Build with pygpu support
062ec9e
ed22a57
* Sun Aug 12 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.2-2
ed22a57
- Drop python2 subpackage
ed22a57
2b22d9c
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-1.2
2b22d9c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
2b22d9c
cdcd94f
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0.2-1.1
cdcd94f
- Rebuilt for Python 3.7
cdcd94f
5ef9abd
* Wed May 23 2018 Jerry James <loganjerry@gmail.com> - 1.0.2-1
5ef9abd
- New upstream release
5ef9abd
8395bbc
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-1.1
8395bbc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
8395bbc
2f012fb
* Fri Dec 22 2017 Jerry James <loganjerry@gmail.com> - 1.0.1-1
2f012fb
- New upstream release
2f012fb
- Add -blas patch to fix compilation errors when using the blas interface
2f012fb
- Reenable the tests
2f012fb
- Pass nose flags to prevent memory exhaustion while running the tests
2f012fb
8dd79dc
* Fri Nov 17 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.0.0-1
8dd79dc
- Update to 1.0.0
8dd79dc
3adf02b
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-1.1
3adf02b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
3adf02b
33d1a2b
* Wed Mar 22 2017 Jerry James <loganjerry@gmail.com> - 0.9.0-1
33d1a2b
- New upstream release
33d1a2b
a731d6c
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.2-1.3
a731d6c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
a731d6c
c9b2a1e
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.8.2-1.2
c9b2a1e
- Rebuild for Python 3.6
c9b2a1e
7e9efdc
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.2-1.1
7e9efdc
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
7e9efdc
55e692d
* Thu Apr 21 2016 Jerry James <loganjerry@gmail.com> - 0.8.2-1
55e692d
- New upstream release
55e692d
e808ddb
* Fri Apr 15 2016 Jerry James <loganjerry@gmail.com> - 0.8.1-2
e808ddb
- Remove python2 dependency from the python3 subpackage (bz 1324232)
e808ddb
- Recommend pydot instead of requiring it
e808ddb
08412dd
* Sat Apr  2 2016 Jerry James <loganjerry@gmail.com> - 0.8.1-1
08412dd
- New upstream release
08412dd
- Fix the pydot dependencies
08412dd
70e2d03
* Wed Mar 23 2016 Jerry James <loganjerry@gmail.com> - 0.8.0-1
70e2d03
- New upstream release
70e2d03
1f84a83
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.1-0.2.a1
1f84a83
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
1f84a83
df74587
* Mon Feb  1 2016 Jerry James <loganjerry@gmail.com> - 0.7.1-0.1.a1
df74587
- Comply with latest python packaging guidelines
df74587
94bdf82
* Thu Nov 12 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.7.1-0.1.a1
94bdf82
- Update to 0.7.1a1
94bdf82
8da3af2
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-2.2
8da3af2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
8da3af2
df74587
* Wed Nov  4 2015 Toshio Kuratomi <toshio@fedoraproject.org> - 0.7.0-2.1
eeed55b
- Fix python3 package requiring python2.
eeed55b
a829163
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-1.1
a829163
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
a829163
Jerry James ad8e482
* Wed Apr  1 2015 Jerry James <loganjerry@gmail.com> - 0.7.0-1
Jerry James ad8e482
- New upstream release
Jerry James ad8e482
- Drop upstreamed -arm patch
Jerry James ad8e482
- Regenerate cython files to fix build failure
Jerry James ad8e482
410c310
* Sat Feb 21 2015 Jerry James <loganjerry@gmail.com> - 0.6.0-5
410c310
- Add -arm patch to fix build failure on arm builders due to inverted test
410c310
f5f4997
* Sat Feb 21 2015 Jerry James <loganjerry@gmail.com> - 0.6.0-4
f5f4997
- Drop workaround for fixed bug (bz 1075826)
f5f4997
- Use license macro
f5f4997
f517f04
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-3.1
f517f04
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f517f04
Jerry James fd4a43f
* Wed May 14 2014 Jerry James <loganjerry@gmail.com> - 0.6.0-3
Jerry James fd4a43f
- Rebuild for https://fedoraproject.org/wiki/Changes/Python_3.4
Jerry James fd4a43f
Jerry James be8f770
* Thu Mar 13 2014 Jerry James <loganjerry@gmail.com> - 0.6.0-2
Jerry James be8f770
- Add python3 subpackage
Jerry James be8f770
- Add another icon to the -missing tarball
Jerry James be8f770
- Update source icons
Jerry James be8f770
- Unbundle python-six
Jerry James be8f770
- Add workaround for bz 1075826
Jerry James be8f770
bfed893
* Sat Dec  7 2013 Jerry James <loganjerry@gmail.com> - 0.6.0-1
bfed893
- New upstream release
bfed893
- Drop upstreamed -import patch
bfed893
Jerry James 2181a57
* Mon Oct 21 2013 Jerry James <loganjerry@gmail.com> - 0.6.0-0.1.rc3
Jerry James 2181a57
- Add the -import patch to fix an exception
Jerry James 2181a57
- Add more files to the base package docs
Jerry James 2181a57
Jerry James 2181a57
* Tue Aug 27 2013 Jerry James <loganjerry@gmail.com> - 0.6.0-0.rc3
Jerry James 2181a57
- Initial RPM