2022-12-04 00:25:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rocmUpdateScript
|
|
|
|
, cmake
|
2022-12-12 23:36:53 +00:00
|
|
|
, rocm-cmake
|
2022-12-04 00:25:41 +00:00
|
|
|
, rocm-device-libs
|
2022-12-12 23:36:53 +00:00
|
|
|
, libxml2
|
2022-12-04 00:25:41 +00:00
|
|
|
}:
|
2020-07-10 17:53:14 +00:00
|
|
|
|
2022-12-12 23:36:53 +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-10 17:53:14 +00:00
|
|
|
pname = "rocm-comgr";
|
2022-12-16 15:24:05 +00:00
|
|
|
version = "5.4.1";
|
2020-07-10 17:53:14 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
|
|
|
repo = "ROCm-CompilerSupport";
|
2022-11-24 02:17:04 +00:00
|
|
|
rev = "rocm-${finalAttrs.version}";
|
2022-12-04 00:26:46 +00:00
|
|
|
hash = "sha256-qLsrBTeSop7lIQv8gZDwgpvGZJOAq90zsvMi1QpfbAs=";
|
2020-07-10 17:53:14 +00:00
|
|
|
};
|
|
|
|
|
2022-12-12 23:36:53 +00:00
|
|
|
patches = [ ./cmake.patch ];
|
|
|
|
sourceRoot = "${finalAttrs.src.name}/lib/comgr";
|
2020-07-10 17:53:14 +00:00
|
|
|
|
2022-12-12 23:36:53 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
rocm-cmake
|
|
|
|
];
|
2020-07-10 17:53:14 +00:00
|
|
|
|
2022-12-12 23:36:53 +00:00
|
|
|
buildInputs = [
|
|
|
|
rocm-device-libs
|
|
|
|
libxml2
|
2020-07-10 17:53:14 +00:00
|
|
|
];
|
|
|
|
|
2022-12-12 23:36:53 +00:00
|
|
|
cmakeFlags = [ "-DLLVM_TARGETS_TO_BUILD=AMDGPU;X86" ];
|
2022-08-16 17:20:55 +00:00
|
|
|
|
2022-12-04 00:25:41 +00:00
|
|
|
passthru.updateScript = rocmUpdateScript {
|
|
|
|
name = finalAttrs.pname;
|
|
|
|
owner = finalAttrs.src.owner;
|
|
|
|
repo = finalAttrs.src.repo;
|
|
|
|
};
|
2021-09-08 14:15:25 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-07-10 17:53:14 +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-24 01:29:33 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
|
2020-07-10 17:53:14 +00:00
|
|
|
platforms = platforms.linux;
|
2022-12-12 23:36:53 +00:00
|
|
|
broken = finalAttrs.version != stdenv.cc.version;
|
2020-07-10 17:53:14 +00:00
|
|
|
};
|
2022-11-24 02:17:04 +00:00
|
|
|
})
|