public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Honza Macháček" <Hloupy.Honza@centrum.cz>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sci:master commit in: sci-chemistry/nwchem/
Date: Thu,  7 Aug 2014 10:10:28 +0000 (UTC)	[thread overview]
Message-ID: <1407406211.ae5bf779150182f7a2b747c8ed6823808b3254f8.honza_machacek@gentoo> (raw)

commit:     ae5bf779150182f7a2b747c8ed6823808b3254f8
Author:     Honza Macháček <Hloupy.Honza <AT> centrum <DOT> cz>
AuthorDate: Thu Aug  7 10:10:11 2014 +0000
Commit:     Honza Macháček <Hloupy.Honza <AT> centrum <DOT> cz>
CommitDate: Thu Aug  7 10:10:11 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=ae5bf779

Changed the versioning of sci-chemistry/nwchem to use the package patchlevel versus the ebuild revision properly. Compilation without MPI support tested and corrected. Options added to compile with OpenMP, to compile the MRCC module, and to build against system BLAS.

Package-Manager: portage-2.2.11-r1

---
 sci-chemistry/nwchem/ChangeLog                     |  12 +-
 sci-chemistry/nwchem/metadata.xml                  |   3 +
 sci-chemistry/nwchem/nwchem-6.3-r1.ebuild          | 150 ---------------------
 ...wchem-6.3-r2.ebuild => nwchem-6.3_p2-r1.ebuild} |  62 ++++++++-
 4 files changed, 70 insertions(+), 157 deletions(-)

diff --git a/sci-chemistry/nwchem/ChangeLog b/sci-chemistry/nwchem/ChangeLog
index b4cad04..1050ebf 100644
--- a/sci-chemistry/nwchem/ChangeLog
+++ b/sci-chemistry/nwchem/ChangeLog
@@ -1,7 +1,17 @@
 # ChangeLog for sci-chemistry/nwchem
-# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+*nwchem-6.3_p2-r1 (07 Aug 2014)
+
+  07 Aug 2014; Honza Macháček <Hloupy.Honza@centrum.cz>
+  -nwchem-6.3-r1.ebuild, -nwchem-6.3-r2.ebuild, +nwchem-6.3_p2-r1.ebuild:
+  Changed versioning to use the package patchlevel versus the ebuild revision
+  properly. Compilation without MPI support tested and corrected. Options added
+  to compile with OpenMP (not sure if it has any effect, setting the compiler
+  flag only), to compile the large MRCC module skipped by default, and to build
+  against system BLAS.
+
   19 Oct 2013; Honza Macháček <Hloupy.Honza@centrum.cz> nwchem-6.3-r2.ebuild:
   Arranged for the TeX fonts creation in the sandbox. This time really.
 

diff --git a/sci-chemistry/nwchem/metadata.xml b/sci-chemistry/nwchem/metadata.xml
index 28f9d6e..11305d8 100644
--- a/sci-chemistry/nwchem/metadata.xml
+++ b/sci-chemistry/nwchem/metadata.xml
@@ -7,6 +7,9 @@
     <name>Alexey Shvetsov</name>
   </maintainer>
   <use>
+    <flag name="mrcc">Compile the MRCC module</flag>
+  </use>
+  <use>
     <flag name="nwchem-tests">Install qa tests data</flag>
   </use>
 </pkgmetadata>

