at 18.09-beta 1.4 kB view raw
1{ stdenv, fetchPypi, isPy27, python, buildPythonPackage 2, numpy, hdf5, cython, six, pkgconfig, unittest2 3, mpi4py ? null, openssh }: 4 5assert hdf5.mpiSupport -> mpi4py != null && hdf5.mpi == mpi4py.mpi; 6 7with stdenv.lib; 8 9let 10 mpi = hdf5.mpi; 11 mpiSupport = hdf5.mpiSupport; 12in buildPythonPackage rec { 13 version = "2.8.0"; 14 pname = "h5py"; 15 16 src = fetchPypi { 17 inherit pname version; 18 sha256 = "0mdr6wrq02ac93m1aqx9kad0ppfzmm4imlxqgyy1x4l7hmdcc9p6"; 19 }; 20 21 configure_flags = "--hdf5=${hdf5}" + optionalString mpiSupport " --mpi"; 22 23 postConfigure = '' 24 ${python.executable} setup.py configure ${configure_flags} 25 26 # Needed to run the tests reliably. See: 27 # https://bitbucket.org/mpi4py/mpi4py/issues/87/multiple-test-errors-with-openmpi-30 28 ${optionalString mpiSupport "export OMPI_MCA_rmaps_base_oversubscribe=yes"} 29 ''; 30 31 preBuild = if mpiSupport then "export CC=${mpi}/bin/mpicc" else ""; 32 33 checkInputs = optional isPy27 unittest2; 34 nativeBuildInputs = [ pkgconfig ]; 35 buildInputs = [ hdf5 cython ] 36 ++ optional mpiSupport mpi; 37 propagatedBuildInputs = [ numpy six] 38 ++ optionals mpiSupport [ mpi4py openssh ]; 39 40 # https://github.com/h5py/h5py/issues/1088 41 doCheck = false; 42 43 meta = { 44 description = 45 "Pythonic interface to the HDF5 binary data format"; 46 homepage = http://www.h5py.org/; 47 license = stdenv.lib.licenses.bsd2; 48 }; 49}