about summary refs log tree commit diff
path: root/pkgs/tools/misc/hdf5
diff options
context:
space:
mode:
authorLancelot SIX <lsix@lancelotsix.com>2015-11-20 09:59:22 +0000
committerVladimír Čunát <vcunat@gmail.com>2015-11-20 11:25:47 +0100
commitafa9e26130be960333b7d8921d2776ce2fa230e6 (patch)
tree22313b62599829de4e87221f7aebe0a2f27db100 /pkgs/tools/misc/hdf5
parent4d28d46c45e4ec43bd454674ec489decd2f9051e (diff)
pkgs.hdf5: Fix mpi build
@vcunat fixed the assertion (which was his wrong suggestion).
Diffstat (limited to 'pkgs/tools/misc/hdf5')
-rw-r--r--pkgs/tools/misc/hdf5/default.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix
index 8c32f95b01490..84945d27dd184 100644
--- a/pkgs/tools/misc/hdf5/default.nix
+++ b/pkgs/tools/misc/hdf5/default.nix
@@ -8,7 +8,11 @@
 , enableShared ? true
 }:
 
-with { inherit (stdenv.lib) optional; };
+# cpp and mpi options are mutually exclusive
+# (--enable-unsupported could be used to force the build)
+assert !cpp || mpi == null;
+
+with { inherit (stdenv.lib) optional optionals; };
 
 stdenv.mkDerivation rec {
   version = "1.8.16";
@@ -35,7 +39,7 @@ stdenv.mkDerivation rec {
     ++ optional cpp "--enable-cxx"
     ++ optional (gfortran != null) "--enable-fortran"
     ++ optional (szip != null) "--with-szlib=${szip}"
-    ++ optional (mpi != null) "--enable-parallel"
+    ++ optionals (mpi != null) ["--enable-parallel" "CC=${mpi}/bin/mpicc"]
     ++ optional enableShared "--enable-shared";
 
   patches = [./bin-mv.patch];