Compare commits
4 Commits
fox-regres
...
4adc925ce7
| Author | SHA1 | Date | |
|---|---|---|---|
| 4adc925ce7 | |||
| b7832b5d9d | |||
| 03fabe0e33 | |||
| 0abac83a13 |
54
flake.nix
54
flake.nix
@@ -14,6 +14,12 @@ let
|
||||
specialArgs = { inherit nixpkgs bscpkgs agenix; theFlake = self; };
|
||||
modules = [ "${self.outPath}/m/${name}/configuration.nix" ];
|
||||
};
|
||||
# For now we only support x86
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlays.default ];
|
||||
};
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
@@ -31,36 +37,22 @@ in
|
||||
weasel = mkConf "weasel";
|
||||
};
|
||||
|
||||
packages.x86_64-linux = self.nixosConfigurations.hut.pkgs // {
|
||||
bscpkgs = bscpkgs.packages.x86_64-linux;
|
||||
nixpkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
};
|
||||
};
|
||||
#packages.x86_64-linux = self.nixosConfigurations.hut.pkgs // {
|
||||
# bscpkgs = bscpkgs.packages.x86_64-linux;
|
||||
# nixpkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
#};
|
||||
|
||||
# TODO: Merge from bscpkgs:
|
||||
#
|
||||
# inputs.nixpkgs.url = "nixpkgs";
|
||||
#
|
||||
# outputs = { self, nixpkgs, ...}:
|
||||
# let
|
||||
# # For now we only support x86
|
||||
# system = "x86_64-linux";
|
||||
# pkgs = import nixpkgs {
|
||||
# inherit system;
|
||||
# overlays = [ self.overlays.default ];
|
||||
# };
|
||||
# in
|
||||
# {
|
||||
# bscOverlay = import ./overlay.nix;
|
||||
# overlays.default = self.bscOverlay;
|
||||
# # full nixpkgs with our overlay applied
|
||||
# legacyPackages.${system} = pkgs;
|
||||
#
|
||||
# hydraJobs = {
|
||||
# inherit (self.legacyPackages.${system}.bsc-ci) tests pkgs cross;
|
||||
# };
|
||||
#
|
||||
# # propagate nixpkgs lib, so we can do bscpkgs.lib
|
||||
# inherit (nixpkgs) lib;
|
||||
# };
|
||||
bscOverlay = import ./overlay.nix;
|
||||
overlays.default = self.bscOverlay;
|
||||
|
||||
# full nixpkgs with our overlay applied
|
||||
legacyPackages.${system} = pkgs;
|
||||
|
||||
hydraJobs = {
|
||||
inherit (self.legacyPackages.${system}.bsc-ci) tests pkgs cross;
|
||||
};
|
||||
|
||||
# propagate nixpkgs lib, so we can do bscpkgs.lib
|
||||
inherit (nixpkgs) lib;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ let
|
||||
jemallocNanos6 = callPackage ./pkgs/nanos6/jemalloc.nix { };
|
||||
lmbench = callPackage ./pkgs/lmbench/default.nix { };
|
||||
mcxx = callPackage ./pkgs/mcxx/default.nix { };
|
||||
mpi = final.mpich; # Set MPICH as default
|
||||
mpich = callPackage ./pkgs/mpich/default.nix { mpich = prev.mpich; };
|
||||
nanos6 = callPackage ./pkgs/nanos6/default.nix { };
|
||||
nanos6Debug = final.nanos6.override { enableDebug = true; };
|
||||
nixtools = callPackage ./pkgs/nixtools/default.nix { };
|
||||
|
||||
@@ -1,68 +1,36 @@
|
||||
{
|
||||
stdenv
|
||||
, lib
|
||||
, fetchurl
|
||||
, perl
|
||||
, gfortran
|
||||
, openssh
|
||||
, hwloc
|
||||
, libfabric
|
||||
, enableDebug ? false
|
||||
, mpich
|
||||
, pmix
|
||||
, gfortran
|
||||
, symlinkJoin
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mpich";
|
||||
version = "3.3.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://www.mpich.org/static/downloads/${version}/mpich-${version}.tar.gz";
|
||||
sha256 = "1farz5zfx4cd0c3a0wb9pgfypzw0xxql1j1294z1sxslga1ziyjb";
|
||||
let
|
||||
# pmix comes with the libraries in .out and headers in .dev
|
||||
pmixAll = symlinkJoin {
|
||||
name = "pmix-all";
|
||||
paths = [ pmix.dev pmix.out ];
|
||||
};
|
||||
|
||||
in mpich.overrideAttrs (old: {
|
||||
buildInput = old.buildInputs ++ [
|
||||
libfabric
|
||||
pmixAll
|
||||
];
|
||||
configureFlags = [
|
||||
"--enable-shared"
|
||||
"--enable-sharedlib"
|
||||
"--with-pm=no"
|
||||
"--with-device=ch4:ofi"
|
||||
"--with-pmi=pmix"
|
||||
"--with-pmix=${pmixAll}"
|
||||
"--with-libfabric=${libfabric}"
|
||||
]
|
||||
++ optional enableDebug "--enable-g=dbg,log";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
buildInputs = [ perl gfortran openssh hwloc libfabric ];
|
||||
"--enable-g=log"
|
||||
] ++ lib.optionals (lib.versionAtLeast gfortran.version "10") [
|
||||
"FFLAGS=-fallow-argument-mismatch" # https://github.com/pmodels/mpich/issues/4300
|
||||
"FCFLAGS=-fallow-argument-mismatch"
|
||||
];
|
||||
hardeningDisable = [ "all" ];
|
||||
|
||||
# doCheck = true; # Fails
|
||||
|
||||
preFixup = ''
|
||||
# Ensure the default compilers are the ones mpich was built with
|
||||
sed -i 's:CC="gcc":CC=${stdenv.cc}/bin/gcc:' $out/bin/mpicc
|
||||
sed -i 's:CXX="g++":CXX=${stdenv.cc}/bin/g++:' $out/bin/mpicxx
|
||||
sed -i 's:FC="gfortran":FC=${gfortran}/bin/gfortran:' $out/bin/mpifort
|
||||
''
|
||||
+ lib.optionalString (!stdenv.isDarwin) ''
|
||||
# /tmp/nix-build... ends up in the RPATH, fix it manually
|
||||
for entry in $out/bin/mpichversion $out/bin/mpivars; do
|
||||
echo "fix rpath: $entry"
|
||||
patchelf --set-rpath "$out/lib" $entry
|
||||
done
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Implementation of the Message Passing Interface (MPI) standard";
|
||||
|
||||
longDescription = ''
|
||||
MPICH is a high-performance and widely portable implementation of
|
||||
the Message Passing Interface (MPI) standard (MPI-1, MPI-2 and MPI-3).
|
||||
'';
|
||||
homepage = "http://www.mpich.org";
|
||||
license = {
|
||||
url = "https://github.com/pmodels/mpich/blob/v${version}/COPYRIGHT";
|
||||
fullName = "MPICH license (permissive)";
|
||||
};
|
||||
maintainers = [ ];
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,35 +1,5 @@
|
||||
final: prev:
|
||||
{
|
||||
# Set MPICH as default
|
||||
mpi = final.mpich;
|
||||
|
||||
# Configure the network for MPICH
|
||||
mpich = with final; let
|
||||
# pmix comes with the libraries in .out and headers in .dev
|
||||
pmixAll = symlinkJoin {
|
||||
name = "pmix-all";
|
||||
paths = [ pmix.dev pmix.out ];
|
||||
};
|
||||
in prev.mpich.overrideAttrs (old: {
|
||||
buildInput = old.buildInputs ++ [
|
||||
libfabric
|
||||
pmixAll
|
||||
];
|
||||
configureFlags = [
|
||||
"--enable-shared"
|
||||
"--enable-sharedlib"
|
||||
"--with-pm=no"
|
||||
"--with-device=ch4:ofi"
|
||||
"--with-pmi=pmix"
|
||||
"--with-pmix=${pmixAll}"
|
||||
"--with-libfabric=${libfabric}"
|
||||
"--enable-g=log"
|
||||
] ++ lib.optionals (lib.versionAtLeast gfortran.version "10") [
|
||||
"FFLAGS=-fallow-argument-mismatch" # https://github.com/pmodels/mpich/issues/4300
|
||||
"FCFLAGS=-fallow-argument-mismatch"
|
||||
];
|
||||
});
|
||||
|
||||
slurm = prev.slurm.overrideAttrs (old: {
|
||||
patches = (old.patches or []) ++ [
|
||||
# See https://bugs.schedmd.com/show_bug.cgi?id=19324
|
||||
|
||||
@@ -1,80 +1,22 @@
|
||||
{ stdenv, lib, fetchFromGitHub, pkg-config, libtool, curl
|
||||
, python, munge, perl, pam, openssl
|
||||
, ncurses, libmysqlclient, gtk2, lua, hwloc, numactl
|
||||
, readline, freeipmi, libssh2, xorg
|
||||
, pmix
|
||||
# enable internal X11 support via libssh2
|
||||
, enableX11 ? true
|
||||
}:
|
||||
{ slurm }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "slurm-${version}";
|
||||
version = "17.11.9-2";
|
||||
|
||||
# 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 = "${builtins.replaceStrings ["."] ["-"] name}";
|
||||
sha256 = "1lq4ac6yjai6wh979dciw8v3d99zbd3w36rfh0vpncqm672fg1qy";
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
prePatch = lib.optional enableX11 ''
|
||||
substituteInPlace src/common/x11_util.c \
|
||||
--replace '"/usr/bin/xauth"' '"${xorg.xauth}/bin/xauth"'
|
||||
slurm.overrideAttrs (old: {
|
||||
patches = (old.patches or []) ++ [
|
||||
# See https://bugs.schedmd.com/show_bug.cgi?id=19324
|
||||
# Still unmerged as of 2025-10-03, another corpo-cancer.
|
||||
./slurm-rank-expansion.patch
|
||||
];
|
||||
# Install also the pam_slurm_adopt library to restrict users from accessing
|
||||
# nodes with no job allocated.
|
||||
# TODO: Review pam_slurm_adopt, I don't trust their code much.
|
||||
postBuild = (old.postBuild or "") + ''
|
||||
pushd contribs/pam_slurm_adopt
|
||||
make "PAM_DIR=$out/lib/security"
|
||||
popd
|
||||
'';
|
||||
|
||||
# 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" ];
|
||||
|
||||
nativeBuildInputs = [ pkg-config libtool ];
|
||||
buildInputs = [
|
||||
curl python munge perl pam openssl
|
||||
libmysqlclient ncurses gtk2
|
||||
lua hwloc numactl readline freeipmi
|
||||
pmix
|
||||
] ++ lib.optionals enableX11 [ libssh2 xorg.xauth ];
|
||||
|
||||
configureFlags = with lib;
|
||||
[ "--with-munge=${munge}"
|
||||
"--with-ssl=${openssl.dev}"
|
||||
"--with-hwloc=${hwloc.dev}"
|
||||
"--with-freeipmi=${freeipmi}"
|
||||
"--sysconfdir=/etc/slurm"
|
||||
"--with-pmix=${pmix}"
|
||||
] ++ (optional (gtk2 == null) "--disable-gtktest")
|
||||
++ (optional enableX11 "--with-libssh2=${libssh2.dev}");
|
||||
|
||||
|
||||
preConfigure = ''
|
||||
patchShebangs ./doc/html/shtml2html.py
|
||||
patchShebangs ./doc/man/man2html.py
|
||||
patchShebangs ./configure
|
||||
postInstall = (old.postInstall or "") + ''
|
||||
pushd contribs/pam_slurm_adopt
|
||||
make "PAM_DIR=$out/lib/security" install
|
||||
popd
|
||||
'';
|
||||
|
||||
# postBuild = ''
|
||||
# pushd contrib/pmi2
|
||||
# make -j install
|
||||
# popd
|
||||
# '';
|
||||
|
||||
postInstall = ''
|
||||
rm -f $out/lib/*.la $out/lib/slurm/*.la
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with lib; {
|
||||
homepage = http://www.schedmd.com/;
|
||||
description = "Simple Linux Utility for Resource Management";
|
||||
platforms = platforms.linux;
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ jagajaga markuskowa ];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user