%global rocm_version 1.7.0 Name: hip Version: 1.4 Release: 5.rocm%{rocm_version}%{?dist} Summary: Tool for porting CUDA to Portable C++ Code License: MIT URL: https://github.com/ROCm-Developer-Tools/HIP Source0: https://github.com/ROCm-Developer-Tools/HIP/archive/roc-%{rocm_version}.zip Patch0: 0001-Make-HIP_VERSION_PATCH-configurable.patch # hipconfig defaults to using the nvcc platform if it doesn't detect an hsa # enabled system, but we want to be able use non-HSA sytems for buliding # hip applications (e.g. koji builders), so we make hcc the default platform. Patch1: 0001-Make-hcc-the-default-platform.patch Patch2: 0001-Change-default-paths-to-match-Fedora-install-locatio.patch BuildRequires: cmake # Perl requried for hipconfig BuildRequires: perl BuildRequires: elfutils-libelf-devel BuildRequires: hcc = 1.1.17503 BuildRequires: rocm-runtime-devel %if 0%{?fedora} < 27 BuildRequires: perl-Getopt-Long %endif Requires: libstdc++-static Requires: perl-Getopt-Long Requires: hcc = 1.1.17503 %{!?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 %enable_llvmtoolset7 %global __cmake cmake %endif %description Tool for porting CUDA to Portable C++ Code %prep %autosetup -n HIP-roc-%{rocm_version} -p1 %build mkdir build cd build # FIXME: hipcc reads HCC_HOME from .hipInfo in order to find the path to # hcc. In order to add HCC_HOME to .hipInfo, we need to set the # HIP_DEVELOPER environment variable when configuring the source. # We should try to fix this. export HIP_DEVELOPER=1 # FIXME We aren't using cmake macro here, because it adds CXXFLAGS that hcc does # not support. cmake .. \ -DCMAKE_BUILD_TYPE=RELWITHDEBINFO \ -DHCC_HOME=/usr/ \ -DHSA_PATH=/usr/ \ -DHIP_VERSION_PATCH=` date --utc +%y%U%w` \ -DHIP_PLATFORM=hcc \ -DCMAKE_INSTALL_PREFIX=/usr %make_build %install # FIXME: The hip CMake file is setup to regenrate .hipInfo every time make # is run, so we need to re-define HIP_DEVELOPERS before we do make install. export HIP_DEVELOPER=1 cd build %make_install %if 0%{?__isa_bits} == 64 mkdir %{buildroot}%{_libdir} mv %{buildroot}/usr/lib/* %{buildroot}%{_libdir} mv %{buildroot}/usr/lib/.hipInfo %{buildroot}/%{_libdir} # Fix paths in hipcc sed -i s~HIP_PATH/lib~HIP_PATH/lib64~g %{buildroot}%{_bindir}/hipcc # Fix paths in cmake files sed -i s~/usr/lib~/usr/lib64~g %{buildroot}%{_libdir}/cmake/hip/* %endif # We don't want to ship the source files rm -Rf %{buildroot}/usr/src # cmake files shouldn't go in /usr/cmake mv %{buildroot}/usr/cmake/* %{buildroot}%{_libdir}/cmake/hip %files %doc %{_includedir}/* %{_bindir}/* %{_bindir}/.hipVersion %{_libdir}/* %{_libdir}/.hipInfo %{_libdir}/cmake/hip %changelog * Wed Mar 07 2018 Tom Stellard - 1.4-5.rocm1.7.0 - Enable debuginfo * Tue Mar 06 2018 Tom Stellard - 1.4-4.rocm1.7.0 - Add epel support * Mon Feb 26 2018 Tom Stellard - 1.4-3.rocm1.7.0 - Add Requries: hcc * Mon Feb 26 2018 Tom Stellard - 1.4-2.rocm1.7.0 - Change default paths to match Fedora install locastions * Fri Feb 23 2018 Tom Stellard - 1.4-1.rocm1.7.0 - ROCm 1.7.0 * Fri Feb 16 2018 Tom Stellard - 1.2-8.rocm1.6.0 - Package cmake files * Thu Feb 15 2018 Tom Stellard - 1.2-7.rocm1.6.0 - Fix assertion failure during build * Wed Dec 20 2017 Tom Stellard - 1.2-6.rocm1.6.0 - Update version to match upstream * Sat Dec 16 2017 Tom Stellard - 1.6.0-5 - Fix library paths in cmake files * Sat Dec 16 2017 Tom Stellard - 1.6.0-4 - Package cmake files * Fri Dec 15 2017 Tom Stellard - 1.6.0-3 - Add Requires: perl-Getopt-Long * Fri Dec 15 2017 Tom Stellard - 1.6.0-2 - Make hcc the default platform