Modify setup.py to avoid crash due to version 4.0.0 of mpi4py during installation#181
Conversation
BenjaminRodenberg
left a comment
There was a problem hiding this comment.
Thanks for opening this PR. Some comments. I, unfortunately, have no idea why the CI is currently failing...
setup.py
Outdated
| license='LGPL-3.0', | ||
| packages=['fenicsprecice'], | ||
| install_requires=['pyprecice>=3.0.0.0', 'scipy', 'numpy>=1.13.3, <2', 'mpi4py'], | ||
| setup_requires=['mpi4py<4'], |
There was a problem hiding this comment.
I'm not sure what setup_requires exactly does but I would not put a hard requirement here for the sake of checking the FEniCS installation. If this check does not succeed there is probably a good reason for the warning. We should not try to fix a broken FEniCS installation with this setup.py.
There was a problem hiding this comment.
I looked a bit into the reason why mpi4py is failing and actually we are exactly trying to do this: We are fixing a broken FEniCS installation and this is also what we need to do because I think we cannot expect that there will be a corresponding fix for (legacy) FEniCS (either supporting mpi4py>=4 or restricting to mpi4py<4).
setup.py
Outdated
| try: | ||
| from fenics import * | ||
| except ModuleNotFoundError: | ||
| warnings.warn("No FEniCS installation found on system. Please install FEniCS and check the installation.\n\n" | ||
| "You can check this by running the command\n\n" | ||
| "python3 -c 'from fenics import *'\n\n" | ||
| "Please check https://fenicsproject.org/download/ for installation guidance.\n" | ||
| "The installation will continue, but please be aware that your installed version of the " | ||
| "fenics-adapter might not work as expected.") |
There was a problem hiding this comment.
See above. Try not to fix a broken FEniCS installation with this setup.py then you can also move this up to the original position. Note: We might remove this warning very soon anyways.
|
I removed the checks. See #182. |
|
@BenjaminRodenberg So now, we only need to require + install_requires=['pyprecice>=3.0.0.0', 'scipy', 'numpy>=1.13.3, <2', 'mpi4py<4']now? |
I hope so. |
BenjaminRodenberg
left a comment
There was a problem hiding this comment.
I synchronized this PR and removed the setup_requires. CI-wise everything looks good and I will merge this PR latest on the weekend.
…ing installation (precice#181) * Require mpi4py < 4 --------- Co-authored-by: Benjamin Rodenberg <benjamin.rodenberg@cit.tum.de>
* Due to failing run in #33 * Change consistent with precice/fenics-adapter#181
This PR closes #180.
setup_requires=['mpi4py<4']is necessary as this requirement is needed for the imported FEniCS below.