summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiziano Müller <dev-zero@gentoo.org>2016-04-18 12:33:23 +0200
committerTiziano Müller <dev-zero@gentoo.org>2016-04-18 12:33:23 +0200
commit036f87ea3e73231d043fa86b8f04d2bc5f17bb67 (patch)
treefa1b12602759eca94fc1361df95ec9143243a577 /sci-chemistry
parentsci-misc/scorep: initial commit, ebuild written by me (diff)
downloaddev-zero-036f87ea3e73231d043fa86b8f04d2bc5f17bb67.tar.gz
dev-zero-036f87ea3e73231d043fa86b8f04d2bc5f17bb67.tar.bz2
dev-zero-036f87ea3e73231d043fa86b8f04d2bc5f17bb67.zip
sci-chemistry/cp2k: support libint/libxc
Diffstat (limited to 'sci-chemistry')
-rw-r--r--sci-chemistry/cp2k/cp2k-3.0.ebuild35
1 files changed, 24 insertions, 11 deletions
diff --git a/sci-chemistry/cp2k/cp2k-3.0.ebuild b/sci-chemistry/cp2k/cp2k-3.0.ebuild
index c589efb..b7daf1b 100644
--- a/sci-chemistry/cp2k/cp2k-3.0.ebuild
+++ b/sci-chemistry/cp2k/cp2k-3.0.ebuild
@@ -18,11 +18,13 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
-IUSE="+fftw +openmp"
+IUSE="+fftw +libint +libxc +openmp"
RDEPEND="virtual/blas
fftw? ( openmp? ( sci-libs/fftw:3.0=[fortran,openmp] )
- !openmp? ( sci-libs/fftw:3.0=[fortran,threads] ) )"
+ !openmp? ( sci-libs/fftw:3.0=[fortran,threads] ) )
+ libint? ( sci-libs/libint:1 )
+ libxc? ( =sci-libs/libxc-2.2*[fortran] )"
DEPEND="${RDEPEND}
virtual/pkgconfig
${PYTHON_DEPS}"
@@ -33,23 +35,34 @@ pkg_setup() {
}
src_configure() {
+ libs=()
+ pkgs=("lapack")
+
if use openmp ; then
append-fflags -fopenmp
append-ldflags -fopenmp
fi
- declare -a libs defines
-
if use fftw ; then
+ append-cppflags -D__FFTW3
+
if use openmp ; then
- libs+=($(pkg-config --libs fftw3_omp))
+ pkgs+=("fftw3_omp")
else
- libs+=($(pkg-config --libs fftw3_threads))
+ pkgs+=("fftw3_threads")
fi
- defines+=(-D__FFTW3)
- echo ${defines[*]}
fi
+ if use libint ; then
+ append-cppflags -D__LIBINT
+ libs+=("-lint" "-lderiv")
+ fi
+ if use libxc ; then
+ append-cppflags -D__LIBXC2
+ libs+=("-lxc" "-lxcf90")
+ fi
+
+ # /usr/include must be included explicitly to have gfortran look for .mod-files there
cat > arch/custom.gentoo << EOF
CC = $(tc-getCC)
# empty CPP var makes it use the compiler directly instead of two-step
@@ -57,10 +70,10 @@ CPP =
FC = $(tc-getFC)
LD = $(tc-getFC)
AR = $(tc-getAR) -r
-CPPFLAGS = ${defines[*]} ${CPPFLAGS}
-FCFLAGS = -ffree-form -ffree-line-length-none ${defines[*]} ${CPPFLAGS} ${FCFLAGS}
+CPPFLAGS = ${CPPFLAGS} $(pkg-config --cflags ${pkgs[*]})
+FCFLAGS = -ffree-form -ffree-line-length-none ${CPPFLAGS} -I/usr/include $(pkg-config --cflags ${pkgs[*]}) ${FCFLAGS}
LDFLAGS = ${LDFLAGS}
-LIBS = $(pkg-config --libs lapack) ${libs[*]}
+LIBS = $(pkg-config --libs ${pkgs[*]}) ${libs[*]}
DATA_DIR = ${EPREFIX}/usr/share/cp2k
EOF
}