%global commit e4efe6ac05a9f7188bd4996e2f3c1354b7b15c8b %global shortcommit %(c=%{commit}; echo ${c:0:7}) # This package only contains header files. %global debug_package %{nil} Name: hipeigen Version: 3.3.3 Release: 0.3.20170227git%{shortcommit}%{?dist} Summary: hip based eigen library License: MPL URL: https://github.com/ROCmSoftwarePlatform/hipeigen Source0: https://github.com/ROCmSoftwarePlatform/hipeigen/archive/%{commit}/%{name}-%{shortcommit}.tar.gz BuildRequires: cmake BuildRequires: hip %{!?enable_llvmtoolset7: %define enable_llvmtoolset7 %{nil}} %{!?enable_devtoolset7: %define enable_devtoolset7 %{nil}} %if 0%{?rhel} == 7 # FIXME: Manually define enable_llvmtoolset7 until llvm-toolset-7-5.0.1 is # available %enable_llvmtoolset7 %global ___build_pre %{___build_pre}; source scl_source enable llvm-toolset-7 || : BuildRequires: llvm-toolset-7-cmake BuildRequires: llvm-toolset-7-runtime BuildRequires: devtoolset-7-build %enable_llvmtoolset7 %enable_devtoolset7 %global __cmake cmake %endif %description hip based eigen library %prep %autosetup -n hipeigen-%{commit} -p1 %build mkdir build cd build # hcc does not support the default CXXFLAGS, so we can't use the cmake macro: cmake .. \ -DCMAKE_BUILD_TYPE=RELWITHDEBINFO \ -DCMAKE_INSTALL_PREFIX=/usr/ \ -DEIGEN_TEST_HIP=OFF make %{?_smp_mflags} %install cd build %make_install # hiptensorflow requires a directory layout like: # $ROOT/COPYING.MPL2 $ROOT/Eigen $ROOT/unsupported # So we need to create this layout somewhere on the filesystem cp ../COPYING.MPL2 %{buildroot}%{_datadir}/eigen3 ln -s %{_includedir}/eigen3/Eigen %{buildroot}%{_datadir}/eigen3 ln -s %{_includedir}/eigen3/unsupported %{buildroot}%{_datadir}/eigen3 # Move cmake files to the correct place: mkdir -p %{buildroot}%{_libdir}/cmake/ mv %{buildroot}{%{_datadir}/eigen3/cmake,%{_libdir}/cmake/eigen3} # FIXME: Where is the correct place for pkgconfig files? rm %{buildroot}%{_datadir}/pkgconfig/eigen3.pc %files %doc README.ROCm.md %{_includedir}/eigen3 %{_datadir}/eigen3 %{_libdir}/cmake/eigen3 %changelog * Tue Mar 13 2018 Tom Stellard - 3.3.3-0.3.20170227gite4efe6a - Add epel support * Wed Feb 28 2018 Tom Stellard - 3.3.3-0.2.20170227gite4efe6a - Use {_datadir}/eigen3 as eigen base directory for hiptensorflow * Tue Feb 27 2018 Tom Stellard - 3.3.3-0.1.20180227gite4efe6a - 3.3.3 Release