2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rocmUpdateScript
|
|
|
|
, cmake
|
|
|
|
, clang
|
|
|
|
, rocm-device-libs
|
|
|
|
, llvm
|
|
|
|
}:
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "rocm-comgr";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "5.4.0";
|
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
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "source/lib/comgr";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
buildInputs = [ clang rocm-device-libs llvm ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_C_COMPILER=${clang}/bin/clang"
|
|
|
|
"-DCMAKE_CXX_COMPILER=${clang}/bin/clang++"
|
|
|
|
"-DCMAKE_PREFIX_PATH=${llvm}/lib/cmake/llvm"
|
2022-08-21 13:32:41 +00:00
|
|
|
"-DLLD_INCLUDE_DIRS=${llvm}/include"
|
2020-07-18 16:06:22 +00:00
|
|
|
"-DLLVM_TARGETS_TO_BUILD=\"AMDGPU;X86\""
|
|
|
|
];
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
patches = [ ./cmake.patch ];
|
|
|
|
|
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;
|
|
|
|
};
|
2022-11-27 09:42:12 +00:00
|
|
|
})
|