2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, libtool, curl
|
2022-06-16 17:23:12 +00:00
|
|
|
, python3, munge, perl, pam, shadow, coreutils, dbus, libbpf
|
2022-08-12 12:06:08 +00:00
|
|
|
, ncurses, libmysqlclient, lua, hwloc, numactl
|
2020-07-18 16:06:22 +00:00
|
|
|
, readline, freeipmi, xorg, lz4, rdma-core, nixosTests
|
|
|
|
, pmix
|
2022-05-18 14:49:53 +00:00
|
|
|
, libjwt
|
|
|
|
, libyaml
|
|
|
|
, json_c
|
2022-06-16 17:23:12 +00:00
|
|
|
, http-parser
|
2020-04-24 23:36:52 +00:00
|
|
|
# enable internal X11 support via libssh2
|
|
|
|
, enableX11 ? true
|
2022-08-12 12:06:08 +00:00
|
|
|
, enableGtk2 ? false, gtk2
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "slurm";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "23.02.3.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}";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-YMm8a7uyZpPEuWQcgddX+0Me+ndgbYoDnC+sbmN/Hh8=";
|
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" ];
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
nativeBuildInputs = [ pkg-config libtool python3 perl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-07-14 12:49:19 +00:00
|
|
|
curl python3 munge pam
|
2022-08-12 12:06:08 +00:00
|
|
|
libmysqlclient ncurses lz4 rdma-core
|
2022-07-14 12:49:19 +00:00
|
|
|
lua hwloc numactl readline freeipmi shadow.su
|
|
|
|
pmix json_c libjwt libyaml dbus libbpf
|
|
|
|
http-parser
|
2022-08-12 12:06:08 +00:00
|
|
|
] ++ lib.optionals enableX11 [ xorg.xauth ]
|
|
|
|
++ lib.optionals enableGtk2 [ gtk2 ];
|
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}"
|
2022-06-16 17:23:12 +00:00
|
|
|
"--with-http-parser=${http-parser}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-hwloc=${hwloc.dev}"
|
2022-05-18 14:49:53 +00:00
|
|
|
"--with-json=${json_c.dev}"
|
|
|
|
"--with-jwt=${libjwt}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-lz4=${lz4.dev}"
|
|
|
|
"--with-munge=${munge}"
|
2023-07-15 17:15:38 +00:00
|
|
|
"--with-yaml=${libyaml.dev}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-ofed=${rdma-core}"
|
|
|
|
"--sysconfdir=/etc/slurm"
|
2020-07-18 16:06:22 +00:00
|
|
|
"--with-pmix=${pmix}"
|
2022-06-16 17:23:12 +00:00
|
|
|
"--with-bpf=${libbpf}"
|
2022-08-12 12:06:08 +00:00
|
|
|
] ++ (optional enableGtk2 "--disable-gtktest")
|
2020-04-24 23:36:52 +00:00
|
|
|
++ (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 ];
|
|
|
|
};
|
|
|
|
}
|