Skip to content

Commit

Permalink
Merge pull request #3801 from cms-sw/tensorflow-eigen-srcs
Browse files Browse the repository at this point in the history
tensorflow:use eigen and protobuf souces from cmsdist
  • Loading branch information
smuzaffar committed Mar 7, 2018
2 parents 6f288e7 + e9d737e commit c68153f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
11 changes: 9 additions & 2 deletions eigen.spec
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
### RPM external eigen 034b6c3e1017
## INITENV +PATH PKG_CONFIG_PATH %{i}/share/pkgconfig
## INITENV SETV EIGEN_SOURCE %{source0}
## INITENV SETV EIGEN_STRIP_PREFIX %{source_prefix}
## NOCOMPILER
%define tag %{realversion}
Source: https://bitbucket.org/%{n}/%{n}/get/%{tag}.tar.gz

#These are needed by Tensorflow sources
#NOTE: Never apply any patch in the spec file, this way tensorflow gets the exact same sources
%define source0 https://bitbucket.org/%{n}/%{n}/get/%{tag}.tar.gz
%define source_prefix %{n}-%{n}-%{realversion}
Source: %{source0}
BuildRequires: cmake

%prep
%setup -n %n-%n-%{realversion}
%setup -n %{source_prefix}

%build
mkdir build
Expand Down
19 changes: 14 additions & 5 deletions protobuf.spec
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
### RPM external protobuf 3.4.0
Source: https://github.com/google/protobuf/archive/v%{realversion}.tar.gz
Requires: zlib
BuildRequires: autotools
#
## INITENV SETV PROTOBUF_SOURCE %{source0}
## INITENV SETV PROTOBUF_STRIP_PREFIX %{source_prefix}
#============= IMPORTANT NOTE ========================#
# When changing the version of protobuf, remember to regenerate protobuf objects in CMSSW
# current recipe for this is:
# cmsenv
# git cms-addpkg DQMServices/Core
# cd $CMSSW_BASE/src
# protoc --cpp_out=. DQMServices/Core/src/ROOTFilePB.proto
#######################################################

#These are needed by Tensorflow sources
#NOTE: Never apply any patch in the spec file, this way tensorflow gets the exact same sources
%define source0 https://github.com/google/protobuf/archive/v%{realversion}.tar.gz
%define source_prefix %{n}-%{realversion}

Source: %{source0}
Requires: zlib
BuildRequires: autotools

%prep
%setup -n %{n}-%{realversion}
%setup -n %{source_prefix}

%build
./autogen.sh
Expand Down
6 changes: 4 additions & 2 deletions tensorflow-sources.spec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
### RPM external tensorflow-sources 1.5.0
#Source: https://github.com/tensorflow/tensorflow/archive/v%{realversion}.tar.gz
%define isslc6amd64 %(case %{cmsplatf} in (slc6_amd64_*) echo 1 ;; (*) echo 0 ;; esac)
%define tag f92e98b51479146935bbb362403dd8a18ba37547
%define tag 67d4face442a78bd39861235fd2d408f7b9fae39
%define branch cms/v%{realversion}
%define github_user cms-externals
Source: git+https://github.com/%{github_user}/tensorflow.git?obj=%{branch}/%{tag}&export=tensorflow-%{realversion}&output=/tensorflow-%{realversion}.tgz
Source: git+https://github.com/%{github_user}/tensorflow.git?obj=%{branch}/%{tag}&export=tensorflow-%{realversion}&output=/tensorflow-%{realversion}-%{tag}.tgz

BuildRequires: bazel eigen protobuf gcc
Requires: py2-numpy python py2-wheel
Expand Down Expand Up @@ -37,6 +37,8 @@ rm -rf ../build

./configure

sed -i -e "s|@EIGEN_SOURCE@|${EIGEN_SOURCE}|;s|@EIGEN_STRIP_PREFIX@|${EIGEN_STRIP_PREFIX}|" tensorflow/workspace.bzl tensorflow/contrib/makefile/download_dependencies.sh
sed -i -e "s|@PROTOBUF_SOURCE@|${PROTOBUF_SOURCE}|;s|@PROTOBUF_STRIP_PREFIX@|${PROTOBUF_STRIP_PREFIX}|" tensorflow/workspace.bzl tensorflow/contrib/makefile/download_dependencies.sh
bazel --output_user_root ../build fetch "tensorflow:libtensorflow_cc.so"

#This is needed on SLC6 because the version of glibc is old
Expand Down

0 comments on commit c68153f

Please sign in to comment.