nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 rocm-runtime,
5 rocprofiler,
6 numactl,
7 libpciaccess,
8 libxml2,
9 elfutils,
10 fetchFromGitHub,
11 rocmUpdateScript,
12 cmake,
13 clang,
14 clr,
15 python3Packages,
16 gpuTargets ? clr.gpuTargets,
17}:
18
19stdenv.mkDerivation (finalAttrs: {
20 pname = "rocprofiler-register";
21 version = "6.3.3";
22
23 src = fetchFromGitHub {
24 owner = "ROCm";
25 repo = "rocprofiler-register";
26 rev = "rocm-${finalAttrs.version}";
27 hash = "sha256-UZsCiGnudsbL1v5lKBx7Vz3/HRnGn4f86Pd+qu3ryh0=";
28 fetchSubmodules = true;
29 };
30
31 nativeBuildInputs = [
32 cmake
33 clang
34 clr
35 ];
36
37 buildInputs = [
38 numactl
39 libpciaccess
40 libxml2
41 elfutils
42 rocm-runtime
43
44 rocprofiler.rocmtoolkit-merged
45
46 python3Packages.lxml
47 python3Packages.cppheaderparser
48 python3Packages.pyyaml
49 python3Packages.barectf
50 python3Packages.pandas
51 ];
52 cmakeFlags = [
53 "-DCMAKE_MODULE_PATH=${clr}/lib/cmake/hip"
54 "-DHIP_ROOT_DIR=${clr}"
55 "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}"
56 "-DBUILD_TEST=OFF"
57 "-DROCPROFILER_BUILD_TESTS=0"
58 "-DROCPROFILER_BUILD_SAMPLES=0"
59 # Manually define CMAKE_INSTALL_<DIR>
60 # See: https://github.com/NixOS/nixpkgs/pull/197838
61 "-DCMAKE_INSTALL_BINDIR=bin"
62 "-DCMAKE_INSTALL_LIBDIR=lib"
63 "-DCMAKE_INSTALL_INCLUDEDIR=include"
64 ];
65
66 passthru.updateScript = rocmUpdateScript {
67 name = "rocprofiler-register";
68 inherit (finalAttrs.src) owner;
69 inherit (finalAttrs.src) repo;
70 };
71
72 meta = with lib; {
73 description = "Profiling with perf-counters and derived metrics";
74 homepage = "https://github.com/ROCm/rocprofiler";
75 license = with licenses; [ mit ]; # mitx11
76 teams = [ teams.rocm ];
77 platforms = platforms.linux;
78 };
79})