aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Shvetsov <alexxy@gentoo.org>2012-12-02 05:32:22 +0400
committerAlexey Shvetsov <alexxy@gentoo.org>2012-12-02 05:32:22 +0400
commite0d920e4f7bfd13255db486199e459d5243ba38e (patch)
tree6c8b271a482f33375a791ad718c82f1b8cd7c697
parentmoved to gx86 (diff)
downloadsci-e0d920e4f7bfd13255db486199e459d5243ba38e.tar.gz
sci-e0d920e4f7bfd13255db486199e459d5243ba38e.tar.bz2
sci-e0d920e4f7bfd13255db486199e459d5243ba38e.zip
[sci-chemistry/nwchem] Initial import from bug #393139. Mpi still doesnt work
Package-Manager: portage-2.2.0_alpha143 RepoMan-Options: --force
-rw-r--r--sci-chemistry/nwchem/ChangeLog12
-rw-r--r--sci-chemistry/nwchem/Manifest1
-rw-r--r--sci-chemistry/nwchem/files/nwchem-6.1.1-adjust-dir-length.patch22
-rw-r--r--sci-chemistry/nwchem/files/nwchem-6.1.1-makefile.patch14
-rw-r--r--sci-chemistry/nwchem/files/nwchem-6.1.1-nwchemrc.patch13
-rw-r--r--sci-chemistry/nwchem/files/nwchem-6.1.1-python_makefile.patch12
-rw-r--r--sci-chemistry/nwchem/metadata.xml12
-rw-r--r--sci-chemistry/nwchem/nwchem-6.1.1.ebuild137
8 files changed, 223 insertions, 0 deletions
diff --git a/sci-chemistry/nwchem/ChangeLog b/sci-chemistry/nwchem/ChangeLog
new file mode 100644
index 000000000..89671d8c2
--- /dev/null
+++ b/sci-chemistry/nwchem/ChangeLog
@@ -0,0 +1,12 @@
+# ChangeLog for sci-chemistry/nwchem
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*nwchem-6.1.1 (02 Dec 2012)
+
+ 02 Dec 2012; Alexey Shvetsov <alexxy@gentoo.org>
+ +files/nwchem-6.1.1-adjust-dir-length.patch,
+ +files/nwchem-6.1.1-makefile.patch, +files/nwchem-6.1.1-nwchemrc.patch,
+ +files/nwchem-6.1.1-python_makefile.patch, +metadata.xml,
+ +nwchem-6.1.1.ebuild:
+ [sci-chemistry/nwchem] Initial import from bug #393139. Mpi still doesnt work
diff --git a/sci-chemistry/nwchem/Manifest b/sci-chemistry/nwchem/Manifest
new file mode 100644
index 000000000..c26a0a29d
--- /dev/null
+++ b/sci-chemistry/nwchem/Manifest
@@ -0,0 +1 @@
+DIST Nwchem-6.1.1-src.2012-06-27.tar.gz 77838112 SHA256 153a975e18fa88afbacfa2c7d4384e31bc25c43bd5c99c2f4074006a8e035dab SHA512 b2cc796f6fd0e37385a9b8c0a5dbc3c219849938b52809a616cb5c3fa5a3a54a7c61be215cf8975d1287d09ecfae1bedd41e69e445e61adb5a7aac505802170d WHIRLPOOL d6107522fadca8597d0fdff758169a2c25adb8da0ccfbad9a9f408708d0060922fef443f9c92ccd97b3772c70ba9fe90a1ec7c059de536e6a294719080c9bfaf
diff --git a/sci-chemistry/nwchem/files/nwchem-6.1.1-adjust-dir-length.patch b/sci-chemistry/nwchem/files/nwchem-6.1.1-adjust-dir-length.patch
new file mode 100644
index 000000000..859c76469
--- /dev/null
+++ b/sci-chemistry/nwchem/files/nwchem-6.1.1-adjust-dir-length.patch
@@ -0,0 +1,22 @@
+--- src/nwpw/libraryps/GNUmakefile 2012-01-26 08:24:05.189490945 +0100
++++ src/nwpw/libraryps/GNUmakefile 2012-01-26 08:24:16.499490923 +0100
+@@ -10,7 +10,7 @@
+
+ USES_BLAS =
+
+- LONGNWTOP = $(shell if [ `echo $(SRCDIR) |wc -m` -gt 64 ]; then echo "Y"; fi )
++ LONGNWTOP = $(shell if [ `echo $(SRCDIR) |wc -m` -gt 80 ]; then echo "Y"; fi )
+ ifeq ($(LONGNWTOP),Y)
+ errorlongpwd:
+ @echo " "
+--- src/basis/GNUmakefile 2012-01-26 08:25:03.999490829 +0100
++++ src/basis/GNUmakefile 2012-01-26 08:25:15.549490805 +0100
+@@ -34,7 +34,7 @@
+ ########################################################
+
+ LIB_TARGETS = testbasis testbasis.o libcheck
+- LONGNWTOP = $(shell if [ `echo $(SRCDIR) |wc -m` -gt 64 ]; then echo "Y"; fi )
++ LONGNWTOP = $(shell if [ `echo $(SRCDIR) |wc -m` -gt 80 ]; then echo "Y"; fi )
+ ifeq ($(LONGNWTOP),Y)
+ errorlongpwd:
+ @echo " "
diff --git a/sci-chemistry/nwchem/files/nwchem-6.1.1-makefile.patch b/sci-chemistry/nwchem/files/nwchem-6.1.1-makefile.patch
new file mode 100644
index 000000000..a74d887af
--- /dev/null
+++ b/sci-chemistry/nwchem/files/nwchem-6.1.1-makefile.patch
@@ -0,0 +1,14 @@
+--- src/tools/global/GNUmakefile 2011-12-03 14:34:01.000000000 +0100
++++ src/tools/global/GNUmakefile 2011-12-03 14:37:40.000000000 +0100
+@@ -68,7 +68,10 @@
+ $(LIBRARY):
+ (echo TARGET is $(TARGET); cd ./src; $(MAKE) || exit 1;)
+
+-$(TESTS) %.x: $(LIBRARY)
++%.x: $(LIBRARY)
++ (cd ./testing; $(MAKE) $@ || exit 1;)
++
++$(TESTS): $(LIBRARY)
+ (cd ./testing; $(MAKE) $@ || exit 1;)
+
+ all: $(TESTS)
diff --git a/sci-chemistry/nwchem/files/nwchem-6.1.1-nwchemrc.patch b/sci-chemistry/nwchem/files/nwchem-6.1.1-nwchemrc.patch
new file mode 100644
index 000000000..4e1e0af1e
--- /dev/null
+++ b/sci-chemistry/nwchem/files/nwchem-6.1.1-nwchemrc.patch
@@ -0,0 +1,13 @@
+--- nwchemrc 2011-12-04 11:29:37.000000000 +0100
++++ nwchemrc 2011-12-04 11:29:26.000000000 +0100
+@@ -0,0 +1,10 @@
++nwchem_basis_library /usr/share/NWChem/basis/libraries/
++nwchem_nwpw_library /usr/share/NWChem/nwpw/libraryps/
++ffield amber
++amber_1 /usr/share/NWChem/data/amber_s/
++amber_2 /usr/share/NWChem/data/amber_q/
++amber_3 /usr/share/NWChem/data/amber_x/
++amber_4 /usr/share/NWChem/data/amber_u/
++spce /usr/share/NWChem/data/solvents/spce.rst
++charmm_s /usr/share/NWChem/data/charmm_s/
++charmm_x /usr/share/NWChem/data/charmm_x/
diff --git a/sci-chemistry/nwchem/files/nwchem-6.1.1-python_makefile.patch b/sci-chemistry/nwchem/files/nwchem-6.1.1-python_makefile.patch
new file mode 100644
index 000000000..7753d8f6a
--- /dev/null
+++ b/sci-chemistry/nwchem/files/nwchem-6.1.1-python_makefile.patch
@@ -0,0 +1,12 @@
+--- src/config/makefile.h 2011-12-04 12:00:52.000000000 +0100
++++ src/config/makefile.h 2011-12-04 12:01:56.000000000 +0100
+@@ -2133,7 +2133,7 @@
+ #
+ ifdef USE_PYTHON64
+- CORE_LIBS += $(PYTHONHOME)/lib64/python$(PYTHONVERSION)/config/libpython$(PYTHONVERSION).a
++ CORE_LIBS += $(PYTHONHOME)/lib/libpython$(PYTHONVERSION).a
+ else
+- CORE_LIBS += $(PYTHONHOME)/lib/python$(PYTHONVERSION)/config/libpython$(PYTHONVERSION).a
++ CORE_LIBS += $(PYTHONHOME)/lib/libpython$(PYTHONVERSION).a
+ endif
+ endif
diff --git a/sci-chemistry/nwchem/metadata.xml b/sci-chemistry/nwchem/metadata.xml
new file mode 100644
index 000000000..7d880f89c
--- /dev/null
+++ b/sci-chemistry/nwchem/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>alexxy@gentoo.org</email>
+ <name>Alexey Shvetsov</name>
+ </maintainer>
+ <use>
+ <flag name="nwchem-tests">Install qa tests data</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-chemistry/nwchem/nwchem-6.1.1.ebuild b/sci-chemistry/nwchem/nwchem-6.1.1.ebuild
new file mode 100644
index 000000000..51a5c6232
--- /dev/null
+++ b/sci-chemistry/nwchem/nwchem-6.1.1.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit eutils fortran-2 multilib python toolchain-funcs
+
+DESCRIPTION="NWChem: Delivering High-Performance Computational Chemistry to Science"
+HOMEPAGE="http://www.nwchem-sw.org/index.php/Main_Page"
+DATE="2012-06-27"
+SRC_URI="http://www.nwchem-sw.org/images/Nwchem-${PV}-src.${DATE}.tar.gz"
+LICENSE="ECL-2.0"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE="mpi examples nwchem-tests python"
+
+RDEPEND="
+ sys-fs/sysfsutils
+"
+
+DEPEND="${RDEPEND}
+ virtual/fortran
+ mpi? ( virtual/mpi[fortran] )
+"
+
+S="${WORKDIR}/${P}-src"
+
+pkg_setup() {
+ fortran-2_pkg_setup
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/nwchem-${PV}-makefile.patch
+ epatch "${FILESDIR}"/nwchem-${PV}-nwchemrc.patch
+ epatch "${FILESDIR}"/nwchem-${PV}-adjust-dir-length.patch
+ if use python ; then
+ epatch "${FILESDIR}"/nwchem-${PV}-python_makefile.patch
+ fi
+ sed -e "s:DBASIS_LIBRARY=\"'\$(SRCDIR)'\":DBASIS_LIBRARY=\"'${EPREFIX}/usr/share/NWChem'\":g" \
+ -i src/basis/MakeFile \
+ -i 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 \
+ -i src/MakeFile
+
+ 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="-lfmpich -lmpich -lpthread" # fix mpi linking!
+ 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|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" \
+ || die "Compilation failed"
+}
+
+src_install() {
+ dobin bin/${NWCHEM_TARGET}/nwchem || die "Failed to install binary"
+
+ dodir /usr/share/NWChem/basis || die "Failed to create data directory"
+ insinto /usr/share/NWChem/basis/libraries
+ doins -r src/basis/libraries/* || die "Failed to install basis library"
+ dodir /usr/share/NWChem/data || die "Failed to create data directory"
+ insinto /usr/share/NWChem/data
+ doins -r src/data/* || die "Failed to install data"
+ dodir /usr/share/NWChem/nwpw || die "Failed to create data directory"
+ insinto /usr/share/NWChem/nwpw/libraryps
+ doins -r src/nwpw/libraryps/* || die "Failed to install data"
+
+ insinto /etc
+ doins nwchemrc
+
+ if use examples ; then
+ dodir /usr/share/NWChem/examples || die "Failed to create examples directory"
+ insinto /usr/share/NWChem/examples
+ doins -r examples/* || die "Failed to install examples"
+ fi
+
+ if use nwchem-tests ; then
+ dodir /usr/share/NWChem/tests || die "Failed to create tests directory"
+ insinto /usr/share/NWChem/tests
+ doins -r QA/tests/* || "Failed to install tests"
+ fi
+}
+
+pkg_postinst() {
+ elog
+ 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."
+ elog
+}