%global commit afd90f1f8d31a10e971d144aa8123f0c07315a8d %global shortcommit %(c=%{commit}; echo ${c:0:7}) %undefine _missing_build_ids_terminate_build %global debug_package %{nil} Name: hiptensorflow Version: 1.0.1 Release: 0.2.20180302git%{shortcommit}%{?dist} Summary: HIP enabled tensorflow License: ASL 2.0 URL: https://github.com/ROCmSoftwarePlatform/hiptensorflow Source0: https://github.com/ROCmSoftwarePlatform/hiptensorflow/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz #Source1: https://github.com/bazelbuild/bazel/releases/download/0.10.1/bazel-0.10.1-dist.zip Source2: https://github.com/bazelbuild/bazel/releases/download/0.4.5/bazel-0.4.5-installer-linux-x86_64.sh Patch0: 0001-Hacks-to-build-on-Fedora.patch Patch1: 0001-Fix-paths-for-ROCm-tools-on-Fedora.patch Patch2: 0001-HACK-for-fedora.patch BuildRequires: hcrng # For Bazel BuildRequires: java-1.8.0-openjdk-devel #BuildRequires: zlib-devel # Fo install BuildRequires: python-wheel BuildRequires: python-devel BuildRequires: hip BuildRequires: hipeigen BuildRequires: hcc BuildRequires: hcrng BuildRequires: hcfft BuildRequires: hipblas-devel BuildRequires: miopen-devel BuildRequires: rocblas-devel BuildRequires: rocm-runtime-devel Requires: hipblas-devel Requires: miopen-devel Requires: rocblas-devel Requires: hcrng Requires: hcfft Requires: hipeigen %{!?enable_devtoolset7: %define enable_devtoolset7 %{nil}} %if 0%{?rhel} == 7 BuildRequires: devtoolset-7-build BuildRequires: devtoolset-7-gcc BuildRequires: numpy BuildRequires: python-pip %enable_devtoolset7 %else BuildRequires: python-numpy %endif %description HIP enabled tensorflow %prep #%%setup -c -T -a 1 -n bazel-0.10.1 %setup -n hiptensorflow-%{commit} %patch0 -p1 -b .fedora0 %patch1 -p1 -b .fedora1 %patch2 -p1 -b .fedora2 %build bash %{SOURCE2} --user #cd ../bazel-0.10.1 #./compile.sh #export PATH="$PATH:`pwd`/output" cd ../hiptensorflow-%{commit} # The configure script is interactive unless you specify the necesary values via # environment variables. export PYTHON_BIN_PATH=/usr/bin/python export CC_OPT_FLAGS=" " export TF_NEED_JEMALLOC=1 export TF_NEED_GCP=0 export TF_NEED_HDFS=0 export TF_ENABLE_XLA=0 export PYTHON_LIB_PATH=/usr/lib64/python2.7/site-packages export TF_NEED_OPENCL=0 export TF_NEED_CUDA=0 export TF_NEED_HIP=1 export HIP_PATH=/usr/ export HIP_LIBRARY_PATH=%{_libdir} export HIP_LIBRARY_PATH=/usr/lib64 export HIP_EIGEN_PATH=/usr/share/eigen3 export _HIP_LIB_PATH=/usr/lib64 export HCC_HOME=/usr/bin export TF_GPU_PLATFORM="AMD" export PATH=$HOME/bin:$PATH ./configure bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg %install pip install --prefix %{buildroot}/usr /tmp/tensorflow_pkg/tensorflow*.whl %files %doc README.ROCm.md %license LICENSE %{_bindir}/* %{_libdir}/* /usr/lib/* %changelog * Wed Mar 14 2018 Tom Stellard - 1.0.1-0.2.20180302gitafd90f1 - Add epel support * Fri Mar 02 2018 Tom Stellard - 1.0.1-0.1.20180302gitafd90f1 - 1.0.1 git snapshot