diff --git a/sci-chemistry/nwchem/nwchem-6.3-r1.ebuild b/sci-chemistry/nwchem/nwchem-6.3-r1.ebuild
deleted file mode 100644
index e7b75f2..0000000
--- a/sci-chemistry/nwchem/nwchem-6.3-r1.ebuild
+++ /dev/null
@@ -1,150 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-EAPI=5
-
-PYTHON_COMPAT=( python{2_6,2_7} )
-
-inherit eutils fortran-2 multilib python-single-r1 toolchain-funcs
-
-DATE="2013-05-28"
-
-DESCRIPTION="Delivering High-Performance Computational Chemistry to Science"
-HOMEPAGE="http://www.nwchem-sw.org/index.php/Main_Page"
-SRC_URI="http://www.nwchem-sw.org/images/Nwchem-${PV}.revision${PR#r}-src.${DATE}.tar.gz"
-
-LICENSE="ECL-2.0"
-SLOT="0"
-KEYWORDS="~x86 ~amd64"
-IUSE="mpi doc examples nwchem-tests python"
-
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-RDEPEND="
-	sys-fs/sysfsutils
-	python? ( ${PYTHON_DEPS} )"
-DEPEND="${RDEPEND}
-	app-shells/tcsh
-	mpi? ( virtual/mpi[fortran] )
-	doc? (
-		dev-texlive/texlive-latex
-		dev-tex/latex2html )"
-
-S="${WORKDIR}/${P}-src.${DATE}"
-
-pkg_setup() {
-	fortran-2_pkg_setup
-	use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
-	epatch \
-		"${FILESDIR}"/nwchem-6.1.1-makefile.patch \
-		"${FILESDIR}"/nwchem-6.1.1-nwchemrc.patch \
-		"${FILESDIR}"/nwchem-6.1.1-adjust-dir-length.patch
-	use python && epatch "${FILESDIR}"/nwchem-6.1.1-python_makefile.patch
-	use doc && epatch "${FILESDIR}"/nwchem-6.3-r1-html_doc.patch
-
-	sed \
-		-e "s:DBASIS_LIBRARY=\"'\$(SRCDIR)'\":DBASIS_LIBRARY=\"'${EPREFIX}/usr/share/NWChem'\":g" \
-		-i src/basis/MakeFile src/basis/GNUmakefile || die
-	sed \
-		-e "s:DNWPW_LIBRARY=\"'\$(SRCDIR)'\":DNWPW_LIBRARY=\"'${EPREFIX}/usr/share/NWChem'\":g" \
-		-i src/nwpw/libraryps/GNUmakefile || die
-	sed \
-		-e "s:-DCOMPILATION_DIR=\"'\$(TOPDIR)'\":-DCOMPILATION_DIR=\"''\":g" \
-		-i src/GNUmakefile src/MakeFile || die
-
-	if [[ $(tc-getFC) == *-*-*-*-gfortran ]]; then
-		sed \
-			-e "s:ifneq (\$(FC),gfortran):ifneq (\$(FC),$(tc-getFC)):g" \
-			-e "s:ifeq (\$(FC),gfortran):ifeq (\$(FC),$(tc-getFC)):g" \
-			-i src/config/makefile.h || die
-	fi
-}
-
-src_compile() {
-	export USE_SUBGROUPS=yes
-	if use mpi ; then
-		export MSG_COMMS=MPI
-		export USE_MPI=yes
-		export MPI_LOC=/usr
-		export MPI_INCLUDE=$MPI_LOC/include
-		export MPI_LIB=$MPI_LOC/$(get_libdir)
-		export LIBMPI="$(mpif90 -showme:link)"
-	fi
-	if [ "$ARCH" = "amd64" ]; then
-		export NWCHEM_TARGET=LINUX64
-	elif [ "$ARCH" = "ia64" ]; then
-		export NWCHEM_TARGET=LINUX64
-	elif [ "$ARCH" = "x86" ]; then
-		export NWCHEM_TARGET=LINUX
-	elif [ "$ARCH" = "ppc" ]; then
-		export NWCHEM_TARGET=LINUX
-	else
-		die "Unknown architecture"
-	fi
-	if use python ; then
-		if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "ia64" ]; then
-			export USE_PYTHON64=yes
-		fi
-		export PYTHONHOME=/usr
-		export PYTHONVERSION=$(eselect python show --python2 |awk -Fpython '{ print $2 }')
-		export PYTHONPATH="./:${S}/contrib/python/"
-		export NWCHEM_MODULES="all python"
-	else
-		export NWCHEM_MODULES="all"
-	fi
-
-	cd src
-	emake \
-		DIAG=PAR \
-		FC=$(tc-getFC) \
-		CC=$(tc-getCC) \
-		CXX=$(tc-getCXX) \
-		NWCHEM_TOP="${S}" \
-		NWCHEM_EXECUTABLE="${S}/bin/${NWCHEM_TARGET}/nwchem"
-
-	if use doc; then
-		cd "${S}"/doc
-		emake \
-			DIAG=PAR \
-			NWCHEM_TOP="${S}" \
-			pdf html
-	fi
-}
-
-src_install() {
-	dobin bin/${NWCHEM_TARGET}/nwchem
-
-	insinto /usr/share/NWChem/basis/
-	doins -r src/basis/libraries src/data
-	insinto /usr/share/NWChem/nwpw
-	doins -r src/nwpw/libraryps
-
-	insinto /etc
-	doins nwchemrc
-
-	use examples && \
-		insinto /usr/share/NWChem/ && \
-		doins -r examples
-
-	use nwchem-tests && \
-		insinto /usr/share/NWChem && \
-		doins -r QA/tests
-
-	use doc && \
-		insinto /usr/share/doc/"${P}" && \
-		doins -r doc/nwahtml && \
-		doins -r web
-
-}
-
-pkg_postinst() {
-	echo
-	elog "The user will need to link \$HOME/.nwchemrc to /etc/nwchemrc"
-	elog "or copy it in order to tell NWChem the right position of the"
-	elog "basis library and other necessary data."
-	echo
-}

diff --git a/sci-chemistry/nwchem/nwchem-6.3-r2.ebuild b/sci-chemistry/nwchem/nwchem-6.3_p2-r1.ebuild
similarity index 72%
rename from sci-chemistry/nwchem/nwchem-6.3-r2.ebuild
rename to sci-chemistry/nwchem/nwchem-6.3_p2-r1.ebuild
index 368790e..b42b713 100644
--- a/sci-chemistry/nwchem/nwchem-6.3-r2.ebuild
+++ b/sci-chemistry/nwchem/nwchem-6.3_p2-r1.ebuild
@@ -6,18 +6,18 @@ EAPI=5
 
 PYTHON_COMPAT=( python{2_6,2_7} )
 
