nixpkgs/pkgs/development/libraries/mpich/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

79 lines
2.6 KiB
Nix
Raw Normal View History

2021-01-07 22:40:42 +00:00
{ stdenv, lib, fetchurl, perl, gfortran
2022-01-23 12:32:29 +00:00
, openssh, hwloc, python3
# either libfabric or ucx work for ch4backend on linux. On darwin, neither of
# these libraries currently build so this argument is ignored on Darwin.
, ch4backend
2023-12-25 12:39:38 +00:00
# Process managers to build (`--with-pm`),
# cf. https://github.com/pmodels/mpich/blob/b80a6d7c24defe7cdf6c57c52430f8075a0a41d6/README.vin#L562-L586
, withPm ? [ "hydra" "gforker" ]
, pmix
2023-12-25 12:39:38 +00:00
# PMIX support is likely incompatible with process managers (`--with-pm`)
# https://github.com/NixOS/nixpkgs/pull/274804#discussion_r1432601476
, pmixSupport ? false
2018-02-02 18:35:42 +00:00
} :
let
2024-01-16 02:24:05 +00:00
withPmStr = if withPm != [ ] then builtins.concatStringsSep ":" withPm else "no";
in
assert (ch4backend.pname == "ucx" || ch4backend.pname == "libfabric");
2021-01-07 22:40:42 +00:00
2017-09-10 11:43:32 +00:00
stdenv.mkDerivation rec {
pname = "mpich";
2024-02-12 16:43:17 +00:00
version = "4.2.0";
src = fetchurl {
url = "https://www.mpich.org/static/downloads/${version}/mpich-${version}.tar.gz";
2024-02-12 16:43:17 +00:00
sha256 = "sha256-pkpmeBueUxKtBS0yaJ4jJS90WyfuiBisKsDIIJvAuQ4=";
};
2023-10-08 09:09:21 +00:00
outputs = [ "out" "doc" "man" ];
2018-02-02 18:35:42 +00:00
configureFlags = [
"--enable-shared"
2024-01-16 02:24:05 +00:00
"--with-pm=${withPmStr}"
2021-12-05 20:55:56 +00:00
] ++ lib.optionals (lib.versionAtLeast gfortran.version "10") [
"FFLAGS=-fallow-argument-mismatch" # https://github.com/pmodels/mpich/issues/4300
"FCFLAGS=-fallow-argument-mismatch"
] ++ lib.optionals pmixSupport [
"--with-pmix"
2018-02-02 18:35:42 +00:00
];
enableParallelBuilding = true;
2022-01-23 12:32:29 +00:00
nativeBuildInputs = [ gfortran python3 ];
buildInputs = [ perl openssh hwloc ]
++ lib.optional (!stdenv.isDarwin) ch4backend
++ lib.optional pmixSupport pmix;
2018-02-02 18:35:42 +00:00
doCheck = true;
preFixup = ''
2018-12-19 00:53:18 +00:00
# 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
2021-01-07 22:40:42 +00:00
'';
meta = with lib; {
2023-12-25 12:39:38 +00:00
# As far as we know, --with-pmix silently disables all of `--with-pm`
2024-01-16 02:24:05 +00:00
broken = pmixSupport && withPm != [ ];
description = "Implementation of the Message Passing Interface (MPI) standard";
longDescription = ''
MPICH2 is a free high-performance and portable implementation of
the Message Passing Interface (MPI) standard, both version 1 and
version 2.
'';
homepage = "http://www.mcs.anl.gov/mpi/mpich2/";
2018-02-02 20:08:47 +00:00
license = {
url = "http://git.mpich.org/mpich.git/blob/a385d6d0d55e83c3709ae851967ce613e892cd21:/COPYRIGHT";
2018-02-02 20:08:47 +00:00
fullName = "MPICH license (permissive)";
};
maintainers = [ maintainers.markuskowa ];
2018-12-19 00:53:18 +00:00
platforms = platforms.linux ++ platforms.darwin;
};
}