mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-29 19:30:11 +00:00
python3Packages.mpi4py: fix build on darwin
Co-authored-by: Doron Behar <doron.behar@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
fetchFromGitHub,
|
||||
cython,
|
||||
setuptools,
|
||||
stdenv,
|
||||
mpi,
|
||||
toPythonModule,
|
||||
pytest,
|
||||
@@ -52,6 +53,13 @@ buildPythonPackage rec {
|
||||
# see https://github.com/mpi4py/mpi4py/issues/545#issuecomment-2343011460
|
||||
env.MPI4PY_TEST_SPAWN = if mpi.pname == "openmpi" then 0 else 1;
|
||||
|
||||
disabledTests = [
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
# testJoin calls socket.getaddrinfo(socket.gethostname(), ...)
|
||||
"test_dynproc.TestDPM.testJoin"
|
||||
];
|
||||
|
||||
# follow upstream's checkPhase
|
||||
# see https://github.com/mpi4py/mpi4py/blob/4.1.0/.github/workflows/ci-test.yml#L92-L95
|
||||
checkPhase = ''
|
||||
@@ -60,7 +68,9 @@ buildPythonPackage rec {
|
||||
echo 'Testing mpi4py (np=1)'
|
||||
mpiexec -n 1 python test/main.py -v
|
||||
echo 'Testing mpi4py (np=2)'
|
||||
mpiexec -n 2 python test/main.py -v -f -e spawn
|
||||
mpiexec -n 2 python test/main.py -v -f -e spawn${
|
||||
lib.concatMapStrings (test: " -x ${test}") disabledTests
|
||||
}
|
||||
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user