summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 352b6a091f47d501250f4a5e4a997ec210701d20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer: Neurofibromin <125222560+Neurofibromin@users.noreply.github.com>
# Contributor: acxz <akashpatel2008 at yahoo dot com>
# Contributor: codyfish <fe27 at gmx dot net>
# Contributor: sofiageo <george at sofianos dot dev>
pkgname=rocm-validation-suite
pkgver=7.2.3
pkgrel=2
pkgdesc="Tool for monitoring, stress testing, detecting, and troubleshooting AMD GPU issues"
arch=('x86_64')
url="https://github.com/ROCm/ROCmValidationSuite"
license=('MIT')
depends=('amdsmi' 'hip-runtime-amd' 'hipblaslt' 'hiprand' 'hsa-rocr' 'openmp'
         'pciutils' 'rocblas' 'yaml-cpp')
makedepends=('cmake' 'doxygen' 'git' 'rocrand')
options=(!lto)
_mxdatagenerator_commit='12c016dc694139317feb2e23c59028fde70beaf4'
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/rocm-$pkgver.tar.gz"
        "mxDataGenerator-$_mxdatagenerator_commit.tar.gz::https://github.com/ROCm/mxDataGenerator/archive/$_mxdatagenerator_commit.tar.gz"
        'mxdatagenerator-optional-download.patch'
        'rvslib-explicit-linking.patch')
sha256sums=('363009b394350a2ae1d8debe7092c96ab5aa2b183487aed6834580979e969c8c'
            'a0c0a78684da2d26ee883ccc632c8f51a4b00cfd3915707f9675cc8c0cf96483'
            'a25f9e476b5d9956d7b1d2c9ec7d0dd98c8b157ae3890af9ecfabd56083d73ff'
            '1ae036887dc3bdd330ebe4583e7da37d90192f43db5bfe62713fe4ebec39150e')
_srcdir="ROCmValidationSuite-rocm-$pkgver"
_mxdatagenerator_dir="mxDataGenerator-$_mxdatagenerator_commit"

prepare() {
  cd "$_srcdir"
  patch -Np1 -i "$srcdir/mxdatagenerator-optional-download.patch"
  patch -Np1 -i "$srcdir/rvslib-explicit-linking.patch"
}

build() {
  # -fcf-protection is not supported by HIP, see
  # https://docs.amd.com/bundle/ROCm-Compiler-Reference-Guide-v5.3/page/Appendix_A.html
  unset CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH

  CXXFLAGS+=" -fcf-protection=none" \
  cmake \
    -Wno-dev \
    -B build \
    -S "$_srcdir" \
    -DCMAKE_BUILD_TYPE=Release \
    -DROCM_PATH=/opt/rocm \
    -DCMAKE_INSTALL_PREFIX=/opt/rocm \
    -DCPACK_PACKAGING_INSTALL_PREFIX=/opt/rocm \
    -DMXDATAGENERATOR_INC_DIR="$srcdir/$_mxdatagenerator_dir/lib/include" \
    -DRVS_BUILD_TESTS=OFF \
    -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build

  install -Dm644 "$_srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}