jungle/pkgs/nosv/default.nix
Rodrigo Arias Mallo 2c8d7ed855 Build nOS-V with PAPI support
To support the new instrumentation for HWC it would be useful to already
build nOS-V with PAPI support enabled. The enablePapi switch allows it
to be disabled with `nosv.override { enablePapi = false; }`.

Reviewed-by: Aleix Roca Nonell <aleix.rocanonell@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2025-08-01 13:12:48 +02:00

63 lines
1.2 KiB
Nix

{
stdenv
, lib
, autoreconfHook
, fetchFromGitHub
, pkg-config
, numactl
, hwloc
, papi
, enablePapi ? true
, cacheline ? 64 # bits
, ovni ? null
, useGit ? false
, gitUrl ? "git@gitlab-internal.bsc.es:nos-v/nos-v.git"
, gitBranch ? "master"
, gitCommit ? "9f47063873c3aa9d6a47482a82c5000a8c813dd8"
}:
with lib;
let
release = rec {
version = "3.2.0";
src = fetchFromGitHub {
owner = "bsc-pm";
repo = "nos-v";
rev = "${version}";
hash = "sha256-yaz92426EM8trdkBJlISmAoG9KJCDTvoAW/HKrasvOw=";
};
};
git = rec {
version = src.shortRev;
src = builtins.fetchGit {
url = gitUrl;
ref = gitBranch;
rev = gitCommit;
};
};
source = if (useGit) then git else release;
in
stdenv.mkDerivation rec {
pname = "nosv";
inherit (source) src version;
hardeningDisable = [ "all" ];
dontStrip = true;
separateDebugInfo = true;
configureFlags = [
"--with-ovni=${ovni}"
"CACHELINE_WIDTH=${toString cacheline}"
];
nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [
numactl
hwloc
ovni
] ++ lib.optionals enablePapi [ papi ];
}