@@ -8,7 +8,11 @@
88, enableShared ? true
99}:
1010
11−with { inherit (stdenv.lib) optional; };
11+# cpp and mpi options are mutually exclusive
12+# (--enable-unsupported could be used to force the build)
13+assert !cpp || mpi == null;
14+
15+with { inherit (stdenv.lib) optional optionals; };
1216
1317stdenv.mkDerivation rec {
1418 version = "1.8.16";
@@ -35,7 +39,7 @@ stdenv.mkDerivation rec {
3539 ++ optional cpp "--enable-cxx"
3640 ++ optional (gfortran != null) "--enable-fortran"
3741 ++ optional (szip != null) "--with-szlib=${szip}"
38− ++ optional (mpi != null) "--enable-parallel"
42+ ++ optionals (mpi != null) ["--enable-parallel" "CC=${mpi}/bin/mpicc"]
3943 ++ optional enableShared "--enable-shared";
4044
4145 patches = [./bin-mv.patch];