diff options
author | Markus Kowalewski <markus.kowalewski@gmail.com> | 2021-01-10 13:40:19 +0100 |
---|---|---|
committer | Markus Kowalewski <markus.kowalewski@gmail.com> | 2021-01-23 12:15:13 +0100 |
commit | 6dba41fbcb4239a628ac5bdf0035882a679b8648 (patch) | |
tree | a11ed2cef0b00b88ba8e99a8d30f8890aec90781 /pkgs/applications/science/chemistry/quantum-espresso | |
parent | f6a583eeece936a1d917de67194fec4b6c74cf1f (diff) |
mpi: use mpi attribute consistently as the default MPI implementations
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 }
Diffstat (limited to 'pkgs/applications/science/chemistry/quantum-espresso')
-rw-r--r-- | pkgs/applications/science/chemistry/quantum-espresso/default.nix | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkgs/applications/science/chemistry/quantum-espresso/default.nix b/pkgs/applications/science/chemistry/quantum-espresso/default.nix index c7b1f90104682..6d70e9f984f64 100644 --- a/pkgs/applications/science/chemistry/quantum-espresso/default.nix +++ b/pkgs/applications/science/chemistry/quantum-espresso/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, fetchurl , gfortran, fftw, blas, lapack -, mpi ? null +, useMpi ? false +, mpi }: stdenv.mkDerivation rec { @@ -21,9 +22,9 @@ stdenv.mkDerivation rec { ''; buildInputs = [ fftw blas lapack gfortran ] - ++ (lib.optionals (mpi != null) [ mpi ]); + ++ (lib.optionals useMpi [ mpi ]); -configureFlags = if (mpi != null) then [ "LD=${mpi}/bin/mpif90" ] else [ "LD=${gfortran}/bin/gfortran" ]; +configureFlags = if useMpi then [ "LD=${mpi}/bin/mpif90" ] else [ "LD=${gfortran}/bin/gfortran" ]; makeFlags = [ "all" ]; |