You are not logged in.
Hello,
Could anyone please update rocm-opencl-runtime AUR package? Current 2.10 is out of date and new one 3.0 is already available. I would do it myself, but I'm not a tech guy and don't know how to do that
Offline
The rocl-thunk-interface and rcor-runtime pacakges have been updated to 3.0.0.
The rocm-opencl-runtime has some special stuff, but doesn't look complicated to change.
build those 2 dependencies , install them.
In the rocr-opencl-runtime PKGBUILD change pkgver to 3.0.0 , then try building with
makepkg --cleanbuild --log
If build fails, post the log files.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
@Lone_wolf there is no 3.0.0 of https://github.com/RadeonOpenCompute/ROCm-OpenCL-Driver any ideas on what should go in opencl/compiler/driver ?
opencl/compiler/llvm appears to be the llvm directory from https://github.com/RadeonOpenCompute/ll … -${pkgver}
Edit:
Added failing PKGBUILD and output from makepkg
# Maintainer: Ranieri Althoff <ranisalt+aur at gmail dot com>
_opencl_icd_loader_commit="978b4b3a29a3aebc86ce9315d5c5963e88722d03"
pkgname=rocm-opencl-runtime
pkgver=3.0.0
pkgrel=1
pkgdesc='ROCm OpenCL™ Compatible Runtime'
arch=('x86_64')
url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime'
license=('MIT')
depends=("rocr-runtime>=${pkgver}" 'opencl-icd-loader')
makedepends=(mesa cmake ninja git repo)
provides=("${pkgname}" 'opencl-driver')
conflicts=('rocm-opencl-git')
source=(
"rocm-opencl-runtime::git+https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime#tag=roc-${pkgver}"
"llvm-project::git+https://github.com/RadeonOpenCompute/llvm-project.git#tag=roc-ocl-${pkgver}"
# "rocm-opencl-driver::git+https://github.com/RadeonOpenCompute/ROCm-OpenCL-Driver#tag=roc-${pkgver}"
# "llvm-ocl-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/llvm/archive/roc-ocl-${pkgver}.tar.gz"
# "clang-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/clang/archive/roc-${pkgver}.tar.gz"
# "lld-ocl-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/lld/archive/roc-ocl-${pkgver}.tar.gz"
"rocm-device-libs::git+https://github.com/RadeonOpenCompute/ROCm-Device-Libs#tag=roc-ocl-${pkgver}"
"opencl-icd-loader::git+https://github.com/KhronosGroup/OpenCL-ICD-Loader#commit=${_opencl_icd_loader_commit}"
# 'fix_rocm_opencl_build_order.patch'
)
sha256sums=('SKIP'
'SKIP'
'SKIP'
'SKIP')
prepare() {
# emulate repo opencl.xml layout
cd "$srcdir"
ln -s "$srcdir/rocm-opencl-runtime" opencl
ln -s "$srcdir/llvm-project/llvm" opencl/compiler/llvm
# mkdir -p "$srcdir/opencl/compiler"
# ln -s "$srcdir/rocm-opencl-driver" opencl/compiler/driver
# ln -s "$srcdir/llvm-roc-ocl-$pkgver" opencl/compiler/llvm
# mkdir -p "$srcdir/opencl/compiler/llvm/tools"
# ln -s "$srcdir/clang-roc-$pkgver" opencl/compiler/llvm/tools/clang
# ln -s "$srcdir/lld-roc-ocl-$pkgver" opencl/compiler/llvm/tools/lld
mkdir -p "$srcdir/opencl/library"
ln -s "$srcdir/rocm-device-libs" opencl/library/amdgcn
mkdir -p "$srcdir/opencl/api/opencl/khronos"
ln -s "$srcdir/opencl-icd-loader" opencl/api/opencl/khronos/icd
# # Fix build missing dependency
# # https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/issues/64#issuecomment-473502685
# cd "$srcdir/opencl"
# patch -Np1 -i "${srcdir}/fix_rocm_opencl_build_order.patch"
}
build() {
mkdir -p "$srcdir/build"
cd "$srcdir/build"
if check_buildoption "ccache" "y"; then
CMAKE_FLAGS="-DROCM_CCACHE_BUILD=ON"
fi
cmake $CMAKE_FLAGS \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/rocm/opencl \
-DCLANG_ENABLE_STATIC_ANALYZER=ON \
-G Ninja \
"$srcdir/opencl"
# building LLVM/Clang requires ~1.5G per unit
THREADS=$(( ($(getconf _PHYS_PAGES) * $(getconf PAGESIZE)) / 1610612736 ))
if [ "$THREADS" -lt 1 ]; then
THREADS=1
fi
ninja "-j$THREADS"
# FIXME Check why lld has to built manually since 2.3.0
ninja lld
}
package() {
DESTDIR="$pkgdir/" ninja -C "$srcdir/build" install
# OpenCL vendor file
mkdir -p "$pkgdir/etc/OpenCL/vendors"
echo "/opt/rocm/opencl/lib/x86_64/libamdocl64.so" > "$pkgdir/etc/OpenCL/vendors/rocm-opencl64.icd"
mkdir -p "$pkgdir/etc/ld.so.conf.d"
echo "/opt/rocm/opencl/lib" > "$pkgdir/etc/ld.so.conf.d/rocm-opencl.conf"
# Discard AMD's OpenCL ICD Loader
# https://wiki.archlinux.org/index.php/GPGPU#OpenCL_ICD_loader_(libOpenCL.so)
rm -f "$pkgdir"/opt/rocm/opencl/lib/x86_64/libOpenCL.so*
}
==> Retrieving sources...
==> WARNING: Skipping all source file integrity checks.
==> Extracting sources...
-> Creating working copy of rocm-opencl-runtime git repo...
Cloning into 'rocm-opencl-runtime'...
done.
Switched to a new branch 'makepkg'
-> Creating working copy of llvm-project git repo...
Cloning into 'llvm-project'...
done.
Updating files: 100% (89756/89756), done.
Switched to a new branch 'makepkg'
-> Creating working copy of rocm-device-libs git repo...
Cloning into 'rocm-device-libs'...
done.
Switched to a new branch 'makepkg'
-> Creating working copy of opencl-icd-loader git repo...
Cloning into 'opencl-icd-loader'...
done.
Switched to a new branch 'makepkg'
==> Starting prepare()...
==> Starting build()...
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ROCT: /opt/rocm/include
-- Found ROCR: /opt/rocm/hsa/include/hsa
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Could NOT find Z3: Found unsuitable version "0.0.0", but required is at least "4.7.1" (found Z3_LIBRARIES-NOTFOUND)
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for link.h
-- Looking for link.h - found
-- Looking for malloc/malloc.h
-- Looking for malloc/malloc.h - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - found
-- Looking for sys/mman.h
-- Looking for sys/mman.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for termios.h
-- Looking for termios.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for valgrind/valgrind.h
-- Looking for valgrind/valgrind.h - not found
-- Looking for zlib.h
-- Looking for zlib.h - found
-- Looking for fenv.h
-- Looking for fenv.h - found
-- Looking for FE_ALL_EXCEPT
-- Looking for FE_ALL_EXCEPT - found
-- Looking for FE_INEXACT
-- Looking for FE_INEXACT - found
-- Looking for mach/mach.h
-- Looking for mach/mach.h - not found
-- Looking for histedit.h
-- Looking for histedit.h - found
-- Looking for CrashReporterClient.h
-- Looking for CrashReporterClient.h - not found
-- Looking for linux/magic.h
-- Looking for linux/magic.h - found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Looking for pthread_getspecific in pthread
-- Looking for pthread_getspecific in pthread - found
-- Looking for pthread_rwlock_init in pthread
-- Looking for pthread_rwlock_init in pthread - found
-- Looking for pthread_mutex_lock in pthread
-- Looking for pthread_mutex_lock in pthread - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for pfm_initialize in pfm
-- Looking for pfm_initialize in pfm - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for compress2 in z
-- Looking for compress2 in z - found
-- Looking for el_init in edit
-- Looking for el_init in edit - found
-- Looking for setupterm in terminfo
-- Looking for setupterm in terminfo - not found
-- Looking for setupterm in tinfo
-- Looking for setupterm in tinfo - found
-- Found LibXml2: /usr/lib/libxml2.so (found version "2.9.10")
-- Looking for xar_open in xar
-- Looking for xar_open in xar - not found
-- Looking for arc4random
-- Looking for arc4random - not found
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /usr/include
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Looking for _Unwind_Backtrace
-- Looking for _Unwind_Backtrace - found
-- Looking for getpagesize
-- Looking for getpagesize - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for setrlimit
-- Looking for setrlimit - found
-- Looking for isatty
-- Looking for isatty - found
-- Looking for futimens
-- Looking for futimens - found
-- Looking for futimes
-- Looking for futimes - found
-- Looking for posix_fallocate
-- Looking for posix_fallocate - found
-- Looking for sigaltstack
-- Looking for sigaltstack - found
-- Looking for lseek64
-- Looking for lseek64 - found
-- Looking for mallctl
-- Looking for mallctl - not found
-- Looking for mallinfo
-- Looking for mallinfo - found
-- Looking for malloc_zone_statistics
-- Looking for malloc_zone_statistics - not found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for posix_spawn
-- Looking for posix_spawn - found
-- Looking for pread
-- Looking for pread - found
-- Looking for sbrk
-- Looking for sbrk - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strerror_r
-- Looking for strerror_r - found
-- Looking for strerror_s
-- Looking for strerror_s - not found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for dladdr
-- Looking for dladdr - not found
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC - Failed
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC - Success
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - found
-- Looking for sched_getaffinity
-- Looking for sched_getaffinity - found
-- Looking for CPU_COUNT
-- Looking for CPU_COUNT - found
-- Looking for pthread_getname_np
-- Looking for pthread_getname_np - found
-- Looking for pthread_setname_np
-- Looking for pthread_setname_np - found
-- Performing Test HAVE_STD_IS_TRIVIALLY_COPYABLE
-- Performing Test HAVE_STD_IS_TRIVIALLY_COPYABLE - Success
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Success
-- Performing Test LLVM_HAS_ATOMICS
-- Performing Test LLVM_HAS_ATOMICS - Success
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG - Success
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Failed
-- Performing Test HAS_MAYBE_UNINITIALIZED
-- Performing Test HAS_MAYBE_UNINITIALIZED - Success
-- Native target X86 is not selected; lli will not JIT code
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Ninja version: 1.9.0
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- Could NOT find Python module pygments
-- Could NOT find Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- LLVM host triple: x86_64-unknown-linux-gnu
-- LLVM default target triple: x86_64-unknown-linux-gnu
/usr/bin/ar: creating t.a
-- Performing Test C_SUPPORTS_FPIC
-- Performing Test C_SUPPORTS_FPIC - Success
-- Performing Test CXX_SUPPORTS_FPIC
-- Performing Test CXX_SUPPORTS_FPIC - Success
-- Building with -fPIC
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
-- Performing Test SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG - Success
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME
-- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME
-- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG
-- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success
-- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
-- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG
-- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
-- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Failed
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG
-- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG - Success
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG
-- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG - Success
-- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
-- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Failed
-- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG
-- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP
-- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Failed
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Failed
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG
-- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Failed
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS
-- Performing Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS - Failed
-- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS
-- Performing Test C_SUPPORTS_FNO_FUNCTION_SECTIONS - Success
-- Performing Test C_SUPPORTS_FFUNCTION_SECTIONS
-- Performing Test C_SUPPORTS_FFUNCTION_SECTIONS - Success
-- Performing Test CXX_SUPPORTS_FFUNCTION_SECTIONS
-- Performing Test CXX_SUPPORTS_FFUNCTION_SECTIONS - Success
-- Performing Test C_SUPPORTS_FDATA_SECTIONS
-- Performing Test C_SUPPORTS_FDATA_SECTIONS - Success
-- Performing Test CXX_SUPPORTS_FDATA_SECTIONS
-- Performing Test CXX_SUPPORTS_FDATA_SECTIONS - Success
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Found PythonInterp: /usr/bin/python (found version "3.8.1")
-- Constructing LLVMBuild project information
-- Found Git: /usr/bin/git (found version "2.24.1")
-- Linker detection: GNU ld
-- Targeting AMDGPU
-- Failed to find LLVM FileCheck
-- Version: 0.0.0
-- Performing Test HAVE_CXX_FLAG_STD_CXX11
-- Performing Test HAVE_CXX_FLAG_STD_CXX11 - Success
-- Performing Test HAVE_CXX_FLAG_WALL
-- Performing Test HAVE_CXX_FLAG_WALL - Success
-- Performing Test HAVE_CXX_FLAG_WEXTRA
-- Performing Test HAVE_CXX_FLAG_WEXTRA - Success
-- Performing Test HAVE_CXX_FLAG_WSHADOW
-- Performing Test HAVE_CXX_FLAG_WSHADOW - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC
-- Performing Test HAVE_CXX_FLAG_PEDANTIC - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS - Success
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Failed
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL - Success
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_FNO_EXCEPTIONS
-- Performing Test HAVE_CXX_FLAG_FNO_EXCEPTIONS - Success
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WD654
-- Performing Test HAVE_CXX_FLAG_WD654 - Failed
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Failed
-- Performing Test HAVE_CXX_FLAG_COVERAGE
-- Performing Test HAVE_CXX_FLAG_COVERAGE - Success
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Linker detection: GNU ld
CMake Deprecation Warning at library/amdgcn/OCL.cmake:12 (cmake_policy):
The OLD behavior for policy CMP0053 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
library/amdgcn/CMakeLists.txt:62 (include)
CMake Error at CMakeLists.txt:65 (add_subdirectory):
add_subdirectory given source "compiler/driver" which is not an existing
directory.
-- Looking for secure_getenv
-- Looking for secure_getenv - found
-- Looking for __secure_getenv
-- Looking for __secure_getenv - not found
CMake Error at CMakeLists.txt:100 (include):
include could not find load file:
ROCMSetupVersion
CMake Error at CMakeLists.txt:101 (rocm_setup_version):
Unknown CMake command "rocm_setup_version".
-- Configuring incomplete, errors occurred!
See also "/build/rocm-opencl-runtime/src/build/CMakeFiles/CMakeOutput.log".
See also "/build/rocm-opencl-runtime/src/build/CMakeFiles/CMakeError.log".
==> ERROR: A failure occurred in build().
Aborting...
Edit2:
PKGBUILD I am using for rocm-cmake https://bbs.archlinux.org/viewtopic.php … 9#p1880949 contains PKGBUILDs for roct-thunk-interface and rocr-runtime
pkgname='rocm-cmake'
pkgver='3.0.0'
pkgrel=1
pkgdesc='Provides cmake modules for common build tasks needed for the ROCM software stack'
arch=('any')
url='https://github.com/RadeonOpenCompute/rocm-cmake'
license=('MIT')
makedepends=(cmake ninja git)
source=("git+https://github.com/RadeonOpenCompute/rocm-cmake.git#tag=roc-${pkgver}")
sha256sums=('SKIP')
build() {
cmake -B build -G Ninja \
$pkgname
ninja -C build
}
package() {
DESTDIR="$pkgdir/" ninja -C build install
}
Last edited by loqs (2020-01-04 19:01:27)
Offline
Looks like they stopped with ROCm-OpenCL-Driver at version 2.10 .
DEPRECATION NOTICE
AMD is deprecating ROCm-OpenCL-Driver. We will no longer develop any new feature in ROCm-OpenCL-Driver and we will stop maintaining it after its final release, which is planned for December 2019. If your application was developed with the ROCm-OpenCL-Driver, we would encourage you to transition it to ROCm-CompilerSupport, which provides similar functionality.
Sofar I've stayed away of Rocm on purpose as it seemed to be heavily in flux and requiring custom builds of llvm/clang versions.
Guess we'll need a ROCm-CompilerSupport package to replace rocm-opencl-runtime .
Ktatar156, loqs, continue here or in the other thread ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
Looks like they stopped with ROCm-OpenCL-Driver at version 2.10 .
DEPRECATION NOTICE
AMD is deprecating ROCm-OpenCL-Driver. We will no longer develop any new feature in ROCm-OpenCL-Driver and we will stop maintaining it after its final release, which is planned for December 2019. If your application was developed with the ROCm-OpenCL-Driver, we would encourage you to transition it to ROCm-CompilerSupport, which provides similar functionality.
Sofar I've stayed away of Rocm on purpose as it seemed to be heavily in flux and requiring custom builds of llvm/clang versions.
Guess we'll need a ROCm-CompilerSupport package to replace rocm-opencl-runtime .Ktatar156, loqs, continue here or in the other thread ?
So we should have now rocm-compilersupport - could anyone create such package in AUR?
Offline
PKGBUILD for rocm-compilersupport (which does not work)
pkgname='rocm-compilersupport'
pkgver='3.0.0'
pkgrel=1
pkgdesc='Provides cmake modules for common build tasks needed for the ROCM software stack'
arch=('any')
url='https://github.com/RadeonOpenCompute/ROCm-CompilerSupport'
license=('MIT')
makedepends=(cmake clang llvm lld ninja git)
source=("rocm-compilersupport::git+https://github.com/RadeonOpenCompute/ROCm-CompilerSupport.git#tag=roc-${pkgver}")
sha256sums=('SKIP')
build() {
export CC=clang
export CXX=clang++
cmake -B build -G Ninja \
$pkgname/lib/comgr
ninja -C build
}
package() {
DESTDIR="$pkgdir/" ninja -C build install
}
makepkg output
==> Starting build()...
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find ROCM (missing: ROCM_DIR)
-- Could NOT find AMDDeviceLibs (missing: AMDDeviceLibs_DIR)
------------LLVM_DIR: /usr/lib/cmake/llvm
---LLVM_INCLUDE_DIRS: /usr/include
---LLVM_LIBRARY_DIRS: /usr/lib
-----------Clang_DIR: /usr/lib64/cmake/clang
--CLANG_INCLUDE_DIRS: /usr/include
----LLD_INCLUDE_DIRS:
---AMDDeviceLibs_DIR: AMDDeviceLibs_DIR-NOTFOUND
-- Configuring done
-- Generating done
-- Build files have been written to: /build/rocm-compilersupport/src/build
ninja: Entering directory `build'
[1/54] Generating reloc1.o
[2/54] Generating shared.so
[3/54] Generating shared-v3.so
[4/54] Generating reloc2.o
[5/54] Generating reloc-asm.o
[6/54] Building C object test/CMakeFiles/options_test.dir/options_test.c.o
[7/54] Building CXX object CMakeFiles/amd_comgr.dir/src/comgr-env.cpp.o
[8/54] Building C object test/CMakeFiles/disasm_options_test.dir/disasm_options_test.c.o
[9/54] Building C object test/CMakeFiles/isa_name_parsing_test.dir/isa_name_parsing_test.c.o
[10/54] Building C object test/CMakeFiles/disasm_llvm_so_test.dir/disasm_llvm_so_test.c.o
[11/54] Building C object test/CMakeFiles/disasm_llvm_reloc_test.dir/disasm_llvm_reloc_test.c.o
[12/54] Building C object test/CMakeFiles/include_subdirectory_test.dir/include_subdirectory_test.c.o
[13/54] Building C object test/CMakeFiles/metadata_msgpack_test.dir/metadata_msgpack_test.c.o
[14/54] Building C object test/CMakeFiles/compile_minimal_test.dir/compile_minimal_test.c.o
[15/54] Building CXX object CMakeFiles/amd_comgr.dir/src/comgr-signal.cpp.o
[16/54] Building C object test/CMakeFiles/get_data_isa_name_test.dir/get_data_isa_name_test.c.o
[17/54] Building C object test/CMakeFiles/metadata_tp_test.dir/metadata_tp_test.c.o
[18/54] Building C object test/CMakeFiles/symbols_iterate_test.dir/symbols_iterate_test.c.o
[19/54] Building C object test/CMakeFiles/disasm_instr_test.dir/disasm_instr_test.c.o
[20/54] Building C object test/CMakeFiles/metadata_yaml_test.dir/metadata_yaml_test.c.o
[21/54] Building C object test/CMakeFiles/compile_log_test.dir/compile_log_test.c.o
[22/54] Building CXX object CMakeFiles/amd_comgr.dir/src/comgr-symbol.cpp.o
[23/54] Building C object test/CMakeFiles/symbols_test.dir/symbols_test.c.o
[24/54] Building CXX object CMakeFiles/amd_comgr.dir/src/comgr-disassembly.cpp.o
FAILED: CMakeFiles/amd_comgr.dir/src/comgr-disassembly.cpp.o
/usr/bin/clang++ -DAMD_EXPORT -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -Damd_comgr_EXPORTS -I/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/include -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fPIC -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -Wall -Wno-attributes -fms-extensions -fvisibility=hidden -fno-strict-aliasing -std=c++14 -MD -MT CMakeFiles/amd_comgr.dir/src/comgr-disassembly.cpp.o -MF CMakeFiles/amd_comgr.dir/src/comgr-disassembly.cpp.o.d -o CMakeFiles/amd_comgr.dir/src/comgr-disassembly.cpp.o -c /build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-disassembly.cpp
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-disassembly.cpp:81:44: error: too many arguments to function call, expected 2, have 3
TheTarget->createMCAsmInfo(*MRI, TT, MCOptions));
~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~
/usr/include/llvm/Support/TargetRegistry.h:338:3: note: 'createMCAsmInfo' declared here
MCAsmInfo *createMCAsmInfo(const MCRegisterInfo &MRI,
^
1 error generated.
[25/54] Building C object test/CMakeFiles/compile_test.dir/compile_test.c.o
[26/54] Building C object test/CMakeFiles/assemble_test.dir/assemble_test.c.o
[27/54] Building C object test/CMakeFiles/data_test.dir/data_test.c.o
[28/54] Building CXX object CMakeFiles/amd_comgr.dir/src/comgr-elfdump.cpp.o
[29/54] Building C object test/CMakeFiles/link_test.dir/link_test.c.o
[30/54] Building CXX object CMakeFiles/amd_comgr.dir/src/comgr-objdump.cpp.o
FAILED: CMakeFiles/amd_comgr.dir/src/comgr-objdump.cpp.o
/usr/bin/clang++ -DAMD_EXPORT -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -Damd_comgr_EXPORTS -I/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/include -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fPIC -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -Wall -Wno-attributes -fms-extensions -fvisibility=hidden -fno-strict-aliasing -std=c++14 -MD -MT CMakeFiles/amd_comgr.dir/src/comgr-objdump.cpp.o -MF CMakeFiles/amd_comgr.dir/src/comgr-objdump.cpp.o.d -o CMakeFiles/amd_comgr.dir/src/comgr-objdump.cpp.o -c /build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp:316:54: error: too few arguments to function call, single argument 'Result' was not specified
Expected<StringRef> SecNameOrErr = S.getName();
~~~~~~~~~ ^
/usr/include/llvm/Object/ObjectFile.h:437:1: note: 'getName' declared here
inline std::error_code SectionRef::getName(StringRef &Result) const {
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp:843:55: error: too few arguments to function call, single argument 'Result' was not specified
Expected<StringRef> NameOrErr = Section.getName();
~~~~~~~~~~~~~~~ ^
/usr/include/llvm/Object/ObjectFile.h:437:1: note: 'getName' declared here
inline std::error_code SectionRef::getName(StringRef &Result) const {
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp:872:46: error: too few arguments to function call, single argument 'Result' was not specified
Expected<StringRef> SOrErr = SI->getName();
~~~~~~~~~~~ ^
/usr/include/llvm/Object/ObjectFile.h:437:1: note: 'getName' declared here
inline std::error_code SectionRef::getName(StringRef &Result) const {
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp:1205:52: error: too many arguments to function call, expected 2, have 3
TheTarget->createMCAsmInfo(*MRI, TripleName, MCOptions));
~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~
/usr/include/llvm/Support/TargetRegistry.h:338:3: note: 'createMCAsmInfo' declared here
MCAsmInfo *createMCAsmInfo(const MCRegisterInfo &MRI,
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp:1393:52: error: too few arguments to function call, single argument 'Result' was not specified
StringRef name = unwrapOrError(Section.getName(), Obj->getFileName());
~~~~~~~~~~~~~~~ ^
/usr/include/llvm/Object/ObjectFile.h:437:1: note: 'getName' declared here
inline std::error_code SectionRef::getName(StringRef &Result) const {
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp:1705:55: error: too few arguments to function call, single argument 'Result' was not specified
StringRef secname = unwrapOrError(Section.getName(), Obj->getFileName());
~~~~~~~~~~~~~~~ ^
/usr/include/llvm/Object/ObjectFile.h:437:1: note: 'getName' declared here
inline std::error_code SectionRef::getName(StringRef &Result) const {
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp:1728:52: error: too few arguments to function call, single argument 'Result' was not specified
StringRef Name = unwrapOrError(Section.getName(), Obj->getFileName());
~~~~~~~~~~~~~~~ ^
/usr/include/llvm/Object/ObjectFile.h:437:1: note: 'getName' declared here
inline std::error_code SectionRef::getName(StringRef &Result) const {
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp:1746:52: error: too few arguments to function call, single argument 'Result' was not specified
StringRef Name = unwrapOrError(Section.getName(), Obj->getFileName());
~~~~~~~~~~~~~~~ ^
/usr/include/llvm/Object/ObjectFile.h:437:1: note: 'getName' declared here
inline std::error_code SectionRef::getName(StringRef &Result) const {
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp:1824:56: error: too few arguments to function call, single argument 'Result' was not specified
Expected<StringRef> NameOrErr = Section->getName();
~~~~~~~~~~~~~~~~ ^
/usr/include/llvm/Object/ObjectFile.h:437:1: note: 'getName' declared here
inline std::error_code SectionRef::getName(StringRef &Result) const {
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp:1877:62: error: too few arguments to function call, single argument 'Result' was not specified
StringRef SectionName = unwrapOrError(Section->getName(), o->getFileName());
~~~~~~~~~~~~~~~~ ^
/usr/include/llvm/Object/ObjectFile.h:437:1: note: 'getName' declared here
inline std::error_code SectionRef::getName(StringRef &Result) const {
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp:2008:34: error: too few arguments to function call, single argument 'Result' was not specified
auto NameOrErr = Sec.getName();
~~~~~~~~~~~ ^
/usr/include/llvm/Object/ObjectFile.h:437:1: note: 'getName' declared here
inline std::error_code SectionRef::getName(StringRef &Result) const {
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-objdump.cpp:2049:34: error: too few arguments to function call, single argument 'Result' was not specified
auto NameOrErr = Sec.getName();
~~~~~~~~~~~ ^
/usr/include/llvm/Object/ObjectFile.h:437:1: note: 'getName' declared here
inline std::error_code SectionRef::getName(StringRef &Result) const {
^
12 errors generated.
[31/54] Building CXX object CMakeFiles/amd_comgr.dir/src/comgr-metadata.cpp.o
[32/54] Building CXX object CMakeFiles/amd_comgr.dir/src/comgr.cpp.o
[33/54] Building CXX object CMakeFiles/amd_comgr.dir/src/comgr-compiler.cpp.o
FAILED: CMakeFiles/amd_comgr.dir/src/comgr-compiler.cpp.o
/usr/bin/clang++ -DAMD_EXPORT -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -Damd_comgr_EXPORTS -I/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/include -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fPIC -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -Wall -Wno-attributes -fms-extensions -fvisibility=hidden -fno-strict-aliasing -std=c++14 -MD -MT CMakeFiles/amd_comgr.dir/src/comgr-compiler.cpp.o -MF CMakeFiles/amd_comgr.dir/src/comgr-compiler.cpp.o.d -o CMakeFiles/amd_comgr.dir/src/comgr-compiler.cpp.o -c /build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-compiler.cpp
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-compiler.cpp:190:28: error: use of undeclared identifier 'getDriverOptTable'; did you mean 'createDriverOptTable'?
const OptTable &OptTbl = getDriverOptTable();
^~~~~~~~~~~~~~~~~
createDriverOptTable
/usr/include/clang/Driver/Options.h:50:38: note: 'createDriverOptTable' declared here
std::unique_ptr<llvm::opt::OptTable> createDriverOptTable();
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-compiler.cpp:190:19: error: no viable conversion from 'std::unique_ptr<llvm::opt::OptTable>' to 'const llvm::opt::OptTable'
const OptTable &OptTbl = getDriverOptTable();
^ ~~~~~~~~~~~~~~~~~~~
/usr/include/llvm/Option/OptTable.h:38:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'std::unique_ptr<llvm::opt::OptTable>' to 'const llvm::opt::OptTable &' for 1st argument
class OptTable {
^
/usr/include/llvm/Option/OptTable.h:83:3: note: candidate constructor not viable: no known conversion from 'std::unique_ptr<llvm::opt::OptTable>' to 'ArrayRef<llvm::opt::OptTable::Info>' for 1st argument
OptTable(ArrayRef<Info> OptionInfos, bool IgnoreCase = false);
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-compiler.cpp:363:53: error: too many arguments to function call, expected 2, have 3
TheTarget->createMCAsmInfo(*MRI, Opts.Triple, MCOptions));
~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~
/usr/include/llvm/Support/TargetRegistry.h:338:3: note: 'createMCAsmInfo' declared here
MCAsmInfo *createMCAsmInfo(const MCRegisterInfo &MRI,
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-compiler.cpp:567:54: error: too many arguments to function call, expected at most 3, have 4
bool LLDRet = lld::elf::link(ArgRefs, false, LogS, LogE);
~~~~~~~~~~~~~~ ^~~~
/usr/include/lld/Common/Driver.h:27:1: note: 'link' declared here
bool link(llvm::ArrayRef<const char *> args, bool canExitEarly,
^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-compiler.cpp:618:14: error: no member named 'setVerboseOutputStream' in 'clang::CompilerInstance'
Clang->setVerboseOutputStream(DiagOS);
~~~~~ ^
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-compiler.cpp:621:12: error: too few arguments to function call, expected 4, have 3; did you mean 'AssemblerInvocation::CreateFromArgs'?
if (!CompilerInvocation::CreateFromArgs(
^~~~~~~~~~~~~~~~~~
AssemblerInvocation::CreateFromArgs
/build/rocm-compilersupport/src/rocm-compilersupport/lib/comgr/src/comgr-compiler.cpp:184:27: note: 'AssemblerInvocation::CreateFromArgs' declared here
bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
^
6 errors generated.
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
Possibly wants a custom llvm build which rocm-opencl-runtime also wants. So a seperate package may not be the way forward without wanting to build llvm twice.
There is also the issue of https://github.com/RadeonOpenCompute/RO … /issues/98
Using the official instructions to fetch the sources for roc-3.0.x does not work:
pacman -S repo
repo init -u https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git -b roc-3.0.x -m opencl.xml
repo sync
Offline
Yeah, rocm proably need it's own custom llvm/clang suite build that will be used by all rocm parts.
Looking at rocm-opencl-runtime code I noticed a roc-3.0.x branch at https://github.com/RadeonOpenCompute/RO … /roc-3.0.x
It has one commit more then master , titled Point project to 3.0.0 tags .
Seems that commit when merged to master will solve the missing tag issue.
However, ROCm-OpenCL-Driver doesn't have a 3.0 branch so there's still that.
I do think there are 2 options :
- Create pacakges for the 2.10 version focusing on opencl support
- start on a new setup for rocm 3+ with it's own customized llvm/clang build
That is doable, but getting it to to coexist with other llvm/clang installations will be tricky.
I can offer some help with llvm-rocm , but can't take on a 3rd llvm package.
Looks like rocm on archlinux needs to become a multi-person project instead of a bunch of loosely connected programs.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
https://github.com/RadeonOpenCompute/RO … a5a76c1da3
references roc-ocl-3.0.0 in llvm, lld which also appear missing
For 2.10.0 the following are clean chroot build tested only
# Maintainer: Jakub Okoński <jakub@okonski.org>
pkgname=roct-thunk-interface
_pkgname=ROCT-Thunk-Interface
pkgver=2.10.0
pkgrel=1
pkgdesc="user-mode API interfaces used to interact with the ROCk driver"
arch=(x86_64)
url="https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface"
license=('BSD')
makedepends=(cmake gcc ninja)
depends=(numactl pciutils)
source=("$_pkgname-roc-$pkgver.tar.gz::https://github.com/RadeonOpenCompute/$_pkgname/archive/roc-$pkgver.tar.gz"
"fix_build-dev_command.patch")
sha256sums=('cb5aa35cc42923442ae776de1656872c1e56c9456cc472b8df759cfa99918502'
'f58bdd6df3065ad1e08c107e95140445fc01bd46dae27fb9d2091a2f3b5d3d2f')
#patch does not seem to be needed
#prepare() {
# cd $_pkgname-roc-$pkgver
# patch -Np1 -i ../fix_build-dev_command.patch
#}
build() {
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/rocm \
$_pkgname-roc-$pkgver
ninja -C build all build-dev
}
package() {
DESTDIR="$pkgdir" ninja -C build install install-dev
install -dm 755 "$pkgdir/usr/share/licenses/$pkgname"
install -Dm 644 $_pkgname-roc-$pkgver/LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
install -dm 755 "$pkgdir/etc/ld.so.conf.d"
cat <<-EOF > $pkgdir/etc/ld.so.conf.d/roct-thunk-interface.conf
/opt/rocm/lib
EOF
}
# Maintainer: acxz <akashpatel2008 at yahoo dot com>
# Contributor: Jakub Okoński <jakub@okonski.org>
pkgname=rocr-runtime
_pkgname=ROCR-Runtime
pkgver=2.10.0
pkgrel=1
pkgdesc="ROCm Platform Runtime: ROCr a HPC market enhanced HSA based runtime"
url="https://github.com/RadeonOpenCompute/ROCR-Runtime"
arch=(x86_64)
license=('Custom')
makedepends=('cmake')
depends=('libelf' 'roct-thunk-interface')
source=("$_pkgname-roc-$pkgver.tar.gz::https://github.com/RadeonOpenCompute/$_pkgname/archive/roc-$pkgver.tar.gz")
sha256sums=('77a0165f1841fba2b889e703363cd04afe7f7e77834f921c3d4099cd7cde8aeb')
build() {
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/rocm \
-DHSAKMT_INC_PATH=/opt/rocm/include \
-DHSAKMT_LIB_PATH=/opt/rocm/lib \
$_pkgname-roc-$pkgver/src
make -C build
}
package() {
make DESTDIR="$pkgdir" -C build install
install -dm 755 "$pkgdir/usr/share/licenses/$pkgname"
install -Dm 644 $_pkgname-roc-$pkgver/LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt"
install -dm 755 "$pkgdir/etc/ld.so.conf.d"
cat <<-EOF > $pkgdir/etc/ld.so.conf.d/rocm-runtime.conf
/opt/rocm/lib
/opt/rocm/hsa/lib/
EOF
}
# Maintainer: Ranieri Althoff <ranisalt+aur at gmail dot com>
_opencl_icd_loader_commit="978b4b3a29a3aebc86ce9315d5c5963e88722d03"
pkgname=rocm-opencl-runtime
pkgver=2.10.0
pkgrel=1
pkgdesc='ROCm OpenCL™ Compatible Runtime'
arch=('x86_64')
url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime'
license=('MIT')
depends=("rocr-runtime>=${pkgver}" 'opencl-icd-loader')
makedepends=(mesa cmake ninja git python)
provides=("${pkgname}" 'opencl-driver')
conflicts=('rocm-opencl-git')
source=(
"rocm-opencl-runtime::git+https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime#tag=roc-${pkgver}"
"rocm-opencl-driver::git+https://github.com/RadeonOpenCompute/ROCm-OpenCL-Driver#tag=roc-${pkgver}"
"llvm-ocl-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/llvm/archive/roc-ocl-${pkgver}.tar.gz"
"clang-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/clang/archive/roc-${pkgver}.tar.gz"
"lld-ocl-${pkgver}.tar.gz::https://github.com/RadeonOpenCompute/lld/archive/roc-ocl-${pkgver}.tar.gz"
"rocm-device-libs::git+https://github.com/RadeonOpenCompute/ROCm-Device-Libs#tag=roc-ocl-${pkgver}"
"opencl-icd-loader::git+https://github.com/KhronosGroup/OpenCL-ICD-Loader#commit=${_opencl_icd_loader_commit}"
'fix_rocm_opencl_build_order.patch'
)
sha256sums=('SKIP'
'SKIP'
'c46ec3568b754a7aced6139bcc254d39ddb89016b282c467ae1b5536d8021540'
'acdebf229a2120ad0ccdc48a6b0e863a6a4d89f46bb62e7296f2f16bbc4a04a7'
'105cedd4a31a6d6ad51043c384129a7705f9a5f65414e60a07c9193411b756f0'
'SKIP'
'SKIP'
'0f735299810e9e22cd57f5b96a7628a0f399d445a1f3bacefd8b890e84ca372f')
prepare() {
# emulate repo opencl.xml layout
ln -s "$srcdir/rocm-opencl-runtime" opencl
mkdir -p "$srcdir/opencl/compiler"
ln -s "$srcdir/rocm-opencl-driver" opencl/compiler/driver
ln -s "$srcdir/llvm-roc-ocl-$pkgver" opencl/compiler/llvm
mkdir -p "$srcdir/opencl/compiler/llvm/tools"
ln -s "$srcdir/clang-roc-$pkgver" opencl/compiler/llvm/tools/clang
ln -s "$srcdir/lld-roc-ocl-$pkgver" opencl/compiler/llvm/tools/lld
mkdir -p "$srcdir/opencl/library"
ln -s "$srcdir/rocm-device-libs" opencl/library/amdgcn
mkdir -p "$srcdir/opencl/api/opencl/khronos"
ln -s "$srcdir/opencl-icd-loader" opencl/api/opencl/khronos/icd
# Fix build missing dependency
# https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/issues/64#issuecomment-473502685
cd "$srcdir/opencl"
patch -Np1 -i "${srcdir}/fix_rocm_opencl_build_order.patch"
}
build() {
if check_buildoption "ccache" "y"; then
CMAKE_FLAGS="-DROCM_CCACHE_BUILD=ON"
fi
cmake $CMAKE_FLAGS -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/rocm/opencl \
-DCLANG_ENABLE_STATIC_ANALYZER=ON \
-G Ninja \
"$srcdir/opencl"
# building LLVM/Clang requires ~1.5G per unit
THREADS=$(( ($(getconf _PHYS_PAGES) * $(getconf PAGESIZE)) / 1610612736 ))
if [ "$THREADS" -lt 1 ]; then
THREADS=1
fi
ninja -C build "-j$THREADS"
# FIXME Check why lld has to built manually since 2.3.0
ninja -C build lld
}
package() {
DESTDIR="$pkgdir/" ninja -C build install
# OpenCL vendor file
mkdir -p "$pkgdir/etc/OpenCL/vendors"
echo "/opt/rocm/opencl/lib/x86_64/libamdocl64.so" > "$pkgdir/etc/OpenCL/vendors/rocm-opencl64.icd"
mkdir -p "$pkgdir/etc/ld.so.conf.d"
echo "/opt/rocm/opencl/lib" > "$pkgdir/etc/ld.so.conf.d/rocm-opencl.conf"
# Discard AMD's OpenCL ICD Loader
# https://wiki.archlinux.org/index.php/GPGPU#OpenCL_ICD_loader_(libOpenCL.so)
rm -f "$pkgdir"/opt/rocm/opencl/lib/x86_64/libOpenCL.so*
}
Last edited by loqs (2020-01-07 00:40:45)
Offline