public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Tiziano Müller" <dev-zero@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] dev/dev-zero:master commit in: sci-chemistry/cp2k/
Date: Fri, 22 Apr 2016 08:40:10 +0000 (UTC)	[thread overview]
Message-ID: <1461314402.c8e6ee71ad4d6e9e6804f56a1e56eab18426284b.dev-zero@gentoo> (raw)

commit:     c8e6ee71ad4d6e9e6804f56a1e56eab18426284b
Author:     Tiziano Müller <dev-zero <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 22 08:40:02 2016 +0000
Commit:     Tiziano Müller <dev-zero <AT> gentoo <DOT> org>
CommitDate: Fri Apr 22 08:40:02 2016 +0000
URL:        https://gitweb.gentoo.org/dev/dev-zero.git/commit/?id=c8e6ee71

sci-chemistry/cp2k: add mpi support

 sci-chemistry/cp2k/cp2k-3.0.ebuild | 36 ++++++++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 8 deletions(-)

diff --git a/sci-chemistry/cp2k/cp2k-3.0.ebuild b/sci-chemistry/cp2k/cp2k-3.0.ebuild
index b7daf1b..8a047fe 100644
--- a/sci-chemistry/cp2k/cp2k-3.0.ebuild
+++ b/sci-chemistry/cp2k/cp2k-3.0.ebuild
@@ -18,13 +18,17 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64"
-IUSE="+fftw +libint +libxc +openmp"
+IUSE="+fftw +libint +libxc +openmp mpi"
 
 RDEPEND="virtual/blas
 	fftw? ( openmp? ( sci-libs/fftw:3.0=[fortran,openmp] )
 		!openmp? ( sci-libs/fftw:3.0=[fortran,threads] ) )
 	libint? ( sci-libs/libint:1 )
-	libxc? ( =sci-libs/libxc-2.2*[fortran] )"
+	libxc? ( =sci-libs/libxc-2.2*[fortran] )
+	mpi? (
+		virtual/mpi[fortran]
+		virtual/scalapack
+		)"
 DEPEND="${RDEPEND}
 	virtual/pkgconfig
 	${PYTHON_DEPS}"
@@ -35,14 +39,22 @@ pkg_setup() {
 }
 
 src_configure() {
+	incs=("-I/usr/include")
 	libs=()
-	pkgs=("lapack")
+	pkgs=()
 
 	if use openmp ; then
 		append-fflags -fopenmp
 		append-ldflags -fopenmp
 	fi
 
+	if use mpi ; then
+		append-cppflags -D__parallel -D__SCALAPACK -D__MPI_VERSION=3
+		pkgs+=("scalapack")
+	else
+		pkgs+=("lapack")
+	fi
+
 	if use fftw ; then
 		append-cppflags -D__FFTW3
 
@@ -62,16 +74,24 @@ src_configure() {
 		libs+=("-lxc" "-lxcf90")
 	fi
 
+	CC=$(tc-getCC)
+	FC=$(tc-getFC)
+
+	if use mpi ; then
+		CC=mpicc
+		FC=mpifort
+	fi
+
 	# /usr/include must be included explicitly to have gfortran look for .mod-files there
 	cat > arch/custom.gentoo << EOF
-CC         = $(tc-getCC)
+CC         = ${CC}
 # empty CPP var makes it use the compiler directly instead of two-step
 CPP        =
-FC         = $(tc-getFC)
-LD         = $(tc-getFC)
+FC         = ${FC}
+LD         = ${FC}
 AR         = $(tc-getAR) -r
-CPPFLAGS   = ${CPPFLAGS} $(pkg-config --cflags ${pkgs[*]})
-FCFLAGS    = -ffree-form -ffree-line-length-none ${CPPFLAGS} -I/usr/include $(pkg-config --cflags ${pkgs[*]}) ${FCFLAGS}
+CPPFLAGS   = ${CPPFLAGS} ${incs[*]} $(pkg-config --cflags ${pkgs[*]})
+FCFLAGS    = -ffree-form -ffree-line-length-none ${CPPFLAGS} ${incs[*]} $(pkg-config --cflags ${pkgs[*]}) ${FCFLAGS}
 LDFLAGS    = ${LDFLAGS}
 LIBS       = $(pkg-config --libs ${pkgs[*]}) ${libs[*]}
 DATA_DIR   = ${EPREFIX}/usr/share/cp2k


             reply	other threads:[~2016-04-22  8:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22  8:40 Tiziano Müller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-04-18 10:33 [gentoo-commits] dev/dev-zero:master commit in: sci-chemistry/cp2k/ Tiziano Müller
2016-03-17 14:45 Tiziano Müller
2016-03-17 10:50 Tiziano Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461314402.c8e6ee71ad4d6e9e6804f56a1e56eab18426284b.dev-zero@gentoo \
    --to=dev-zero@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox