rocclr: 4.3.1 → 4.5.2

rocclr cannot be built alone and needs to be distributed by source now.
This commit is contained in:
Neubauer, Sebastian 2021-11-08 10:09:01 +00:00
parent 66bdbb56e2
commit 923ad46057
2 changed files with 11 additions and 34 deletions

View file

@ -1,55 +1,34 @@
{ lib, stdenv { lib, stdenv
, fetchFromGitHub , fetchFromGitHub
, writeScript , writeScript
, cmake
, rocm-cmake
, clang
, rocm-comgr , rocm-comgr
, rocm-opencl-runtime
, rocm-runtime
, rocm-thunk
, libelf
, libglvnd
, libX11
, numactl
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "rocclr"; pname = "rocclr";
version = "4.3.1"; version = "4.5.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ROCm-Developer-Tools"; owner = "ROCm-Developer-Tools";
repo = "ROCclr"; repo = "ROCclr";
rev = "rocm-${version}"; rev = "rocm-${version}";
hash = "sha256-3lk7Zucoam+11gFBzg/TWQI1L8uAlxTrPz/mDwTwod4="; hash = "sha256-fsQANBND/oDeC/+wmCH/aLlDTxPIi7Z/oN1HnNHHnm0=";
}; };
nativeBuildInputs = [ cmake rocm-cmake ];
buildInputs = [ clang rocm-comgr rocm-runtime rocm-thunk ];
propagatedBuildInputs = [ libelf libglvnd libX11 numactl ];
prePatch = '' prePatch = ''
substituteInPlace CMakeLists.txt \
--replace 'set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ''${CMAKE_CURRENT_BINARY_DIR}/lib)' \
'set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ''${CMAKE_INSTALL_LIBDIR})'
substituteInPlace device/comgrctx.cpp \ substituteInPlace device/comgrctx.cpp \
--replace "libamd_comgr.so" "${rocm-comgr}/lib/libamd_comgr.so" --replace "libamd_comgr.so" "${rocm-comgr}/lib/libamd_comgr.so"
''; '';
cmakeFlags = [ buildPhase = "";
"-DOPENCL_DIR=${rocm-opencl-runtime.src}"
];
preFixup = '' installPhase = ''
# Work around broken cmake files runHook preInstall
ln -s $out/include/compiler/lib/include/* $out/include
ln -s $out/include/elf/elfio $out/include/elfio
substituteInPlace $out/lib/cmake/rocclr/ROCclrConfig.cmake \ mkdir -p $out
--replace "/build/source/build" "$out" cp -r * $out/
runHook postInstall
''; '';
passthru.updateScript = writeScript "update.sh" '' passthru.updateScript = writeScript "update.sh" ''
@ -60,7 +39,7 @@ stdenv.mkDerivation rec {
''; '';
meta = with lib; { meta = with lib; {
description = "Radeon Open Compute common language runtime"; description = "Source package of the Radeon Open Compute common language runtime";
homepage = "https://github.com/ROCm-Developer-Tools/ROCclr"; homepage = "https://github.com/ROCm-Developer-Tools/ROCclr";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ lovesegfault ]; maintainers = with maintainers; [ lovesegfault ];

View file

@ -12780,9 +12780,7 @@ with pkgs;
rgxg = callPackage ../tools/text/rgxg { }; rgxg = callPackage ../tools/text/rgxg { };
rocclr = callPackage ../development/libraries/rocclr { rocclr = callPackage ../development/libraries/rocclr { };
inherit (llvmPackages_rocm) clang;
};
hip = callPackage ../development/compilers/hip { hip = callPackage ../development/compilers/hip {
inherit (llvmPackages_rocm) clang clang-unwrapped compiler-rt lld llvm; inherit (llvmPackages_rocm) clang clang-unwrapped compiler-rt lld llvm;