1 { lib, fetchPypi, fetchpatch, python, buildPythonPackage, mpi, openssh }:
3 buildPythonPackage rec {
9 sha256 = "012d716c8b9ed1e513fcc4b18e5af16a8791f51e6d1716baccf988ad355c5a1f";
12 patches = [ (fetchpatch {
13 name = "disable-broken-test"; # upstream patch
14 url = "https://github.com/mpi4py/mpi4py/commit/e13cc3ee59ec6ec2c6ee20e384e1e649d5027e8a.patch";
15 sha256 = "0iwknrhxnfmsqjj8ahpn50c8pcdyv9p3wmcqi1jhr4i5y7lnmvvx";
23 substituteInPlace test/test_spawn.py --replace \
24 "unittest.skipMPI('openmpi(<3.0.0)')" \
25 "unittest.skipMPI('openmpi')"
31 mkdir -p "$out/lib/${python.libPrefix}/site-packages"
32 export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
34 ${python}/bin/${python.executable} setup.py install \
35 --install-lib=$out/lib/${python.libPrefix}/site-packages \
39 # sometimes packages specify where files should be installed outside the usual
40 # python lib prefix, we override that back so all infrastructure (setup hooks)
43 # Needed to run the tests reliably. See:
44 # https://bitbucket.org/mpi4py/mpi4py/issues/87/multiple-test-errors-with-openmpi-30
45 export OMPI_MCA_rmaps_base_oversubscribe=yes
48 setupPyBuildFlags = ["--mpicc=${mpi}/bin/mpicc"];
50 nativeBuildInputs = [ mpi openssh ];
53 description = "Python bindings for the Message Passing Interface standard";
54 homepage = "https://bitbucket.org/mpi4py/mpi4py/";
55 license = licenses.bsd3;