about summary refs log tree commit diff
path: root/pkgs/applications/science/chemistry/siesta
diff options
context:
space:
mode:
authorMarkus Kowalewski <markus.kowalewski@gmail.com>2021-01-10 13:40:19 +0100
committerMarkus Kowalewski <markus.kowalewski@gmail.com>2021-01-23 12:15:13 +0100
commit6dba41fbcb4239a628ac5bdf0035882a679b8648 (patch)
treea11ed2cef0b00b88ba8e99a8d30f8890aec90781 /pkgs/applications/science/chemistry/siesta
parentf6a583eeece936a1d917de67194fec4b6c74cf1f (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/siesta')
-rw-r--r--pkgs/applications/science/chemistry/siesta/default.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkgs/applications/science/chemistry/siesta/default.nix b/pkgs/applications/science/chemistry/siesta/default.nix
index 0df953f710673..02ff4c1ca4404 100644
--- a/pkgs/applications/science/chemistry/siesta/default.nix
+++ b/pkgs/applications/science/chemistry/siesta/default.nix
@@ -1,6 +1,7 @@
 { lib, stdenv, fetchurl
-, gfortran, blas, lapack
-, mpi ? null, scalapack
+, gfortran, blas, lapack, scalapack
+, useMpi ? false
+, mpi
 }:
 
 stdenv.mkDerivation {
@@ -17,7 +18,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ blas lapack gfortran ]
-    ++ (lib.optionals (mpi != null) [ mpi scalapack ]);
+    ++ lib.optionals useMpi [ mpi scalapack ];
 
   enableParallelBuilding = true;
 
@@ -29,7 +30,7 @@ stdenv.mkDerivation {
     cp gfortran.make arch.make
   '';
 
-  preBuild = if (mpi != null) then ''
+  preBuild = if useMpi then ''
     makeFlagsArray=(
         CC="mpicc" FC="mpifort"
         FPPFLAGS="-DMPI" MPI_INTERFACE="libmpi_f90.a" MPI_INCLUDE="."