2024-02-25 17:40:43 +08:00
|
|
|
{
|
2024-09-22 17:18:24 +08:00
|
|
|
stdenv, src, writeShellScriptBin, lib,
|
2024-09-24 11:25:22 +08:00
|
|
|
rsync, which, wannier90, hdf5, vtst, mpi, mkl
|
2024-09-22 17:18:24 +08:00
|
|
|
}:
|
|
|
|
let vasp = stdenv.mkDerivation
|
|
|
|
{
|
|
|
|
name = "vasp-intel";
|
|
|
|
inherit src;
|
|
|
|
# patches = [ ../vtst.patch ];
|
|
|
|
configurePhase =
|
|
|
|
''
|
|
|
|
cp ${./makefile.include} makefile.include
|
|
|
|
chmod +w makefile.include
|
|
|
|
cp ${../constr_cell_relax.F} src/constr_cell_relax.F
|
|
|
|
# cp -r ${vtst}/* src
|
|
|
|
chmod -R +w src
|
|
|
|
'';
|
|
|
|
buildInputs = [ hdf5 wannier90 mkl ];
|
|
|
|
nativeBuildInputs = [ rsync which mpi ];
|
|
|
|
installPhase =
|
|
|
|
''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
for i in std gam ncl; do cp bin/vasp_$i $out/bin/vasp-$i; done
|
|
|
|
mkdir $out/src
|
|
|
|
ln -s ${src} $out/src/vasp
|
|
|
|
ln -s ${vtst} $out/src/vtst
|
|
|
|
'';
|
|
|
|
|
|
|
|
# NIX_DEBUG = "7";
|
|
|
|
|
|
|
|
# enable parallel build
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
DEPS = "1";
|
|
|
|
|
|
|
|
# vasp directly include headers under ${mkl}/include/fftw
|
|
|
|
MKLROOT = mkl;
|
2024-09-24 11:25:22 +08:00
|
|
|
|
|
|
|
# tell openmpi use ifx
|
|
|
|
OMPI_F90 = "ifx";
|
2024-09-22 17:18:24 +08:00
|
|
|
};
|
|
|
|
in writeShellScriptBin "vasp-intel"
|
|
|
|
''
|
|
|
|
export PATH=${vasp}/bin:${mpi}/bin''${PATH:+:$PATH}
|
|
|
|
exec "$@"
|
|
|
|
''
|