1 { stdenv, lib, fetchurl, perl, gfortran
2 , openssh, hwloc, python3
3 # either libfabric or ucx work for ch4backend on linux. On darwin, neither of
4 # these libraries currently build so this argument is ignored on Darwin.
6 # Process manager to build
7 , withPm ? "hydra:gforker"
10 assert (ch4backend.pname == "ucx" || ch4backend.pname == "libfabric");
12 stdenv.mkDerivation rec {
17 url = "https://www.mpich.org/static/downloads/${version}/mpich-${version}.tar.gz";
18 sha256 = "sha256-F0BuqQpu1OzVvjnJ3cv6yTQ+arT3esToxevko+O2xQE=";
25 ] ++ lib.optionals (lib.versionAtLeast gfortran.version "10") [
26 "FFLAGS=-fallow-argument-mismatch" # https://github.com/pmodels/mpich/issues/4300
27 "FCFLAGS=-fallow-argument-mismatch"
30 enableParallelBuilding = true;
32 nativeBuildInputs = [ gfortran python3 ];
33 buildInputs = [ perl openssh hwloc ]
34 ++ lib.optional (!stdenv.isDarwin) ch4backend;
39 # Ensure the default compilers are the ones mpich was built with
40 sed -i 's:CC="gcc":CC=${stdenv.cc}/bin/gcc:' $out/bin/mpicc
41 sed -i 's:CXX="g++":CXX=${stdenv.cc}/bin/g++:' $out/bin/mpicxx
42 sed -i 's:FC="gfortran":FC=${gfortran}/bin/gfortran:' $out/bin/mpifort
46 description = "Implementation of the Message Passing Interface (MPI) standard";
49 MPICH2 is a free high-performance and portable implementation of
50 the Message Passing Interface (MPI) standard, both version 1 and
53 homepage = "http://www.mcs.anl.gov/mpi/mpich2/";
55 url = "http://git.mpich.org/mpich.git/blob/a385d6d0d55e83c3709ae851967ce613e892cd21:/COPYRIGHT";
56 fullName = "MPICH license (permissive)";
58 maintainers = [ maintainers.markuskowa ];
59 platforms = platforms.linux ++ platforms.darwin;