summary refs log tree commit diff
path: root/pkgs/applications
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
parentf6a583eeece936a1d917de67194fec4b6c74cf1f (diff)
downloadnixpkgs-6dba41fbcb4239a628ac5bdf0035882a679b8648.tar
nixpkgs-6dba41fbcb4239a628ac5bdf0035882a679b8648.tar.gz
nixpkgs-6dba41fbcb4239a628ac5bdf0035882a679b8648.tar.bz2
nixpkgs-6dba41fbcb4239a628ac5bdf0035882a679b8648.tar.lz
nixpkgs-6dba41fbcb4239a628ac5bdf0035882a679b8648.tar.xz
nixpkgs-6dba41fbcb4239a628ac5bdf0035882a679b8648.tar.zst
nixpkgs-6dba41fbcb4239a628ac5bdf0035882a679b8648.zip
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')
-rw-r--r--pkgs/applications/graphics/paraview/default.nix4
-rw-r--r--pkgs/applications/science/biology/migrate/default.nix4
-rw-r--r--pkgs/applications/science/biology/neuron/default.nix9
-rw-r--r--pkgs/applications/science/biology/raxml/default.nix10
-rw-r--r--pkgs/applications/science/chemistry/openmolcas/default.nix4
-rw-r--r--pkgs/applications/science/chemistry/quantum-espresso/default.nix7
-rw-r--r--pkgs/applications/science/chemistry/siesta/default.nix9
-rw-r--r--pkgs/applications/science/electronics/openems/default.nix5
-rw-r--r--pkgs/applications/science/math/cntk/default.nix6
-rw-r--r--pkgs/applications/science/math/getdp/default.nix4
-rw-r--r--pkgs/applications/science/math/scotch/default.nix4
-rw-r--r--pkgs/applications/science/molecular-dynamics/gromacs/default.nix4
-rw-r--r--pkgs/applications/science/molecular-dynamics/lammps/default.nix4
-rw-r--r--pkgs/applications/science/physics/elmerfem/default.nix4
14 files changed, 40 insertions, 38 deletions
diff --git a/pkgs/applications/graphics/paraview/default.nix b/pkgs/applications/graphics/paraview/default.nix
index 6e4738dd07c..7bbff5499f6 100644
--- a/pkgs/applications/graphics/paraview/default.nix
+++ b/pkgs/applications/graphics/paraview/default.nix
@@ -1,6 +1,6 @@
 { boost, cmake, fetchFromGitHub, ffmpeg, qtbase, qtx11extras,
   qttools, qtxmlpatterns, qtsvg, gdal, gfortran, libXt, makeWrapper,
-  mkDerivation, ninja, openmpi, python3, lib, stdenv, tbb, libGLU, libGL }:
+  mkDerivation, ninja, mpi, python3, lib, stdenv, tbb, libGLU, libGL }:
 
 mkDerivation rec {
   pname = "paraview";
@@ -65,7 +65,7 @@ mkDerivation rec {
   buildInputs = [
     libGLU libGL
     libXt
-    openmpi
+    mpi
     tbb
     boost
     ffmpeg
diff --git a/pkgs/applications/science/biology/migrate/default.nix b/pkgs/applications/science/biology/migrate/default.nix
index 0e2aa1c1a79..ba55898e4f9 100644
--- a/pkgs/applications/science/biology/migrate/default.nix
+++ b/pkgs/applications/science/biology/migrate/default.nix
@@ -1,4 +1,4 @@
-{ gccStdenv, fetchurl, zlib, openmpi }:
+{ gccStdenv, fetchurl, zlib, mpi }:
 
 gccStdenv.mkDerivation rec {
   version = "3.7.2";
@@ -9,7 +9,7 @@ gccStdenv.mkDerivation rec {
     sha256 = "1p2364ffjc56i82snzvjpy6pkf6wvqwvlvlqxliscx2c303fxs8v";
   };
 
-  buildInputs = [ zlib openmpi ];
+  buildInputs = [ zlib mpi ];
   setSourceRoot = ''sourceRoot=$(echo */src)'';
   buildFlags = [ "thread" "mpis" ];
   preInstall = "mkdir -p $out/man/man1";
diff --git a/pkgs/applications/science/biology/neuron/default.nix b/pkgs/applications/science/biology/neuron/default.nix
index 154965b1521..7bfef3a82fe 100644
--- a/pkgs/applications/science/biology/neuron/default.nix
+++ b/pkgs/applications/science/biology/neuron/default.nix
@@ -8,7 +8,8 @@
 , readline
 , which
 , python ? null
-, mpi ? null
+, useMpi ? false
+, mpi
 , iv
 }:
 
@@ -17,7 +18,8 @@ stdenv.mkDerivation rec {
   version = "7.5";
 
   nativeBuildInputs = [ which pkg-config automake autoconf libtool ];
-  buildInputs = [ ncurses readline python mpi iv ];
+  buildInputs = [ ncurses readline python iv ]
+    ++ lib.optional useMpi mpi;
 
   src = fetchurl {
     url = "https://www.neuron.yale.edu/ftp/neuron/versions/v${version}/nrn-${version}.tar.gz";
@@ -54,7 +56,7 @@ stdenv.mkDerivation rec {
   configureFlags = with lib;
                     [ "--with-readline=${readline}" "--with-iv=${iv}" ]
                     ++  optionals (python != null)  [ "--with-nrnpython=${python.interpreter}" ]
-                    ++ (if mpi != null then ["--with-mpi" "--with-paranrn"]
+                    ++ (if useMpi then ["--with-mpi" "--with-paranrn"]
                         else ["--without-mpi"]);
 
 
@@ -84,4 +86,3 @@ stdenv.mkDerivation rec {
     platforms   = platforms.x86_64 ++ platforms.i686;
   };
 }
-
diff --git a/pkgs/applications/science/biology/raxml/default.nix b/pkgs/applications/science/biology/raxml/default.nix
index 4f9b5aca1b2..6e747e318f5 100644
--- a/pkgs/applications/science/biology/raxml/default.nix
+++ b/pkgs/applications/science/biology/raxml/default.nix
@@ -1,7 +1,7 @@
 { lib, stdenv
 , fetchFromGitHub
-, pkgs
-, mpi ? false
+, useMpi ? false
+, mpi
 }:
 
 stdenv.mkDerivation rec {
@@ -15,16 +15,16 @@ stdenv.mkDerivation rec {
     sha256 = "1jqjzhch0rips0vp04prvb8vmc20c5pdmsqn8knadcf91yy859fh";
   };
 
-  buildInputs = lib.optionals mpi [ pkgs.openmpi ];
+  buildInputs = lib.optionals useMpi [ mpi ];
 
   # TODO darwin, AVX and AVX2 makefile targets
-  buildPhase = if mpi then ''
+  buildPhase = if useMpi then ''
       make -f Makefile.MPI.gcc
     '' else ''
       make -f Makefile.SSE3.PTHREADS.gcc
     '';
 
-  installPhase = if mpi then ''
+  installPhase = if useMpi then ''
     mkdir -p $out/bin && cp raxmlHPC-MPI $out/bin
   '' else ''
     mkdir -p $out/bin && cp raxmlHPC-PTHREADS-SSE3 $out/bin
diff --git a/pkgs/applications/science/chemistry/openmolcas/default.nix b/pkgs/applications/science/chemistry/openmolcas/default.nix
index 1297e595b9a..4bd88456b8f 100644
--- a/pkgs/applications/science/chemistry/openmolcas/default.nix
+++ b/pkgs/applications/science/chemistry/openmolcas/default.nix
@@ -1,6 +1,6 @@
 { lib, stdenv, fetchFromGitLab, cmake, gfortran, perl
 , openblas, hdf5-cpp, python3, texlive
-, armadillo, openmpi, globalarrays, openssh
+, armadillo, mpi, globalarrays, openssh
 , makeWrapper, fetchpatch
 } :
 
@@ -33,7 +33,7 @@ in stdenv.mkDerivation {
     hdf5-cpp
     python
     armadillo
-    openmpi
+    mpi
     globalarrays
     openssh
   ];
diff --git a/pkgs/applications/science/chemistry/quantum-espresso/default.nix b/pkgs/applications/science/chemistry/quantum-espresso/default.nix
index c7b1f901046..6d70e9f984f 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" ];
 
diff --git a/pkgs/applications/science/chemistry/siesta/default.nix b/pkgs/applications/science/chemistry/siesta/default.nix
index 0df953f7106..02ff4c1ca44 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="."
diff --git a/pkgs/applications/science/electronics/openems/default.nix b/pkgs/applications/science/electronics/openems/default.nix
index e1063f8e26c..64afe3222c2 100644
--- a/pkgs/applications/science/electronics/openems/default.nix
+++ b/pkgs/applications/science/electronics/openems/default.nix
@@ -11,16 +11,15 @@
 , cmake
 , octave
 , gl2ps
+, mpi
 , withQcsxcad ? true
 , withMPI ? false
 , withHyp2mat ? true
 , qcsxcad ? null
-, openmpi ? null
 , hyp2mat ? null
 }:
 
 assert withQcsxcad -> qcsxcad != null;
-assert withMPI -> openmpi != null;
 assert withHyp2mat -> hyp2mat != null;
 
 stdenv.mkDerivation {
@@ -50,7 +49,7 @@ stdenv.mkDerivation {
     csxcad
     (octave.override { inherit hdf5; }) ]
     ++ lib.optionals withQcsxcad [ qcsxcad ]
-    ++ lib.optionals withMPI [ openmpi ]
+    ++ lib.optionals withMPI [ mpi ]
     ++ lib.optionals withHyp2mat [ hyp2mat ];
 
   postFixup = ''
diff --git a/pkgs/applications/science/math/cntk/default.nix b/pkgs/applications/science/math/cntk/default.nix
index a348210179e..e15e2a43d77 100644
--- a/pkgs/applications/science/math/cntk/default.nix
+++ b/pkgs/applications/science/math/cntk/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, fetchgit, fetchFromGitHub, cmake
-, openblas, blas, lapack, opencv3, libzip, boost, protobuf, openmpi
+, openblas, blas, lapack, opencv3, libzip, boost, protobuf, mpi
 , onebitSGDSupport ? false
 , cudaSupport ? false, addOpenGLRunpath, cudatoolkit, nvidia_x11
 , cudnnSupport ? cudaSupport, cudnn
@@ -33,7 +33,7 @@ in stdenv.mkDerivation rec {
   # Force OpenMPI to use g++ in PATH.
   OMPI_CXX = "g++";
 
-  buildInputs = [ openblas opencv3 libzip boost protobuf openmpi ]
+  buildInputs = [ openblas opencv3 libzip boost protobuf mpi ]
              ++ lib.optional cudaSupport cudatoolkit
              ++ lib.optional cudnnSupport cudnn;
 
@@ -43,7 +43,7 @@ in stdenv.mkDerivation rec {
     "--with-openblas=${openblas}"
     "--with-boost=${boost.dev}"
     "--with-protobuf=${protobuf}"
-    "--with-mpi=${openmpi}"
+    "--with-mpi=${mpi}"
     "--cuda=${if cudaSupport then "yes" else "no"}"
     # FIXME
     "--asgd=no"
diff --git a/pkgs/applications/science/math/getdp/default.nix b/pkgs/applications/science/math/getdp/default.nix
index 915c7e1147f..39d9c866cae 100644
--- a/pkgs/applications/science/math/getdp/default.nix
+++ b/pkgs/applications/science/math/getdp/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, cmake, gfortran, blas, lapack, openmpi, petsc, python3 }:
+{ lib, stdenv, fetchurl, cmake, gfortran, blas, lapack, mpi, petsc, python3 }:
 
 stdenv.mkDerivation rec {
   name = "getdp-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake gfortran ];
-  buildInputs = [ blas lapack openmpi petsc python3 ];
+  buildInputs = [ blas lapack mpi petsc python3 ];
 
   meta = with lib; {
     description = "A General Environment for the Treatment of Discrete Problems";
diff --git a/pkgs/applications/science/math/scotch/default.nix b/pkgs/applications/science/math/scotch/default.nix
index 6f8753ff38a..b6613f25cbc 100644
--- a/pkgs/applications/science/math/scotch/default.nix
+++ b/pkgs/applications/science/math/scotch/default.nix
@@ -1,11 +1,11 @@
-{ lib, stdenv, fetchurl, bison, openmpi, flex, zlib}:
+{ lib, stdenv, fetchurl, bison, mpi, flex, zlib}:
 
 stdenv.mkDerivation rec {
   version = "6.0.4";
   pname = "scotch";
   src_name = "scotch_${version}";
 
-  buildInputs = [ bison openmpi flex zlib ];
+  buildInputs = [ bison mpi flex zlib ];
 
   src = fetchurl {
     url = "https://gforge.inria.fr/frs/download.php/file/34618/${src_name}.tar.gz";
diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
index c40faddbbf9..bdec2ccc669 100644
--- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
+++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
@@ -3,10 +3,10 @@
 , cmake
 , hwloc
 , fftw
-, openmpi
 , perl
 , singlePrec ? true
 , mpiEnabled ? false
+, mpi
 , cpuAcceleration ? null
 }:
 
@@ -33,7 +33,7 @@ in stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ fftw perl hwloc ]
-  ++ (lib.optionals mpiEnabled [ openmpi ]);
+  ++ (lib.optionals mpiEnabled [ mpi ]);
 
   cmakeFlags = [
     "-DGMX_SIMD:STRING=${SIMD cpuAcceleration}"
diff --git a/pkgs/applications/science/molecular-dynamics/lammps/default.nix b/pkgs/applications/science/molecular-dynamics/lammps/default.nix
index 123afef03e8..51ce64115ea 100644
--- a/pkgs/applications/science/molecular-dynamics/lammps/default.nix
+++ b/pkgs/applications/science/molecular-dynamics/lammps/default.nix
@@ -1,6 +1,7 @@
 { lib, stdenv, fetchFromGitHub
 , libpng, gzip, fftw, blas, lapack
-, mpi ? null
+, withMPI ? false
+, mpi
 }:
 let packages = [
      "asphere" "body" "class2" "colloid" "compress" "coreshell"
@@ -8,7 +9,6 @@ let packages = [
      "opt" "peri" "qeq" "replica" "rigid" "shock" "snap" "srd" "user-reaxc"
     ];
     lammps_includes = "-DLAMMPS_EXCEPTIONS -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64";
-    withMPI = (mpi != null);
 in
 stdenv.mkDerivation rec {
   # LAMMPS has weird versioning converted to ISO 8601 format
diff --git a/pkgs/applications/science/physics/elmerfem/default.nix b/pkgs/applications/science/physics/elmerfem/default.nix
index 6fa25ce66ae..5033b28bd3b 100644
--- a/pkgs/applications/science/physics/elmerfem/default.nix
+++ b/pkgs/applications/science/physics/elmerfem/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, cmake, git, gfortran, openmpi, blas, liblapack, qt4, qwt6_qt4, pkg-config }:
+{ lib, stdenv, fetchFromGitHub, cmake, git, gfortran, mpi, blas, liblapack, qt4, qwt6_qt4, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "elmerfem";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   hardeningDisable = [ "format" ];
 
   nativeBuildInputs = [ cmake pkg-config git ];
-  buildInputs = [ gfortran openmpi blas liblapack qt4 qwt6_qt4 ];
+  buildInputs = [ gfortran mpi blas liblapack qt4 qwt6_qt4 ];
 
   preConfigure = ''
     patchShebangs ./