-inherit eutils fortran-2 multilib python-single-r1 toolchain-funcs
+inherit eutils flag-o-matic fortran-2 multilib python-single-r1 toolchain-funcs
 
 DATE="2013-10-17"
 
 DESCRIPTION="Delivering High-Performance Computational Chemistry to Science"
 HOMEPAGE="http://www.nwchem-sw.org/index.php/Main_Page"
-SRC_URI="http://www.nwchem-sw.org/images/Nwchem-${PV}.revision${PR#r}-src.${DATE}.tar.gz"
+SRC_URI="http://www.nwchem-sw.org/images/Nwchem-${PV%_p*}.revision${PV#*_p}-src.${DATE}.tar.gz"
 
 LICENSE="ECL-2.0"
 SLOT="0"
 KEYWORDS="~x86 ~amd64"
-IUSE="mpi doc examples nwchem-tests python"
+IUSE="blas mpi doc examples nwchem-tests openmp mrcc python"
 
 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
@@ -31,11 +31,46 @@ DEPEND="${RDEPEND}
 		dev-texlive/texlive-latex
 		dev-tex/latex2html )"
 
-LONG_S="${WORKDIR}/${P}.revision${PR#r}-src.${DATE}"
+LONG_S="${WORKDIR}/${PN}-${PV%_p*}.revision${PV#*_p}-src.${DATE}"
 S="${WORKDIR}/${PN}"
 
 pkg_setup() {
+	# fortran-2.eclass does not handle mpi wrappers
+	if use mpi; then
+		export FC="mpif90"
+		export F77="mpif77"
+		export CC="mpicc"
+		export CXX="mpic++"
+	else
+		tc-export FC F77 CC CXX
+	fi
+
+	use openmp && FORTRAN_NEED_OPENMP=1
+
 	fortran-2_pkg_setup
+
+	if use openmp; then
+		# based on _fortran-has-openmp() of fortran-2.eclass
+		local openmp=""
+		local fcode=ebuild-openmp-flags.f
+		local _fc=$(tc-getFC)
+
+		pushd "${T}"
+		cat <<- EOF > "${fcode}"
+		1     call omp_get_num_threads
+		2     end
+		EOF
+
+		for openmp in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do
+			"${_fc}" "${openmp}" "${fcode}" -o "${fcode}.x" && break
+		done
+
+		rm -f "${fcode}.*"
+		popd
+
+		append-flags "${openmp}"
+	fi
+
 	use python && python-single-r1_pkg_setup
 }
 
@@ -74,11 +109,17 @@ src_compile() {
 	export USE_SUBGROUPS=yes
 	if use mpi ; then
 		export MSG_COMMS=MPI
-		export USE_MPI=yes
-		export MPI_LOC=/usr
+		export USE_MPI=y
+		export USE_MPIF=y
+		export MPI_LOC="${EPREFIX}"/usr
 		export MPI_INCLUDE=$MPI_LOC/include
 		export MPI_LIB=$MPI_LOC/$(get_libdir)
 		export LIBMPI="$(mpif90 -showme:link)"
+	else
+		unset USE_MPI
+		unset USE_MPIF
+		export MSG_COMMS=TCGMSG
+		export ARMCI_NETWORK=SOCKETS
 	fi
 	if [ "$ARCH" = "amd64" ]; then
 		export NWCHEM_TARGET=LINUX64
@@ -102,6 +143,15 @@ src_compile() {
 	else
 		export NWCHEM_MODULES="all"
 	fi
+	use mrcc && export MRCC_THEORY="TRUE"	
+	if use blas; then
+		export HAS_BLAS=yes
+		export BLASOPT="$(pkg-config --libs blas)"
+	else
+		unset HAS_BLAS
+		unset BLASOPT
+	fi
+	export LARGE_FILES="TRUE"
 
 	cd src
 	emake \


             reply	other threads:[~2014-08-07 10:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-07 10:10 Honza Macháček [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-02-25 19:18 [gentoo-commits] proj/sci:master commit in: sci-chemistry/nwchem/ Justin Lecher
2016-03-23 20:41 Alexey Shvetsov
2015-03-02 12:20 Honza Macháček
2015-01-15 10:52 Honza Macháček
2015-01-05 16:18 Honza Macháček
2014-12-17 13:44 Honza Macháček
2014-12-09 17:45 Honza Macháček
2014-11-12 15:51 Honza Macháček
2014-09-16 17:01 Christoph Junghans
2014-08-19 21:51 Christoph Junghans
2013-10-19  9:36 Honza Macháček
2013-10-19  6:19 Honza Macháček
2013-06-16 15:53 Justin Lecher
2013-06-04 11:59 Justin Lecher
2013-03-14  2:32 Francois Bissey

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=1407406211.ae5bf779150182f7a2b747c8ed6823808b3254f8.honza_machacek@gentoo \
    --to=hloupy.honza@centrum.cz \
    --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