2020-06-08 18:01:33 +02:00
|
|
|
{
|
|
|
|
stdenv
|
2020-11-19 18:50:30 +01:00
|
|
|
, fetchFromGitHub
|
2020-06-08 18:01:33 +02:00
|
|
|
, automake
|
|
|
|
, autoconf
|
2020-11-19 18:50:30 +01:00
|
|
|
, autoreconfHook
|
2020-06-08 18:01:33 +02:00
|
|
|
, libtool
|
|
|
|
, pkg-config
|
|
|
|
, numactl
|
|
|
|
, hwloc
|
|
|
|
, papi
|
2020-06-09 18:21:02 +02:00
|
|
|
, extrae
|
2020-06-08 18:01:33 +02:00
|
|
|
, boost
|
2021-03-03 19:05:33 +01:00
|
|
|
, enableJemalloc ? true
|
2020-11-19 18:50:30 +01:00
|
|
|
, jemalloc ? null
|
|
|
|
, cachelineBytes ? 64
|
2021-03-11 17:56:12 +01:00
|
|
|
, enableGlibcxxDebug ? false
|
2020-06-08 18:01:33 +02:00
|
|
|
}:
|
|
|
|
|
2021-03-03 19:05:33 +01:00
|
|
|
assert enableJemalloc -> (jemalloc != null);
|
|
|
|
|
2020-06-08 18:01:33 +02:00
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nanos6";
|
2021-03-03 19:05:03 +01:00
|
|
|
version = "2.5.1";
|
2020-06-08 18:01:33 +02:00
|
|
|
|
2020-11-19 18:50:30 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bsc-pm";
|
|
|
|
repo = "nanos6";
|
|
|
|
rev = "version-${version}";
|
2021-03-03 19:05:03 +01:00
|
|
|
sha256 = "17z6gr122cw0l4lsp0qdrdbcl1zcls4i0haxqpj3g60fvjx3fznp";
|
2020-06-08 18:01:33 +02:00
|
|
|
};
|
|
|
|
|
2021-03-10 18:42:59 +01:00
|
|
|
patches = [ ./clock-monotonic.patch ];
|
|
|
|
|
2020-11-19 18:50:30 +01:00
|
|
|
prePatch = ''
|
|
|
|
patchShebangs scripts/generate_config.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-06-08 18:01:33 +02:00
|
|
|
preConfigure = ''
|
2020-11-19 18:50:30 +01:00
|
|
|
export CACHELINE_WIDTH=${toString cachelineBytes}
|
2020-06-08 18:01:33 +02:00
|
|
|
'';
|
|
|
|
|
2020-11-19 18:50:30 +01:00
|
|
|
configureFlags = [] ++
|
2021-03-11 17:56:12 +01:00
|
|
|
optional enableJemalloc "--with-jemalloc=${jemalloc}" ++
|
|
|
|
optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG";
|
2020-06-15 11:54:22 +02:00
|
|
|
|
2020-11-19 18:50:30 +01:00
|
|
|
# The "bindnow" flags are incompatible with ifunc resolution mechanism. We
|
|
|
|
# disable all by default, which includes bindnow.
|
|
|
|
hardeningDisable = [ "all" ];
|
2020-06-08 18:01:33 +02:00
|
|
|
|
|
|
|
buildInputs = [
|
2020-11-19 18:50:30 +01:00
|
|
|
autoreconfHook
|
2020-06-08 18:01:33 +02:00
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
libtool
|
|
|
|
pkg-config
|
|
|
|
boost
|
|
|
|
numactl
|
|
|
|
hwloc
|
|
|
|
papi ]
|
2020-06-09 18:21:02 +02:00
|
|
|
++ (if (extrae != null) then [extrae] else []);
|
2020-06-08 18:01:33 +02:00
|
|
|
|
|
|
|
}
|