%global rocm_version 2.0.0 %global hip_version_major 1 %global hip_version_minor 5 # This comes is generated by using the commit date of the most recent commit: # COMMIT_DATE=`git show -s --format=@%ct` # date -d $COMMIT_DATE --utc '+%y%U%w' %global hip_version_patch 18494 Name: hip Version: %{hip_version_major}.%{hip_version_minor}.%{hip_version_patch} Release: 1.rocm%{rocm_version}%{?dist} Summary: Tool for porting CUDA to Portable C++ Code License: MIT and Boost URL: https://github.com/ROCm-Developer-Tools/HIP Source0: https://github.com/ROCm-Developer-Tools/HIP/archive/roc-%{rocm_version}/hip-%{rocm_version}.tar.gz Patch0: 0001-Make-HIP_VERSION_PATCH-configurable.patch Patch1: 0001-Change-default-paths-to-match-Fedora-install-locatio.patch Patch2: 0001-Fix-install-path-for-libraries.patch Patch3: 0001-Move-.hipInfo-to-usr-share.patch Patch4: 0001-Set-default-path-for-device-lib.patch Patch5: 0001-Fix-HIP_CLANG_INCLUDE_PATH.patch Patch6: 0001-Move-hipVersion-to-usr-share.patch Patch7: 0001-Add-versions-to-shared-libraries.patch Patch8: 0001-Use-lib64-for-HIP_LIB_PATH.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. Patch9: 0001-Make-hcc-the-default-platform.patch Patch10: 0001-Change-hcc-include-path-to-usr-include-hcc.patch Patch11: 0001-hipconfig-Remove-some-more-hard-coded-paths.patch ExclusiveArch: x86_64 aarch64 BuildRequires: cmake # Perl requried for hipconfig BuildRequires: perl BuildRequires: elfutils-libelf-devel BuildRequires: rocm-runtime-devel BuildRequires: hcc # Need because the hcc runtime libraries have enabled excutable stacks. BuildRequires: execstack Requires: libstdc++-static Requires: perl-Getopt-Long Requires: hcc Requires: rocm-device-libs Requires: rocminfo Requires: coreutils Requires: grep Requires: hip-runtime-devel # hipcc uses gcc, gcc-c++ to find gcc include paths for older gcc versions # FIXME: We should try to fix this upstream Requires: gcc Requires: gcc-c++ # hipdemangleatp.sh Requires these: Requires: binutils Requires: sed Provides: bundled(clara) %description Tool for porting CUDA to Portable C++ Code %package runtime Summary: hip runtime libraries %description runtime hip runtime libraries %package runtime-devel Summary: Development files for HCC runtime libraries Requires: %{name}-runtime%{?_isa} = %{version}-%{release} Requires: rocm-runtime-devel%{?_isa} %description runtime-devel Development files for hip runtime libraries %prep %autosetup -n HIP-roc-%{rocm_version} -p1 %build mkdir build cd build # Filter out cflags not supported by hcc %global optflags %(echo %{optflags} | sed -e 's/-mcet//g' -e 's/-fcf-protection//g' -e 's/-fstack-clash-protection//g') # FIXME: I would prefer to use clang for the HIP_COMPILER, but clang 7.0.1 is not supported # by this build of HIP. %cmake .. \ -DHCC_HOME=%{_prefix} \ -DHSA_PATH=%{_prefix} \ -DHIP_VERSION_PATCH=%{hip_version_patch} \ -DHIP_COMPILER=hcc \ -DCMAKE_INSTALL_PREFIX=%{_prefix} %make_build %install %make_install -C build # We don't want to ship the source files rm -Rf %{buildroot}/usr/src # cmake files shouldn't go in /usr/cmake mkdir -p %{buildroot}%{_libdir}/cmake/hip mv %{buildroot}/usr/cmake/* %{buildroot}%{_libdir}/cmake/hip # Disable executable stack for runtime libraries. execstack -c %{buildroot}%{_libdir}/libhip_hcc.so.%{hip_version_major}.%{hip_version_minor} # Remove scripts that depend on hipify-clang rm %{buildroot}%{_bindir}/hipexamine.sh rm %{buildroot}%{_bindir}/hipconvertinplace.sh # Move some utilities to libexec mkdir -p %{buildroot}%{_libexecdir}/hip for f in finduncodep.sh ca hipcc_cmake_linker_helper lpl hipexamine-perl.sh hipconvertinplace-perl.sh findcode.sh; do mv %{buildroot}{%{_bindir}/$f,%{_libexecdir}/hip} done # Remove static library rm %{buildroot}%{_libdir}/libhip_hcc_static.a %files %license LICENSE %doc #lpl is MIT and Boost %{_bindir}/* %{_datadir}/hip/ %{_libexecdir}/hip/ %files runtime %{_libdir}/libhip_hcc.so.%{hip_version_major}.%{hip_version_minor} %files runtime-devel %{_includedir}/* %{_libdir}/libhip_hcc.so %{_libdir}/cmake/hip %changelog * Fri Jan 18 2019 Tom Stellard - 1.5.18494-1.rocm2.0.0 - ROCm 2.0 release * Wed Oct 10 2018 Tom Stellard - 1.4-7.rocm1.9.1 - Upgrade to latest version from git master * Thu Aug 23 2018 Tom Stellard - 1.4-6.rocm1.7.0 - Use clang as the hip compiler * 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