Skip to content

Commit

Permalink
Merge pull request #34065 from markuskowa/openmpi3-pr
Browse files Browse the repository at this point in the history
openmpi: 1.10.7->3.0.0, add markuskowa as maintainer
  • Loading branch information
FRidh committed Feb 11, 2018
2 parents 55c06e9 + 389a130 commit 35ab636
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 24 deletions.
44 changes: 24 additions & 20 deletions pkgs/development/libraries/openmpi/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{stdenv, fetchurl, gfortran, perl, rdma-core
{ stdenv, fetchurl, gfortran, perl, libnl, rdma-core, zlib

# Enable the Sun Grid Engine bindings
, enableSGE ? false
Expand All @@ -7,44 +7,48 @@
, enablePrefix ? false
}:

with stdenv.lib;

let
majorVersion = "1.10";
majorVersion = "3.0";
minorVersion = "0";

in stdenv.mkDerivation rec {
name = "openmpi-${majorVersion}.7";
name = "openmpi-${majorVersion}.${minorVersion}";

src = fetchurl {
url = "http://www.open-mpi.org/software/ompi/v${majorVersion}/downloads/${name}.tar.bz2";
sha256 = "142s1vny9gllkq336yafxayjgcirj2jv0ddabj879jgya7hyr2d0";
sha256 = "1mw2d94k6mp4scg1wnkj50vdh734fy5m2ygyrj65s4mh3prbz6gn";
};

buildInputs = [ gfortran ]
++ optional (stdenv.isLinux || stdenv.isFreeBSD) rdma-core;
postPatch = ''
patchShebangs ./
'';

buildInputs = with stdenv; [ gfortran zlib ]
++ lib.optional isLinux libnl
++ lib.optional (isLinux || isFreeBSD) rdma-core;

nativeBuildInputs = [ perl ];

configureFlags = []
++ optional enableSGE "--with-sge"
++ optional enablePrefix "--enable-mpirun-prefix-by-default"
configureFlags = with stdenv; []
++ lib.optional isLinux "--with-libnl=${libnl.dev}"
++ lib.optional enableSGE "--with-sge"
++ lib.optional enablePrefix "--enable-mpirun-prefix-by-default"
;

enableParallelBuilding = true;

preBuild = ''
patchShebangs ompi/mpi/fortran/base/gen-mpi-sizeof.pl
'';

postInstall = ''
rm -f $out/lib/*.la
rm -f $out/lib/*.la
'';

meta = {
doCheck = true;

meta = with stdenv.lib; {
homepage = http://www.open-mpi.org/;
description = "Open source MPI-2 implementation";
longDescription = "The Open MPI Project is an open source MPI-2 implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers.";
maintainers = [ ];
description = "Open source MPI-3 implementation";
longDescription = "The Open MPI Project is an open source MPI-3 implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers.";
maintainers = with maintainers; [ markuskowa ];
license = licenses.bsd3;
platforms = platforms.unix;
};
}
8 changes: 6 additions & 2 deletions pkgs/development/python-modules/h5py/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv, fetchurl, python, buildPythonPackage
, numpy, hdf5, cython, six, pkgconfig
, mpi4py ? null }:
, mpi4py ? null, openssh }:

assert hdf5.mpiSupport -> mpi4py != null && hdf5.mpi == mpi4py.mpi;

Expand All @@ -24,6 +24,10 @@ in buildPythonPackage rec {

postConfigure = ''
${python.executable} setup.py configure ${configure_flags}
# Needed to run the tests reliably. See:
# https://bitbucket.org/mpi4py/mpi4py/issues/87/multiple-test-errors-with-openmpi-30
${optionalString mpiSupport "export OMPI_MCA_rmaps_base_oversubscribe=yes"}
'';

preBuild = if mpiSupport then "export CC=${mpi}/bin/mpicc" else "";
Expand All @@ -33,7 +37,7 @@ in buildPythonPackage rec {
++ optional mpiSupport mpi
;
propagatedBuildInputs = [ numpy six]
++ optional mpiSupport mpi4py
++ optionals mpiSupport [ mpi4py openssh ]
;

meta = {
Expand Down
14 changes: 12 additions & 2 deletions pkgs/development/python-modules/mpi4py/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchPypi, python, buildPythonPackage, mpi }:
{ stdenv, fetchPypi, python, buildPythonPackage, mpi, openssh }:

buildPythonPackage rec {
pname = "mpi4py";
Expand All @@ -14,6 +14,12 @@ buildPythonPackage rec {
inherit mpi;
};

postPatch = ''
substituteInPlace test/test_spawn.py --replace \
"unittest.skipMPI('openmpi(<3.0.0)')" \
"unittest.skipMPI('openmpi')"
'';

configurePhase = "";

installPhase = ''
Expand All @@ -28,11 +34,15 @@ buildPythonPackage rec {
# sometimes packages specify where files should be installed outside the usual
# python lib prefix, we override that back so all infrastructure (setup hooks)
# work as expected
# Needed to run the tests reliably. See:
# https://bitbucket.org/mpi4py/mpi4py/issues/87/multiple-test-errors-with-openmpi-30
export OMPI_MCA_rmaps_base_oversubscribe=yes
'';

setupPyBuildFlags = ["--mpicc=${mpi}/bin/mpicc"];

buildInputs = [ mpi ];
buildInputs = [ mpi openssh ];

meta = {
description =
Expand Down

0 comments on commit 35ab636

Please sign in to comment.