New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use mpi attribute consistently to provide a default MPI implementation #108983
Conversation
f029815
to
77e0a1a
Compare
pkgs/applications/science/chemistry/quantum-espresso/default.nix
Outdated
Show resolved
Hide resolved
Result of 6 packages marked as broken and skipped:
30 packages failed to build:
50 packages built:
|
0df374b
to
b2bd40e
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/mixed-python-c-with-python-runtime-dependencies/7679/10 |
CC @matthewbauer @FRidh Any comments or suggestions? |
Rebased: resolved merge conflicts. |
Are there any objections to merging? |
Resolved another merge conflict. |
5ad336b
to
6e3cd37
Compare
Use the attribute mpi to provide a system wide default MPI implementation. The default is openmpi (as before). This now allows for overriding the MPI implentation by using the overlay mechanism. Build all packages with mpich instead of the default openmpi can now be achived like this: self: super: { mpi = super.mpich; } All derivations that have been using "mpi ? null" to provide optional building with MPI have been change in the following way to allow for optional builds with MPI: { ... , mpi , useMpi ? false }
@GrahamcOfBorg build quantum-espresso-mpi lammps-mpi |
@hmenke This PR was merged into master, so it should not affect nixpkgs-20.09 (note that doing the override in 20.09 will lead to weird results since the |
Sorry for being unclear. I meant that a build that worked on 20.09 broke on unstable, because boost is now no longer compiled with MPI support by default. A simple |
@hmenke OK, I think I see what you mean. I checked the diffs from this PR. i can not see that MPi was enabled by default before (at least not that i can see in nixpgks). The boost input parameter was set to Btw.: the potential breakage is documented in the release notes, where it is noted that Can you please open an issue and also describe for which package this problem occurs. |
This was just one of my own packages not in Hence I think everything is fine with this PR and there is nothing to worry about. |
Motivation for this change
All programs that need MPI libraries are using
openmpi
at the moment. However, some useopenmpi
directly while recent additions tended to usempi = openmpi
as input parameter. The change in this PR now makes consistent use ofmpi
as an input parameter for all derivations that use MPI. This allows for an easy, system-wide switch by simply overriding thempi
attribute via overlays, e.g.:This follows the idea of #83888.
Things done
mpi = openmpi;
totop-level/all-packages.nix
mpi ? null
for optional building has been used, the optionuseMpi ? false
has been added.sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
Run
mpi = openmpi
and partially formpi = mpich
../result/bin/
)nix path-info -S
before and after)