2022-08-16 17:20:55 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, writeScript, cmake, clang, rocm-device-libs, llvm }:
|
2020-07-10 17:53:14 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rocm-comgr";
|
2022-10-30 16:28:49 +00:00
|
|
|
version = "5.3.1";
|
2020-07-10 17:53:14 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RadeonOpenCompute";
|
|
|
|
repo = "ROCm-CompilerSupport";
|
|
|
|
rev = "rocm-${version}";
|
2022-10-05 10:37:19 +00:00
|
|
|
hash = "sha256-LQyMhqcWm8zqt6138fnT7EOq/F8bG3Iuf04PTemVQmg=";
|
2020-07-10 17:53:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "source/lib/comgr";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2022-08-16 17:20:55 +00:00
|
|
|
buildInputs = [ clang rocm-device-libs llvm ];
|
2020-07-10 17:53:14 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_C_COMPILER=${clang}/bin/clang"
|
|
|
|
"-DCMAKE_CXX_COMPILER=${clang}/bin/clang++"
|
|
|
|
"-DCMAKE_PREFIX_PATH=${llvm}/lib/cmake/llvm"
|
2022-08-16 17:20:55 +00:00
|
|
|
"-DLLD_INCLUDE_DIRS=${llvm}/include"
|
2020-07-10 17:53:14 +00:00
|
|
|
"-DLLVM_TARGETS_TO_BUILD=\"AMDGPU;X86\""
|
|
|
|
];
|
|
|
|
|
2022-08-16 17:20:55 +00:00
|
|
|
patches = [ ./cmake.patch ];
|
|
|
|
|
2021-09-08 14:15:25 +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-CompilerSupport/releases?per_page=1" | jq '.[0].tag_name | split("-") | .[1]' --raw-output)"
|
|
|
|
update-source-version rocm-comgr "$version"
|
|
|
|
'';
|
|
|
|
|
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-10-05 10:37:19 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault Flakebi ];
|
2020-07-10 17:53:14 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|