%global rocm_version 2.5.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 19373 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: 0002-Change-default-paths-to-match-Fedora-install-locatio.patch Patch2: 0003-Remove-redundant-install-targets.patch Patch3: 0004-Fix-library-install-paths.patch Patch4: 0005-Move-.hipInfo-to-usr-share.patch Patch5: 0006-Set-default-path-for-device-lib.patch Patch6: 0007-Fix-HIP_CLANG_INCLUDE_PATH.patch Patch7: 0008-Move-hipVersion-to-usr-share.patch Patch8: 0009-Add-versions-to-shared-libraries.patch Patch9: 0010-Use-lib64-for-HIP_LIB_PATH.patch Patch10: 0011-Change-hcc-include-path-to-usr-include-hcc.patch Patch11: 0012-hipconfig-Remove-some-more-hard-coded-paths.patch # AArch64 disabled, because hcc crashes when building hip on AArch64. ExclusiveArch: x86_64 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 # We need python3-devel for pathfix.py. BuildRequires: python3-devel 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-static Summary: static runtime libraries for hip %description runtime-static static runtime libraries for hip %package runtime-devel Summary: Development files for HCC runtime libraries Requires: %{name}-runtime%{?_isa} = %{version}-%{release} Requires: %{name}-runtime-static%{?_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 pathfix.py -i %{__python3} -pn \ hip_prof_gen.py 2to3 -w hip_prof_gen.py %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 %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-static %{_libdir}/libhip_hcc_static.a %files runtime-devel %{_includedir}/* %{_libdir}/libhip_hcc.so %{_libdir}/cmake/hip %changelog * Wed Jul 03 2019 Tom Stellard - 1.5.18494-1.rocm2.0.0 - ROCm 2.0.0 release