2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, libtool, curl
|
2020-08-20 17:08:02 +00:00
|
|
|
, python3, munge, perl, pam, zlib, shadow, coreutils
|
2020-04-24 23:36:52 +00:00
|
|
|
, ncurses, libmysqlclient, gtk2, lua, hwloc, numactl
|
2020-07-18 16:06:22 +00:00
|
|
|
, readline, freeipmi, xorg, lz4, rdma-core, nixosTests
|
|
|
|
, pmix
|
2020-04-24 23:36:52 +00:00
|
|
|
# enable internal X11 support via libssh2
|
|
|
|
, enableX11 ? true
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "slurm";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "21.08.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# N.B. We use github release tags instead of https://www.schedmd.com/downloads.php
|
|
|
|
# because the latter does not keep older releases.
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SchedMD";
|
|
|
|
repo = "slurm";
|
|
|
|
# The release tags use - instead of .
|
|
|
|
rev = "${pname}-${builtins.replaceStrings ["."] ["-"] version}";
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "13fd72ifa1ar8yjavdywzvlk4fzxzhybi30pzcdvjnijc9y52j4m";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
patches = [
|
|
|
|
# increase string length to allow for full
|
|
|
|
# path of 'echo' in nix store
|
|
|
|
./common-env-echo.patch
|
|
|
|
# Required for configure to pick up the right dlopen path
|
|
|
|
./pmix-configure.patch
|
|
|
|
];
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace src/common/env.c \
|
|
|
|
--replace "/bin/echo" "${coreutils}/bin/echo"
|
2021-01-15 22:18:51 +00:00
|
|
|
'' + (lib.optionalString enableX11 ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace src/common/x11_util.c \
|
|
|
|
--replace '"/usr/bin/xauth"' '"${xorg.xauth}/bin/xauth"'
|
2020-06-18 07:06:33 +00:00
|
|
|
'');
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# nixos test fails to start slurmd with 'undefined symbol: slurm_job_preempt_mode'
|
|
|
|
# https://groups.google.com/forum/#!topic/slurm-devel/QHOajQ84_Es
|
|
|
|
# this doesn't fix tests completely at least makes slurmd to launch
|
|
|
|
hardeningDisable = [ "bindnow" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config libtool python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2020-08-20 17:08:02 +00:00
|
|
|
curl python3 munge perl pam zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
libmysqlclient ncurses gtk2 lz4 rdma-core
|
2020-06-18 07:06:33 +00:00
|
|
|
lua hwloc numactl readline freeipmi shadow.su
|
2020-07-18 16:06:22 +00:00
|
|
|
pmix
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals enableX11 [ xorg.xauth ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
configureFlags = with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
[ "--with-freeipmi=${freeipmi}"
|
|
|
|
"--with-hwloc=${hwloc.dev}"
|
|
|
|
"--with-lz4=${lz4.dev}"
|
|
|
|
"--with-munge=${munge}"
|
|
|
|
"--with-zlib=${zlib}"
|
|
|
|
"--with-ofed=${rdma-core}"
|
|
|
|
"--sysconfdir=/etc/slurm"
|
2020-07-18 16:06:22 +00:00
|
|
|
"--with-pmix=${pmix}"
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ (optional (gtk2 == null) "--disable-gtktest")
|
|
|
|
++ (optional (!enableX11) "--disable-x11");
|
|
|
|
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs ./doc/html/shtml2html.py
|
|
|
|
patchShebangs ./doc/man/man2html.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm -f $out/lib/*.la $out/lib/slurm/*.la
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
passthru.tests.slurm = nixosTests.slurm;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.schedmd.com/";
|
|
|
|
description = "Simple Linux Utility for Resource Management";
|
|
|
|
platforms = platforms.linux;
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.gpl2Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ jagajaga markuskowa ];
|
|
|
|
};
|
|
|
|
}
|