2023-09-04 19:26:33 +08:00
|
|
|
# {
|
|
|
|
# stdenv, requireFile, config, rsync, intel-mpi, ifort,
|
|
|
|
# mkl
|
|
|
|
# }:
|
|
|
|
# stdenv.mkDerivation rec
|
|
|
|
# {
|
|
|
|
# pname = "vasp";
|
|
|
|
# version = "6.4.0";
|
|
|
|
# # nix-store --query --hash $(nix store add-path ./vasp-6.4.0)
|
|
|
|
# src = requireFile
|
|
|
|
# {
|
|
|
|
# name = "${pname}-${version}";
|
|
|
|
# sha256 = "189i1l5q33ynmps93p2mwqf5fx7p4l50sls1krqlv8ls14s3m71f";
|
|
|
|
# hashMode = "recursive";
|
|
|
|
# message = "Source file not found.";
|
|
|
|
# };
|
|
|
|
# VASP_TARGET_CPU = if config ? oneapiArch then "-x${config.oneapiArch}" else "";
|
|
|
|
# MKLROOT = mkl;
|
|
|
|
# makeFlags = "DEPS=1";
|
|
|
|
# enableParallelBuilding = true;
|
|
|
|
# buildInputs = [ mkl intel-mpi ifort ];
|
|
|
|
# nativeBuildInputs = [ rsync ];
|
|
|
|
# configurePhase =
|
|
|
|
# ''
|
|
|
|
# cp arch/makefile.include.intel makefile.include
|
|
|
|
# echo "CPP_OPTIONS += -Duse_shmem -Dshmem_bcast_buffer -Dshmem_rproj" >> makefile.include
|
|
|
|
# echo "OBJECTS_LIB += getshmem.o" >> makefile.include
|
|
|
|
# mkdir -p bin
|
|
|
|
# '';
|
|
|
|
# installPhase =
|
|
|
|
# ''
|
|
|
|
# mkdir -p $out/bin
|
|
|
|
# for i in std gam ncl; do
|
|
|
|
# cp bin/vasp_$i $out/bin/vasp-cpu-${version}-$i
|
|
|
|
# done
|
|
|
|
# '';
|
|
|
|
# doStrip = false;
|
|
|
|
# doFixup = false;
|
|
|
|
# }
|
2023-09-03 22:46:18 +08:00
|
|
|
{
|
2023-09-04 19:26:33 +08:00
|
|
|
stdenvNoCC, requireFile, rsync, blas, scalapack, openmpi, openmp, gfortran, gcc, fftwMpi
|
2023-09-03 22:46:18 +08:00
|
|
|
}:
|
2023-09-04 19:26:33 +08:00
|
|
|
stdenvNoCC.mkDerivation rec
|
2023-09-03 22:46:18 +08:00
|
|
|
{
|
|
|
|
pname = "vasp";
|
|
|
|
version = "6.4.0";
|
|
|
|
# nix-store --query --hash $(nix store add-path ./vasp-6.4.0)
|
|
|
|
src = requireFile
|
|
|
|
{
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
sha256 = "189i1l5q33ynmps93p2mwqf5fx7p4l50sls1krqlv8ls14s3m71f";
|
|
|
|
hashMode = "recursive";
|
|
|
|
message = "Source file not found.";
|
|
|
|
};
|
2023-09-04 19:26:33 +08:00
|
|
|
# VASP_TARGET_CPU = if config ? oneapiArch then "-x${config.oneapiArch}" else "";
|
|
|
|
# MKLROOT = mkl;
|
2023-09-03 22:46:18 +08:00
|
|
|
makeFlags = "DEPS=1";
|
|
|
|
enableParallelBuilding = true;
|
2023-09-04 19:26:33 +08:00
|
|
|
buildInputs = [ blas scalapack openmpi openmp gfortran gfortran.cc gcc fftwMpi.dev fftwMpi ];
|
2023-09-03 22:46:18 +08:00
|
|
|
nativeBuildInputs = [ rsync ];
|
2023-09-04 19:26:33 +08:00
|
|
|
FFTW_ROOT = fftwMpi.dev;
|
2023-09-03 22:46:18 +08:00
|
|
|
configurePhase =
|
|
|
|
''
|
2023-09-04 19:26:33 +08:00
|
|
|
cp ${./makefile.include/${version}-gnu} makefile.include
|
|
|
|
chmod +w makefile.include
|
2023-09-03 22:46:18 +08:00
|
|
|
echo "CPP_OPTIONS += -Duse_shmem -Dshmem_bcast_buffer -Dshmem_rproj" >> makefile.include
|
|
|
|
echo "OBJECTS_LIB += getshmem.o" >> makefile.include
|
|
|
|
mkdir -p bin
|
|
|
|
'';
|
|
|
|
installPhase =
|
|
|
|
''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
for i in std gam ncl; do
|
2023-09-04 19:26:33 +08:00
|
|
|
cp bin/vasp_$i $out/bin/vasp-gnu-${version}-$i
|
2023-09-03 22:46:18 +08:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
}
|