Merge pull request #3316 from aherrmann/pr_mpi

MPI support for HDF5 and SGE support for OpenMPI
This commit is contained in:
Michael Raskin
2014-08-29 01:22:02 +04:00
6 changed files with 142 additions and 2 deletions

View File

@@ -0,0 +1,43 @@
{ stdenv, fetchurl, python, buildPythonPackage
, numpy, hdf5, cython
, mpiSupport ? false, mpi4py ? null, mpi ? null }:
assert mpiSupport == hdf5.mpiSupport;
assert mpiSupport -> mpi != null
&& mpi4py != null
&& mpi == mpi4py.mpi
&& mpi == hdf5.mpi
;
with stdenv.lib;
buildPythonPackage rec {
name = "h5py-2.3.1";
src = fetchurl {
url = "https://pypi.python.org/packages/source/h/h5py/${name}.tar.gz";
md5 = "8f32f96d653e904d20f9f910c6d9dd91";
};
setupPyBuildFlags = [ "--hdf5=${hdf5}" ]
++ optional mpiSupport "--mpi"
;
setupPyInstallFlags = setupPyBuildFlags;
preBuild = if mpiSupport then "export CC=${mpi}/bin/mpicc" else "";
buildInputs = [ hdf5 cython ]
++ optional mpiSupport mpi
;
propagatedBuildInputs = [ numpy ]
++ optional mpiSupport mpi4py
;
meta = {
description = "
The h5py package is a Pythonic interface to the HDF5 binary data format.
";
homepage = "http://www.h5py.org/";
license = stdenv.lib.licenses.bsd2;
};
}

View File

@@ -0,0 +1,45 @@
{ stdenv, fetchurl, python, buildPythonPackage, mpi, openssh }:
buildPythonPackage rec {
name = "mpi4py-1.3.1";
src = fetchurl {
url = "https://bitbucket.org/mpi4py/mpi4py/downloads/${name}.tar.gz";
sha256 = "e7bd2044aaac5a6ea87a87b2ecc73b310bb6efe5026031e33067ea3c2efc3507";
};
passthru = {
inherit mpi;
};
configurePhase = "";
installPhase = ''
mkdir -p "$out/lib/${python.libPrefix}/site-packages"
export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
${python}/bin/${python.executable} setup.py install \
--install-lib=$out/lib/${python.libPrefix}/site-packages \
--prefix="$out"
# --install-lib:
# 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
'';
setupPyBuildFlags = ["--mpicc=${mpi}/bin/mpicc"];
buildInputs = [ mpi ];
# Requires openssh for tests. Tests of dependent packages will also fail,
# if openssh is not present. E.g. h5py with mpi support.
propagatedBuildInputs = [ openssh ];
meta = {
description = "
Provides Python bindings for the Message Passing Interface standard.
";
homepage = "http://code.google.com/p/mpi4py/";
license = stdenv.lib.licenses.bsd3;
};
}