summary refs log tree commit diff
diff options
context:
space:
mode:
authorxeji <36407913+xeji@users.noreply.github.com>2018-09-15 00:17:25 +0200
committerGitHub <noreply@github.com>2018-09-15 00:17:25 +0200
commitf06134cb16c680aeabea7985300d4561f13dc983 (patch)
tree65ac566e2ef4d99cb1cfbde733b9c30a054a4334
parent57ee1416965e3675857aa8c0856d36e3ba0b30c3 (diff)
parenta2bc529f224b7d004cf05a169ff5c56bb0affb29 (diff)
downloadnixlib-f06134cb16c680aeabea7985300d4561f13dc983.tar
nixlib-f06134cb16c680aeabea7985300d4561f13dc983.tar.gz
nixlib-f06134cb16c680aeabea7985300d4561f13dc983.tar.bz2
nixlib-f06134cb16c680aeabea7985300d4561f13dc983.tar.lz
nixlib-f06134cb16c680aeabea7985300d4561f13dc983.tar.xz
nixlib-f06134cb16c680aeabea7985300d4561f13dc983.tar.zst
nixlib-f06134cb16c680aeabea7985300d4561f13dc983.zip
Merge pull request #46583 from costrouc/costrouc/quantum-espresso
quantum-espresso, siesta init packages for density functional theory calculations
-rw-r--r--pkgs/applications/science/chemistry/quantum-espresso/default.nix49
-rw-r--r--pkgs/applications/science/chemistry/siesta/default.nix69
-rw-r--r--pkgs/top-level/all-packages.nix12
3 files changed, 130 insertions, 0 deletions
diff --git a/pkgs/applications/science/chemistry/quantum-espresso/default.nix b/pkgs/applications/science/chemistry/quantum-espresso/default.nix
new file mode 100644
index 000000000000..7a7f1b3596d3
--- /dev/null
+++ b/pkgs/applications/science/chemistry/quantum-espresso/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl
+, gfortran, fftw, openblas
+, mpi ? null
+}:
+
+stdenv.mkDerivation rec {
+  version = "6.3";
+  name = "quantum-espresso-${version}";
+
+  src = fetchurl {
+    url = "https://gitlab.com/QEF/q-e/-/archive/qe-${version}/q-e-qe-${version}.tar.gz";
+    sha256 = "1738z3nhkzcrgnhnfg1r4lipbwvcrcprwhzjbjysnylmzbzwhrs0";
+  };
+
+  passthru = {
+    inherit mpi;
+  };
+
+  preConfigure = ''
+    patchShebangs configure
+  '';
+
+  # remove after 6.3 version:
+  # makefile needs to ignore install directory easier than applying patch
+  preInstall = ''
+    printf "\n.PHONY: install\n" >> Makefile
+  '';
+
+  buildInputs = [ fftw openblas gfortran ]
+    ++ (stdenv.lib.optionals (mpi != null) [ mpi ]);
+
+configureFlags = if (mpi != null) then [ "LD=${mpi}/bin/mpif90" ] else [ "LD=${gfortran}/bin/gfortran" ];
+
+  makeFlags = [ "all" ];
+
+  meta = with stdenv.lib; {
+    description = "Electronic-structure calculations and materials modeling at the nanoscale";
+    longDescription = ''
+        Quantum ESPRESSO is an integrated suite of Open-Source computer codes for
+        electronic-structure calculations and materials modeling at the
+        nanoscale. It is based on density-functional theory, plane waves, and
+        pseudopotentials.
+      '';
+    homepage = https://www.quantum-espresso.org/;
+    license = licenses.gpl2;
+    platforms = [ "x86_64-linux" ];
+    maintainers = [ maintainers.costrouc ];
+  };
+}
diff --git a/pkgs/applications/science/chemistry/siesta/default.nix b/pkgs/applications/science/chemistry/siesta/default.nix
new file mode 100644
index 000000000000..eb17a68b8aae
--- /dev/null
+++ b/pkgs/applications/science/chemistry/siesta/default.nix
@@ -0,0 +1,69 @@
+{ stdenv, fetchurl
+, gfortran, openblas
+, mpi ? null, scalapack
+}:
+
+stdenv.mkDerivation rec {
+  version = "4.1-b3";
+  name = "siesta-${version}";
+
+  src = fetchurl {
+    url = "https://launchpad.net/siesta/4.1/4.1-b3/+download/siesta-4.1-b3.tar.gz";
+    sha256 = "1450jsxj5aifa0b5fcg7mxxq242fvqnp4zxpgzgbkdp99vrp06gm";
+  };
+
+  passthru = {
+    inherit mpi;
+  };
+
+  buildInputs = [ openblas gfortran ]
+    ++ (stdenv.lib.optionals (mpi != null) [ mpi scalapack ]);
+
+  enableParallelBuilding = true;
+
+  # Must do manualy becuase siesta does not do the regular
+  # ./configure; make; make install
+  configurePhase = ''
+    cd Obj
+    sh ../Src/obj_setup.sh
+    cp gfortran.make arch.make
+  '';
+
+  preBuild = if (mpi != null) then ''
+    makeFlagsArray=(
+        CC="mpicc" FC="mpifort"
+        FPPFLAGS="-DMPI" MPI_INTERFACE="libmpi_f90.a" MPI_INCLUDE="."
+        COMP_LIBS="" LIBS="-lopenblas -lscalapack"
+    );
+  '' else ''
+    makeFlagsArray=(
+      COMP_LIBS="" LIBS="-lopenblas"
+    );
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -a siesta $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A first-principles materials simulation code using DFT";
+    longDescription = ''
+         SIESTA is both a method and its computer program
+         implementation, to perform efficient electronic structure
+         calculations and ab initio molecular dynamics simulations of
+         molecules and solids. SIESTA's efficiency stems from the use
+         of strictly localized basis sets and from the implementation
+         of linear-scaling algorithms which can be applied to suitable
+         systems. A very important feature of the code is that its
+         accuracy and cost can be tuned in a wide range, from quick
+         exploratory calculations to highly accurate simulations
+         matching the quality of other approaches, such as plane-wave
+         and all-electron methods.
+      '';
+    homepage = https://www.quantum-espresso.org/;
+    license = licenses.gpl2;
+    platforms = [ "x86_64-linux" ];
+    maintainers = [ maintainers.costrouc ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6c3295c1258f..92d5069f6206 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -20629,6 +20629,18 @@ with pkgs;
 
   pymol = callPackage ../applications/science/chemistry/pymol { };
 
+  quantum-espresso = callPackage ../applications/science/chemistry/quantum-espresso { };
+
+  quantum-espresso-mpi = callPackage ../applications/science/chemistry/quantum-espresso {
+     mpi = openmpi;
+  };
+
+  siesta = callPackage ../applications/science/chemistry/siesta { };
+
+  siesta-mpi = callPackage ../applications/science/chemistry/siesta {
+     mpi = openmpi;
+  };
+
   ### SCIENCE/GEOMETRY
 
   drgeo = callPackage ../applications/science/geometry/drgeo {