summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoracxz2020-06-22 20:50:29 -0400
committeracxz2020-06-22 20:50:29 -0400
commit988182e710c9e86159b46c5deb276bbb1dd21e9c (patch)
treef658a53dcbd60b31aa0f7b233b112eb785c31d0f
parentd315d0cd8c6bb231ef836ce527f4fe09879c97ff (diff)
downloadaur-988182e710c9e86159b46c5deb276bbb1dd21e9c.tar.gz
[hip-nvcc] fix missing hipinfo install
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD17
-rw-r--r--hipinfo.patch68
3 files changed, 82 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 59421377b5b..14d32a8dfca 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = hip-nvcc
pkgdesc = Heterogeneous Interface for Portability ROCm
pkgver = 3.5.1
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/ROCm-Developer-Tools/HIP
arch = x86_64
license = MIT
@@ -11,7 +11,9 @@ pkgbase = hip-nvcc
provides = hip
conflicts = hip
source = hip-nvcc-3.5.1.tar.gz::https://github.com/ROCm-Developer-Tools/HIP/archive/rocm-3.5.1.tar.gz
+ source = hipinfo.patch
sha256sums = f91cf5ef846b6b916d0258a967b6cb63e236dd777eb0e01c88337d72b5bde000
+ sha256sums = f94d8b2426d5f8eecd420698a2b7f3d66ddc0531afe313a572f0b644f6e45b64
pkgname = hip-nvcc
diff --git a/PKGBUILD b/PKGBUILD
index 977434bd6fd..0e2ea2643e5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: acxz <akashpatel2008 at yahoo dot com>
pkgname=hip-nvcc
pkgver=3.5.1
-pkgrel=2
+pkgrel=3
pkgdesc="Heterogeneous Interface for Portability ROCm"
arch=('x86_64')
url="https://github.com/ROCm-Developer-Tools/HIP"
@@ -11,18 +11,23 @@ depends=('cuda')
provides=('hip')
conflicts=('hip')
_git='https://github.com/ROCm-Developer-Tools/HIP'
-source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz")
-sha256sums=('f91cf5ef846b6b916d0258a967b6cb63e236dd777eb0e01c88337d72b5bde000')
+source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz"
+ "hipinfo.patch")
+sha256sums=('f91cf5ef846b6b916d0258a967b6cb63e236dd777eb0e01c88337d72b5bde000'
+ 'f94d8b2426d5f8eecd420698a2b7f3d66ddc0531afe313a572f0b644f6e45b64')
+
+prepare() {
+ cd "${srcdir}/HIP-rocm-$pkgver"
+ patch --forward --strip=1 --input="${srcdir}/hipinfo.patch"
+}
build() {
cmake -B build -Wno-dev \
-DCMAKE_INSTALL_PREFIX=/opt/rocm/hip \
+ -DHIP_PLATFORM=nvcc \
-DHIP_COMPILER=clang \
"$srcdir/HIP-rocm-$pkgver"
make -C build
-
- # https://github.com/rocm-arch/rocm-arch/issues/263
- sed -i '/hipInfo/d' $srcdir/build/cmake_install.cmake
}
package() {
diff --git a/hipinfo.patch b/hipinfo.patch
new file mode 100644
index 00000000000..910b17afdc1
--- /dev/null
+++ b/hipinfo.patch
@@ -0,0 +1,68 @@
+diff --unified --recursive --text HIP-rocm-3.5.1/bin/hipconfig HIP-rocm-3.5.1.new/bin/hipconfig
+--- HIP-rocm-3.5.1/bin/hipconfig 2020-06-16 11:44:26.000000000 -0400
++++ HIP-rocm-3.5.1.new/bin/hipconfig 2020-06-22 20:44:28.932530458 -0400
+@@ -96,12 +96,12 @@
+ $HIP_INFO_PATH= "$HIP_PATH/lib/.hipInfo"; # use actual file
+ }
+ #---
+-#HIP_PLATFORM controls whether to use NVCC or HCC for compilation:
+-$HIP_PLATFORM=$ENV{'HIP_PLATFORM'};
+ # Read .hipInfo
+ my %hipInfo = ();
+ parse_config_file("$HIP_INFO_PATH", \%hipInfo);
+ # Prioritize Env first, otherwise use the hipInfo config file
++#HIP_PLATFORM controls whether to use NVCC or HCC for compilation:
++$HIP_PLATFORM = $ENV{'HIP_PLATFORM'} // $hipInfo{'HIP_PLATFORM'} // "hcc";
+ $HIP_COMPILER = $ENV{'HIP_COMPILER'} // $hipInfo{'HIP_COMPILER'} // "hcc";
+ $HIP_RUNTIME = $ENV{'HIP_RUNTIME'} // $hipInfo{'HIP_RUNTIME'} // "HCC";
+
+diff --unified --recursive --text HIP-rocm-3.5.1/CMakeLists.txt HIP-rocm-3.5.1.new/CMakeLists.txt
+--- HIP-rocm-3.5.1/CMakeLists.txt 2020-06-16 11:44:26.000000000 -0400
++++ HIP-rocm-3.5.1.new/CMakeLists.txt 2020-06-22 20:43:27.635570691 -0400
+@@ -106,6 +106,7 @@
+ endif()
+ endif()
+ message(STATUS "HIP Platform: " ${HIP_PLATFORM})
++add_to_config(_buildInfo HIP_PLATFORM)
+
+ # Determine HIP_COMPILER
+ # Either hcc or clang; default is hcc
+@@ -300,7 +301,6 @@
+
+ include_directories(${PROJECT_SOURCE_DIR}/include)
+ add_subdirectory(rocclr)
+- file(WRITE "${PROJECT_BINARY_DIR}/.hipInfo" ${_buildInfo})
+
+
+ # set(ROCclr_CXX_FLAGS "-hc -fno-gpu-rdc --amdgpu-target=gfx803 --amdgpu-target=gfx900 --amdgpu-target=gfx906 --amdgpu-target=gfx908 ")
+@@ -404,14 +404,15 @@
+ else()
+ target_link_libraries(device INTERFACE host)
+ endif()
+-
+- # Generate .hipInfo
+- file(WRITE "${PROJECT_BINARY_DIR}/.hipInfo" ${_buildInfo})
+ endif()
+
+ if(HIP_PLATFORM STREQUAL "hcc" OR HIP_PLATFORM STREQUAL "rocclr")
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lpl_ca)
+ endif()
++
++# Generate .hipInfo
++file(WRITE "${PROJECT_BINARY_DIR}/.hipInfo" ${_buildInfo})
++
+ # Generate .hipVersion
+ file(WRITE "${PROJECT_BINARY_DIR}/.hipVersion" ${_versionInfo})
+
+@@ -445,11 +446,6 @@
+ endif()
+
+ # Install .hipInfo
+-if(HIP_PLATFORM STREQUAL "hcc" OR HIP_PLATFORM STREQUAL "rocclr")
+- install(FILES ${PROJECT_BINARY_DIR}/.hipInfo DESTINATION lib)
+-endif()
+-
+-# Install .hipInfo
+ install(FILES ${PROJECT_BINARY_DIR}/.hipInfo DESTINATION lib)
+
+ # Install .hipVersion