Commit 09b52c63 authored by Phillip Seeber's avatar Phillip Seeber
Browse files

cp2k: enable plumed plugin


cp2k: enable plumed plugin


cp2k: use mpicxx to figure out link lines
parent c20b4b62
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, python3, gfortran, blas, lapack
, fftw, libint, libvori, libxc, mpi, gsl, scalapack, openssh, makeWrapper
, libxsmm, spglib, which, pkg-config
, libxsmm, spglib, which, pkg-config, plumed, zlib
, enableElpa ? false
, elpa
} :
@@ -34,6 +34,8 @@ in stdenv.mkDerivation rec {
    scalapack
    blas
    lapack
    plumed
    zlib
  ] ++ lib.optional enableElpa elpa;

  propagatedBuildInputs = [ mpi ];
@@ -64,7 +66,8 @@ in stdenv.mkDerivation rec {
    AR         = ar -r
    DFLAGS     = -D__FFTW3 -D__LIBXC -D__LIBINT -D__parallel -D__SCALAPACK \
                 -D__MPI_VERSION=3 -D__F2008 -D__LIBXSMM -D__SPGLIB \
                 -D__MAX_CONTR=4 -D__LIBVORI ${lib.optionalString enableElpa "-D__ELPA"}
                 -D__MAX_CONTR=4 -D__LIBVORI ${lib.optionalString enableElpa "-D__ELPA"} \
                 -D__PLUMED2
    CFLAGS    = -fopenmp
    FCFLAGS    = \$(DFLAGS) -O2 -ffree-form -ffree-line-length-none \
                 -ftree-vectorize -funroll-loops -msse2 \
@@ -77,8 +80,11 @@ in stdenv.mkDerivation rec {
                 -lxcf03 -lxc -lxsmmf -lxsmm -lsymspg \
                 -lint2 -lstdc++ -lvori \
                 -lgomp -lpthread -lm \
                 -fopenmp ${lib.optionalString enableElpa "$(pkg-config --libs elpa)"}
                 -fopenmp ${lib.optionalString enableElpa "$(pkg-config --libs elpa)"} \
                 -lz -ldl -lstdc++ ${lib.optionalString (mpi.pname == "openmpi") "$(mpicxx --showme:link)"} \
                 -lplumed
    LDFLAGS    = \$(FCFLAGS) \$(LIBS)
    include ${plumed}/lib/plumed/src/lib/Plumed.inc
    EOF
  '';