about summary refs log tree commit diff
path: root/pkgs/tools/misc/hdf5
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/tools/misc/hdf5
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/tools/misc/hdf5')
-rw-r--r--pkgs/tools/misc/hdf5/default.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix
index 0a5032074c1fb..fc7bb635040a1 100644
--- a/pkgs/tools/misc/hdf5/default.nix
+++ b/pkgs/tools/misc/hdf5/default.nix
@@ -5,13 +5,14 @@
 , gfortran ? null
 , zlib ? null
 , szip ? null
-, mpi ? null
+, mpiSupport ? false
+, mpi
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
 # cpp and mpi options are mutually exclusive
 # (--enable-unsupported could be used to force the build)
-assert !cpp || mpi == null;
+assert !cpp || !mpiSupport;
 
 let inherit (lib) optional optionals; in
 
@@ -24,7 +25,7 @@ stdenv.mkDerivation rec {
   };
 
   passthru = {
-    mpiSupport = (mpi != null);
+    inherit mpiSupport;
     inherit mpi;
   };
 
@@ -38,13 +39,13 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = []
     ++ optional (zlib != null) zlib
-    ++ optional (mpi != null) mpi;
+    ++ optional mpiSupport mpi;
 
   configureFlags = []
     ++ optional cpp "--enable-cxx"
     ++ optional (gfortran != null) "--enable-fortran"
     ++ optional (szip != null) "--with-szlib=${szip}"
-    ++ optionals (mpi != null) ["--enable-parallel" "CC=${mpi}/bin/mpicc"]
+    ++ optionals mpiSupport ["--enable-parallel" "CC=${mpi}/bin/mpicc"]
     ++ optional enableShared "--enable-shared";
 
   patches = [