Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding Keras/Theano #2822

Merged
merged 1 commit into from Feb 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmssw-tool-conf.spec
@@ -1,4 +1,4 @@
### RPM cms cmssw-tool-conf 35.0
### RPM cms cmssw-tool-conf 36.0
## NOCOMPILER
# With cmsBuild, change the above version only when a new
# tool is added
Expand Down Expand Up @@ -158,6 +158,7 @@ Requires: py2-setuptools-toolfile
Requires: madgraph5amcatnlo-toolfile
Requires: histogrammar-toolfile
Requires: py2-pippkgs-toolfile
Requires: py2-pippkgs_depscipy-toolfile
#still a work in progress Requires: py2-notebook

# Only for Linux platform.
Expand Down
8 changes: 8 additions & 0 deletions py2-Keras.spec
@@ -0,0 +1,8 @@
### RPM external py2-Keras 1.2.2
## INITENV +PATH PYTHONPATH %{i}/$PYTHON_LIB_SITE_PACKAGES


%define pip_name Keras
Requires: py2-PyYAML py2-six py2-scipy py2-Theano py2-numpy
## IMPORT build-with-pip

10 changes: 10 additions & 0 deletions py2-Theano.spec
@@ -0,0 +1,10 @@
### RPM external py2-Theano 0.8.2
## INITENV +PATH PYTHONPATH %{i}/$PYTHON_LIB_SITE_PACKAGES


%define pip_name Theano
Requires: py2-scipy py2-numpy py2-six
## IMPORT build-with-pip

%define PipPostBuild \
perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/theano-nose %{i}/bin/theano-cache %{i}/bin/theano-test
23 changes: 23 additions & 0 deletions py2-pippkgs_depscipy-toolfile.spec
@@ -0,0 +1,23 @@
### RPM external py2-pippkgs_depscipy-toolfile 1.0
Requires: py2-pippkgs_depscipy
BuildRequires: python
%prep

%build

%install

mkdir -p %{i}/etc/scram.d
cat << \EOF_TOOLFILE >%{i}/etc/scram.d/py2-pippkgs_depscipy.xml
<tool name="py2-pippkgs_depscipy" version="@TOOL_VERSION@">
<client>
<environment name="PY2_PIPPKGS_DEPSCIPY" default="@TOOL_ROOT@"/>
</client>
<runtime name="PYTHONPATH" value="$PY2_PIPPKGS_DEPSCIPY/@PYTHON_LIB_SITE_PACKAGES@" type="path"/>
<runtime name="PATH" value="$PY2_PIPPKGS_DEPSCIPY/bin" type="path"/>
</tool>
EOF_TOOLFILE

export PYTHON_LIB_SITE_PACKAGES

## IMPORT scram-tools-post
52 changes: 52 additions & 0 deletions py2-pippkgs_depscipy.spec
@@ -0,0 +1,52 @@
### RPM external py2-pippkgs_depscipy 1.0
## INITENV +PATH PYTHONPATH %{i}/$PYTHON_LIB_SITE_PACKAGES
Source: none

Requires: root curl python py2-scipy

BuildRequires: py2-Keras
BuildRequires: py2-Theano

%prep

%build

%install
mkdir -p %{i}/$PYTHON_LIB_SITE_PACKAGES
for pkg in %builddirectpkgreqs ; do
SOURCE=%{cmsroot}/%{cmsplatf}/${pkg}/$PYTHON_LIB_SITE_PACKAGES
if [ -d $SOURCE ] ; then
echo "Checking for duplicates ...."
for f in $(ls $SOURCE) ; do
if [ -e %{i}/$PYTHON_LIB_SITE_PACKAGES/$f ] ; then
# https://github.com/jupyter/jupyter_core/issues/55 - now I delete jupyter.py from one of the providers
#backports is an example directory that can have multiple packages inside
if [ $f != "backports" ] ; then
echo " Duplicate file found: $f"
exit 1
fi

fi
done
echo "Copying $SOURCE in %{pkgrel}"
rsync -av $SOURCE/ %{i}/$PYTHON_LIB_SITE_PACKAGES/
fi
done

#and for bin
mkdir -p %{i}/bin
for pkg in %builddirectpkgreqs ; do
SOURCE=%{cmsroot}/%{cmsplatf}/${pkg}/bin
if [ -d $SOURCE ] ; then
echo "Checking for duplicates ...."
for f in $(ls $SOURCE) ; do
if [ -e %{i}/bin/$f ] ; then
echo " Duplicate file found: $f"
exit 1
fi
done
echo "Copying $SOURCE in %{pkgrel}"
rsync -av $SOURCE/ %{i}/bin/
fi
done