2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rocmUpdateScript
|
|
|
|
, cmake
|
2023-01-20 10:41:00 +00:00
|
|
|
, rocm-cmake
|
2022-12-17 10:02:37 +00:00
|
|
|
, rocm-device-libs
|
2023-01-20 10:41:00 +00:00
|
|
|
, libxml2
|
2022-12-17 10:02:37 +00:00
|
|
|
}:
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
let
|
|
|
|
llvmNativeTarget =
|
|
|
|
if stdenv.isx86_64 then "X86"
|
|
|
|
else if stdenv.isAarch64 then "AArch64"
|
|
|
|
else throw "Unsupported ROCm LLVM platform";
|
|
|
|
in stdenv.mkDerivation (finalAttrs: {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "rocm-comgr";
|
2023-03-27 19:17:25 +00:00
|
|
|
version = "5.4.4";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
|
|
|
repo = "ROCm-CompilerSupport";
|
2022-11-27 09:42:12 +00:00
|
|
|
rev = "rocm-${finalAttrs.version}";
|
2022-12-17 10:02:37 +00:00
|
|
|
hash = "sha256-qLsrBTeSop7lIQv8gZDwgpvGZJOAq90zsvMi1QpfbAs=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
patches = [ ./cmake.patch ];
|
|
|
|
sourceRoot = "${finalAttrs.src.name}/lib/comgr";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
rocm-cmake
|
|
|
|
];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
buildInputs = [
|
|
|
|
rocm-device-libs
|
|
|
|
libxml2
|
2020-07-18 16:06:22 +00:00
|
|
|
];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
cmakeFlags = [ "-DLLVM_TARGETS_TO_BUILD=AMDGPU;X86" ];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
passthru.updateScript = rocmUpdateScript {
|
|
|
|
name = finalAttrs.pname;
|
|
|
|
owner = finalAttrs.src.owner;
|
|
|
|
repo = finalAttrs.src.repo;
|
|
|
|
};
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "APIs for compiling and inspecting AMDGPU code objects";
|
|
|
|
homepage = "https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/tree/amd-stg-open/lib/comgr";
|
|
|
|
license = licenses.ncsa;
|
2022-11-27 09:42:12 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
2020-07-18 16:06:22 +00:00
|
|
|
platforms = platforms.linux;
|
2023-01-20 10:41:00 +00:00
|
|
|
broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version;
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
2022-11-27 09:42:12 +00:00
|
|
|
})
|