bscpkgs/pkgs/mpich/default.nix

69 lines
1.8 KiB
Nix
Raw Normal View History

2020-08-19 11:06:23 +02:00
{
2020-08-26 19:21:14 +02:00
stdenv
2022-09-01 16:27:29 +02:00
, lib
2020-08-26 19:21:14 +02:00
, fetchurl
, perl
, gfortran
, openssh
, hwloc
, libfabric
, enableDebug ? false
2020-08-19 11:06:23 +02:00
}:
2022-09-01 16:27:29 +02:00
with lib;
2020-08-26 19:21:14 +02:00
2020-08-19 11:06:23 +02:00
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";
};
configureFlags = [
"--enable-shared"
"--enable-sharedlib"
"--with-device=ch4:ofi"
"--with-libfabric=${libfabric}"
2020-08-26 19:21:14 +02:00
]
++ optional enableDebug "--enable-g=dbg,log";
2020-08-19 11:06:23 +02:00
enableParallelBuilding = true;
buildInputs = [ perl gfortran openssh hwloc libfabric ];
hardeningDisable = [ "all" ];
2020-08-19 11:06:23 +02:00
# 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
''
2022-09-01 16:27:29 +02:00
+ lib.optionalString (!stdenv.isDarwin) ''
2020-08-19 11:06:23 +02:00
# /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
'';
2022-09-01 16:27:29 +02:00
meta = with lib; {
2020-08-19 11:06:23 +02:00
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;
};
}