2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-07-18 16:06:22 +00:00
|
|
|
, fetchFromGitHub
|
2021-09-18 10:52:07 +00:00
|
|
|
, writeScript
|
2020-07-18 16:06:22 +00:00
|
|
|
, cmake
|
|
|
|
, clang
|
|
|
|
, clang-unwrapped
|
|
|
|
, lld
|
|
|
|
, llvm
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rocm-device-libs";
|
2021-12-24 04:21:11 +00:00
|
|
|
version = "4.5.2";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
|
|
|
repo = "ROCm-Device-Libs";
|
|
|
|
rev = "rocm-${version}";
|
2021-12-24 04:21:11 +00:00
|
|
|
hash = "sha256-UeunsDRLhmsDOzesiEgYIzYotwecehB6VswshzdRwjw=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
buildInputs = [ clang lld llvm ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_PREFIX_PATH=${llvm}/lib/cmake/llvm;${clang-unwrapped}/lib/cmake/clang"
|
|
|
|
"-DLLVM_TARGETS_TO_BUILD='AMDGPU;X86'"
|
|
|
|
"-DCLANG=${clang}/bin/clang"
|
|
|
|
];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
passthru.updateScript = writeScript "update.sh" ''
|
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#!nix-shell -i bash -p curl jq common-updater-scripts
|
|
|
|
version="$(curl -sL "https://api.github.com/repos/RadeonOpenCompute/ROCm-Device-Libs/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
|
|
|
update-source-version rocm-device-libs "$version"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "Set of AMD-specific device-side language runtime libraries";
|
|
|
|
homepage = "https://github.com/RadeonOpenCompute/ROCm-Device-Libs";
|
|
|
|
license = licenses.ncsa;
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault ];
|
2020-07-18 16:06:22 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|