From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 322251381F3 for ; Fri, 22 Apr 2016 08:40:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 243D2E0855; Fri, 22 Apr 2016 08:40:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BFC44E0855 for ; Fri, 22 Apr 2016 08:40:25 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2904A34068A for ; Fri, 22 Apr 2016 08:40:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F0A437B for ; Fri, 22 Apr 2016 08:40:10 +0000 (UTC) From: "Tiziano Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Tiziano Müller" Message-ID: <1461314402.c8e6ee71ad4d6e9e6804f56a1e56eab18426284b.dev-zero@gentoo> Subject: [gentoo-commits] dev/dev-zero:master commit in: sci-chemistry/cp2k/ X-VCS-Repository: dev/dev-zero X-VCS-Files: sci-chemistry/cp2k/cp2k-3.0.ebuild X-VCS-Directories: sci-chemistry/cp2k/ X-VCS-Committer: dev-zero X-VCS-Committer-Name: Tiziano Müller X-VCS-Revision: c8e6ee71ad4d6e9e6804f56a1e56eab18426284b X-VCS-Branch: master Date: Fri, 22 Apr 2016 08:40:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 71238be4-66c9-4344-bf0a-5e4f1fd730f8 X-Archives-Hash: 370b0209cf4bb1b90846fa952c22e70a commit: c8e6ee71ad4d6e9e6804f56a1e56eab18426284b Author: Tiziano Müller gentoo org> AuthorDate: Fri Apr 22 08:40:02 2016 +0000 Commit: Tiziano Müller gentoo 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