2018-09-12 18:45:57 +00:00
|
|
|
{ stdenv, fetchurl
|
2020-03-31 14:47:18 +00:00
|
|
|
, gfortran, blas, lapack
|
2018-09-12 18:45:57 +00:00
|
|
|
, mpi ? null, scalapack
|
|
|
|
}:
|
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
stdenv.mkDerivation {
|
2018-09-12 18:45:57 +00:00
|
|
|
version = "4.1-b3";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "siesta";
|
2018-09-12 18:45:57 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://launchpad.net/siesta/4.1/4.1-b3/+download/siesta-4.1-b3.tar.gz";
|
|
|
|
sha256 = "1450jsxj5aifa0b5fcg7mxxq242fvqnp4zxpgzgbkdp99vrp06gm";
|
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit mpi;
|
|
|
|
};
|
|
|
|
|
2020-03-31 14:47:18 +00:00
|
|
|
buildInputs = [ blas lapack gfortran ]
|
2018-09-12 18:45:57 +00:00
|
|
|
++ (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="."
|
2020-03-31 14:47:18 +00:00
|
|
|
COMP_LIBS="" LIBS="-lblas -llapack -lscalapack"
|
2018-09-12 18:45:57 +00:00
|
|
|
);
|
|
|
|
'' else ''
|
|
|
|
makeFlagsArray=(
|
2020-03-31 14:47:18 +00:00
|
|
|
COMP_LIBS="" LIBS="-lblas -llapack"
|
2018-09-12 18:45:57 +00:00
|
|
|
);
|
|
|
|
'';
|
|
|
|
|
|
|
|
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.
|
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.quantum-espresso.org/";
|
2018-09-12 18:45:57 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|