By default it is set to 64 bits. The cacheline parameter is required when cross-compiling nOS-V, as it cannot be read from the build machine. Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
61 lines
1.1 KiB
Nix
61 lines
1.1 KiB
Nix
{
|
|
stdenv
|
|
, lib
|
|
, autoreconfHook
|
|
, fetchFromGitHub
|
|
, pkg-config
|
|
, numactl
|
|
, hwloc
|
|
, cacheline ? 64 # bits
|
|
, ovni ? null
|
|
, useGit ? false
|
|
, gitUrl ? "git@gitlab-internal.bsc.es:nos-v/nos-v.git"
|
|
, gitBranch ? "master"
|
|
, gitCommit ? "cfd361bd1dd30c96da405e6bbaa7e78f5f93dfda"
|
|
}:
|
|
|
|
with lib;
|
|
|
|
let
|
|
release = rec {
|
|
version = "3.1.0";
|
|
src = fetchFromGitHub {
|
|
owner = "bsc-pm";
|
|
repo = "nos-v";
|
|
rev = "${version}";
|
|
hash = "sha256-Pkre+ZZsREDxJLCoIoPN1HQDuUa2H1IQyKB3omg6qaU=";
|
|
};
|
|
};
|
|
|
|
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
|
|
];
|
|
}
|