Add nodes release and git version

This commit is contained in:
Rodrigo Arias Mallo 2023-05-30 15:31:56 +02:00
parent d8c19eb4b4
commit 1da216bab5
3 changed files with 84 additions and 62 deletions

80
bsc/nodes/default.nix Normal file
View File

@ -0,0 +1,80 @@
{
stdenv
, lib
, automake
, autoconf
, libtool
, fetchFromGitHub
, pkg-config
, perl
, numactl
, hwloc
, papi
, boost
, autoreconfHook
, jemalloc
, enableOvni ? false
, ovni ? null
, nosv
, useGit ? false
, gitUrl ? "ssh://git@gitlab-internal.bsc.es/nos-v/nodes.git"
, gitBranch ? "master"
, gitCommit ? "c1094418a0a4dbfe78fa38b3f44741bd36d56e51"
}:
with lib;
let
release = rec {
version = "1.0";
src = fetchFromGitHub {
owner = "bsc-pm";
repo = "nodes";
rev = "version-${version}";
sha256 = "sha256-UqqvbAqF512qsHsEE24WNSxnV1wCGAXuzc7FkzQxu10=";
};
};
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 = "nodes";
inherit (source) src version;
enableParallelBuilding = true;
dontStrip = true;
configureFlags = [
"--with-jemalloc=${jemalloc}"
"--with-nosv=${nosv}"
] ++
(optional enableOvni "--with-ovni=${ovni}");
# The "bindnow" flags are incompatible with ifunc resolution mechanism. We
# disable all by default, which includes bindnow.
hardeningDisable = [ "all" ];
buildInputs = [
autoreconfHook
autoconf
automake
libtool
pkg-config
boost
numactl
hwloc
papi
jemalloc
nosv
] ++
(optional enableOvni ovni);
}

View File

@ -1,60 +0,0 @@
{
stdenv
, lib
, automake
, autoconf
, libtool
, pkg-config
, perl
, numactl
, hwloc
, papi
, boost
, autoreconfHook
, jemalloc
, enableOvni ? false
, ovni ? null
, nosv
, gitUrl ? "ssh://git@gitlab-internal.bsc.es/nos-v/nodes.git"
, gitBranch ? "master"
}:
with lib;
stdenv.mkDerivation rec {
pname = "nodes";
version = "${src.shortRev}";
src = builtins.fetchGit {
url = gitUrl;
ref = gitBranch;
};
enableParallelBuilding = true;
dontStrip = true;
configureFlags = [
"--with-jemalloc=${jemalloc}"
"--with-nosv=${nosv}"
] ++
(optional enableOvni "--with-ovni=${ovni}");
# The "bindnow" flags are incompatible with ifunc resolution mechanism. We
# disable all by default, which includes bindnow.
hardeningDisable = [ "all" ];
buildInputs = [
autoreconfHook
autoconf
automake
libtool
pkg-config
boost
numactl
hwloc
papi
jemalloc
nosv
] ++
(optional enableOvni ovni);
}

View File

@ -122,7 +122,7 @@ let
allowedRequisites = null;
};
clangNodes = bsc.clangOmpss2Git.override {
clangNodes = bsc.clangOmpss2.override {
rt = bsc.nodes;
};
@ -171,7 +171,9 @@ let
hardeningDisable = [ "all" ];
});
nodes = callPackage ./bsc/nodes/git.nix { };
nodes = bsc.nodesRelease;
nodesRelease = callPackage ./bsc/nodes/default.nix { };
nodesGit = callPackage ./bsc/nodes/default.nix { useGit = true; };
nodesWithOvni = bsc.nodes.override { enableOvni = true; };
# =================================================================