2021-02-05 17:12:51 +00:00
|
|
|
{ stdenv, lib, fetchurl, perl, gfortran
|
2022-01-25 03:21:06 +00:00
|
|
|
, openssh, hwloc, python3
|
2021-05-20 23:08:51 +00:00
|
|
|
# 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
|
2021-02-05 17:12:51 +00:00
|
|
|
# Process manager to build
|
|
|
|
, withPm ? "hydra:gforker"
|
2020-04-24 23:36:52 +00:00
|
|
|
} :
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
assert (ch4backend.pname == "ucx" || ch4backend.pname == "libfabric");
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mpich";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "4.0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.mpich.org/static/downloads/${version}/mpich-${version}.tar.gz";
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "0hnxvqhhscp3h70zf538dhqz9jwmqpwwnj3fqabdk8nli6lg2hjs";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-shared"
|
|
|
|
"--enable-sharedlib"
|
2021-02-05 17:12:51 +00:00
|
|
|
"--with-pm=${withPm}"
|
2022-04-27 09:35:20 +00:00
|
|
|
] ++ lib.optionals (lib.versionAtLeast gfortran.version "10") [
|
|
|
|
"FFLAGS=-fallow-argument-mismatch" # https://github.com/pmodels/mpich/issues/4300
|
|
|
|
"FCFLAGS=-fallow-argument-mismatch"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
nativeBuildInputs = [ gfortran python3 ];
|
2021-09-26 12:46:18 +00:00
|
|
|
buildInputs = [ perl openssh hwloc ]
|
2021-05-20 23:08:51 +00:00
|
|
|
++ lib.optional (!stdenv.isDarwin) ch4backend;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
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
|
2021-02-05 17:12:51 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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/";
|
|
|
|
license = {
|
|
|
|
url = "http://git.mpich.org/mpich.git/blob/a385d6d0d55e83c3709ae851967ce613e892cd21:/COPYRIGHT";
|
|
|
|
fullName = "MPICH license (permissive)";
|
|
|
|
};
|
|
|
|
maintainers = [ maintainers.markuskowa ];
|
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|