Merge pull request #150121 from markuskowa/fix-cp2k
cp2k: make elpa optional
This commit is contained in:
commit
453b06c677
1 changed files with 7 additions and 6 deletions
|
@ -1,6 +1,8 @@
|
||||||
{ lib, stdenv, fetchFromGitHub, python3, gfortran, blas, lapack
|
{ lib, stdenv, fetchFromGitHub, python3, gfortran, blas, lapack
|
||||||
, fftw, libint, libvori, libxc, mpi, gsl, scalapack, openssh, makeWrapper
|
, fftw, libint, libvori, libxc, mpi, gsl, scalapack, openssh, makeWrapper
|
||||||
, libxsmm, spglib, which, elpa, pkg-config
|
, libxsmm, spglib, which, pkg-config
|
||||||
|
, enableElpa ? false
|
||||||
|
, elpa
|
||||||
} :
|
} :
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -21,7 +23,6 @@ in stdenv.mkDerivation rec {
|
||||||
|
|
||||||
nativeBuildInputs = [ python3 which openssh makeWrapper pkg-config ];
|
nativeBuildInputs = [ python3 which openssh makeWrapper pkg-config ];
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
elpa
|
|
||||||
gfortran
|
gfortran
|
||||||
fftw
|
fftw
|
||||||
gsl
|
gsl
|
||||||
|
@ -33,7 +34,7 @@ in stdenv.mkDerivation rec {
|
||||||
scalapack
|
scalapack
|
||||||
blas
|
blas
|
||||||
lapack
|
lapack
|
||||||
];
|
] ++ lib.optional enableElpa elpa;
|
||||||
|
|
||||||
propagatedBuildInputs = [ mpi ];
|
propagatedBuildInputs = [ mpi ];
|
||||||
propagatedUserEnvPkgs = [ mpi ];
|
propagatedUserEnvPkgs = [ mpi ];
|
||||||
|
@ -61,20 +62,20 @@ in stdenv.mkDerivation rec {
|
||||||
AR = ar -r
|
AR = ar -r
|
||||||
DFLAGS = -D__FFTW3 -D__LIBXC -D__LIBINT -D__parallel -D__SCALAPACK \
|
DFLAGS = -D__FFTW3 -D__LIBXC -D__LIBINT -D__parallel -D__SCALAPACK \
|
||||||
-D__MPI_VERSION=3 -D__F2008 -D__LIBXSMM -D__SPGLIB \
|
-D__MPI_VERSION=3 -D__F2008 -D__LIBXSMM -D__SPGLIB \
|
||||||
-D__MAX_CONTR=4 -D__LIBVORI -D__ELPA
|
-D__MAX_CONTR=4 -D__LIBVORI ${lib.optionalString enableElpa "-D__ELPA"}
|
||||||
CFLAGS = -fopenmp
|
CFLAGS = -fopenmp
|
||||||
FCFLAGS = \$(DFLAGS) -O2 -ffree-form -ffree-line-length-none \
|
FCFLAGS = \$(DFLAGS) -O2 -ffree-form -ffree-line-length-none \
|
||||||
-ftree-vectorize -funroll-loops -msse2 \
|
-ftree-vectorize -funroll-loops -msse2 \
|
||||||
-std=f2008 \
|
-std=f2008 \
|
||||||
-fopenmp -ftree-vectorize -funroll-loops \
|
-fopenmp -ftree-vectorize -funroll-loops \
|
||||||
-I${libxc}/include -I${libxsmm}/include \
|
-I${libxc}/include -I${libxsmm}/include \
|
||||||
-I${libint}/include $(pkg-config --variable=fcflags elpa)
|
-I${libint}/include ${lib.optionalString enableElpa "$(pkg-config --variable=fcflags elpa)"}
|
||||||
LIBS = -lfftw3 -lfftw3_threads \
|
LIBS = -lfftw3 -lfftw3_threads \
|
||||||
-lscalapack -lblas -llapack \
|
-lscalapack -lblas -llapack \
|
||||||
-lxcf03 -lxc -lxsmmf -lxsmm -lsymspg \
|
-lxcf03 -lxc -lxsmmf -lxsmm -lsymspg \
|
||||||
-lint2 -lstdc++ -lvori \
|
-lint2 -lstdc++ -lvori \
|
||||||
-lgomp -lpthread -lm \
|
-lgomp -lpthread -lm \
|
||||||
-fopenmp $(pkg-config --libs elpa)
|
-fopenmp ${lib.optionalString enableElpa "$(pkg-config --libs elpa)"}
|
||||||
LDFLAGS = \$(FCFLAGS) \$(LIBS)
|
LDFLAGS = \$(FCFLAGS) \$(LIBS)
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue