Gentoo Archives: gentoo-commits

From: Alexey Shvetsov <alexxy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-chemistry/nwchem/files/, sci-chemistry/nwchem/
Date: Sun, 02 Dec 2012 01:34:31
Message-Id: 1354411942.e0d920e4f7bfd13255db486199e459d5243ba38e.alexxy@gentoo
1 commit: e0d920e4f7bfd13255db486199e459d5243ba38e
2 Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 2 01:32:22 2012 +0000
4 Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 2 01:32:22 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=e0d920e4
7
8 [sci-chemistry/nwchem] Initial import from bug #393139. Mpi still doesnt work
9
10 Package-Manager: portage-2.2.0_alpha143
11 RepoMan-Options: --force
12
13 ---
14 sci-chemistry/nwchem/ChangeLog | 12 ++
15 .../files/nwchem-6.1.1-adjust-dir-length.patch | 22 +++
16 .../nwchem/files/nwchem-6.1.1-makefile.patch | 14 ++
17 .../nwchem/files/nwchem-6.1.1-nwchemrc.patch | 13 ++
18 .../files/nwchem-6.1.1-python_makefile.patch | 12 ++
19 sci-chemistry/nwchem/metadata.xml | 12 ++
20 sci-chemistry/nwchem/nwchem-6.1.1.ebuild | 137 ++++++++++++++++++++
21 7 files changed, 222 insertions(+), 0 deletions(-)
22
23 diff --git a/sci-chemistry/nwchem/ChangeLog b/sci-chemistry/nwchem/ChangeLog
24 new file mode 100644
25 index 0000000..89671d8
26 --- /dev/null
27 +++ b/sci-chemistry/nwchem/ChangeLog
28 @@ -0,0 +1,12 @@
29 +# ChangeLog for sci-chemistry/nwchem
30 +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
31 +# $Header: $
32 +
33 +*nwchem-6.1.1 (02 Dec 2012)
34 +
35 + 02 Dec 2012; Alexey Shvetsov <alexxy@g.o>
36 + +files/nwchem-6.1.1-adjust-dir-length.patch,
37 + +files/nwchem-6.1.1-makefile.patch, +files/nwchem-6.1.1-nwchemrc.patch,
38 + +files/nwchem-6.1.1-python_makefile.patch, +metadata.xml,
39 + +nwchem-6.1.1.ebuild:
40 + [sci-chemistry/nwchem] Initial import from bug #393139. Mpi still doesnt work
41
42 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
43 new file mode 100644
44 index 0000000..859c764
45 --- /dev/null
46 +++ b/sci-chemistry/nwchem/files/nwchem-6.1.1-adjust-dir-length.patch
47 @@ -0,0 +1,22 @@
48 +--- src/nwpw/libraryps/GNUmakefile 2012-01-26 08:24:05.189490945 +0100
49 ++++ src/nwpw/libraryps/GNUmakefile 2012-01-26 08:24:16.499490923 +0100
50 +@@ -10,7 +10,7 @@
51 +
52 + USES_BLAS =
53 +
54 +- LONGNWTOP = $(shell if [ `echo $(SRCDIR) |wc -m` -gt 64 ]; then echo "Y"; fi )
55 ++ LONGNWTOP = $(shell if [ `echo $(SRCDIR) |wc -m` -gt 80 ]; then echo "Y"; fi )
56 + ifeq ($(LONGNWTOP),Y)
57 + errorlongpwd:
58 + @echo " "
59 +--- src/basis/GNUmakefile 2012-01-26 08:25:03.999490829 +0100
60 ++++ src/basis/GNUmakefile 2012-01-26 08:25:15.549490805 +0100
61 +@@ -34,7 +34,7 @@
62 + ########################################################
63 +
64 + LIB_TARGETS = testbasis testbasis.o libcheck
65 +- LONGNWTOP = $(shell if [ `echo $(SRCDIR) |wc -m` -gt 64 ]; then echo "Y"; fi )
66 ++ LONGNWTOP = $(shell if [ `echo $(SRCDIR) |wc -m` -gt 80 ]; then echo "Y"; fi )
67 + ifeq ($(LONGNWTOP),Y)
68 + errorlongpwd:
69 + @echo " "
70
71 diff --git a/sci-chemistry/nwchem/files/nwchem-6.1.1-makefile.patch b/sci-chemistry/nwchem/files/nwchem-6.1.1-makefile.patch
72 new file mode 100644
73 index 0000000..a74d887
74 --- /dev/null
75 +++ b/sci-chemistry/nwchem/files/nwchem-6.1.1-makefile.patch
76 @@ -0,0 +1,14 @@
77 +--- src/tools/global/GNUmakefile 2011-12-03 14:34:01.000000000 +0100
78 ++++ src/tools/global/GNUmakefile 2011-12-03 14:37:40.000000000 +0100
79 +@@ -68,7 +68,10 @@
80 + $(LIBRARY):
81 + (echo TARGET is $(TARGET); cd ./src; $(MAKE) || exit 1;)
82 +
83 +-$(TESTS) %.x: $(LIBRARY)
84 ++%.x: $(LIBRARY)
85 ++ (cd ./testing; $(MAKE) $@ || exit 1;)
86 ++
87 ++$(TESTS): $(LIBRARY)
88 + (cd ./testing; $(MAKE) $@ || exit 1;)
89 +
90 + all: $(TESTS)
91
92 diff --git a/sci-chemistry/nwchem/files/nwchem-6.1.1-nwchemrc.patch b/sci-chemistry/nwchem/files/nwchem-6.1.1-nwchemrc.patch
93 new file mode 100644
94 index 0000000..4e1e0af
95 --- /dev/null
96 +++ b/sci-chemistry/nwchem/files/nwchem-6.1.1-nwchemrc.patch
97 @@ -0,0 +1,13 @@
98 +--- nwchemrc 2011-12-04 11:29:37.000000000 +0100
99 ++++ nwchemrc 2011-12-04 11:29:26.000000000 +0100
100 +@@ -0,0 +1,10 @@
101 ++nwchem_basis_library /usr/share/NWChem/basis/libraries/
102 ++nwchem_nwpw_library /usr/share/NWChem/nwpw/libraryps/
103 ++ffield amber
104 ++amber_1 /usr/share/NWChem/data/amber_s/
105 ++amber_2 /usr/share/NWChem/data/amber_q/
106 ++amber_3 /usr/share/NWChem/data/amber_x/
107 ++amber_4 /usr/share/NWChem/data/amber_u/
108 ++spce /usr/share/NWChem/data/solvents/spce.rst
109 ++charmm_s /usr/share/NWChem/data/charmm_s/
110 ++charmm_x /usr/share/NWChem/data/charmm_x/
111
112 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
113 new file mode 100644
114 index 0000000..7753d8f
115 --- /dev/null
116 +++ b/sci-chemistry/nwchem/files/nwchem-6.1.1-python_makefile.patch
117 @@ -0,0 +1,12 @@
118 +--- src/config/makefile.h 2011-12-04 12:00:52.000000000 +0100
119 ++++ src/config/makefile.h 2011-12-04 12:01:56.000000000 +0100
120 +@@ -2133,7 +2133,7 @@
121 + #
122 + ifdef USE_PYTHON64
123 +- CORE_LIBS += $(PYTHONHOME)/lib64/python$(PYTHONVERSION)/config/libpython$(PYTHONVERSION).a
124 ++ CORE_LIBS += $(PYTHONHOME)/lib/libpython$(PYTHONVERSION).a
125 + else
126 +- CORE_LIBS += $(PYTHONHOME)/lib/python$(PYTHONVERSION)/config/libpython$(PYTHONVERSION).a
127 ++ CORE_LIBS += $(PYTHONHOME)/lib/libpython$(PYTHONVERSION).a
128 + endif
129 + endif
130
131 diff --git a/sci-chemistry/nwchem/metadata.xml b/sci-chemistry/nwchem/metadata.xml
132 new file mode 100644
133 index 0000000..7d880f8
134 --- /dev/null
135 +++ b/sci-chemistry/nwchem/metadata.xml
136 @@ -0,0 +1,12 @@
137 +<?xml version="1.0" encoding="UTF-8"?>
138 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
139 +<pkgmetadata>
140 + <herd>sci-chemistry</herd>
141 + <maintainer>
142 + <email>alexxy@g.o</email>
143 + <name>Alexey Shvetsov</name>
144 + </maintainer>
145 + <use>
146 + <flag name="nwchem-tests">Install qa tests data</flag>
147 + </use>
148 +</pkgmetadata>
149
150 diff --git a/sci-chemistry/nwchem/nwchem-6.1.1.ebuild b/sci-chemistry/nwchem/nwchem-6.1.1.ebuild
151 new file mode 100644
152 index 0000000..51a5c62
153 --- /dev/null
154 +++ b/sci-chemistry/nwchem/nwchem-6.1.1.ebuild
155 @@ -0,0 +1,137 @@
156 +# Copyright 1999-2012 Gentoo Foundation
157 +# Distributed under the terms of the GNU General Public License v2
158 +# $Header: $
159 +
160 +EAPI=5
161 +
162 +inherit eutils fortran-2 multilib python toolchain-funcs
163 +
164 +DESCRIPTION="NWChem: Delivering High-Performance Computational Chemistry to Science"
165 +HOMEPAGE="http://www.nwchem-sw.org/index.php/Main_Page"
166 +DATE="2012-06-27"
167 +SRC_URI="http://www.nwchem-sw.org/images/Nwchem-${PV}-src.${DATE}.tar.gz"
168 +LICENSE="ECL-2.0"
169 +SLOT="0"
170 +KEYWORDS="~x86 ~amd64"
171 +IUSE="mpi examples nwchem-tests python"
172 +
173 +RDEPEND="
174 + sys-fs/sysfsutils
175 +"
176 +
177 +DEPEND="${RDEPEND}
178 + virtual/fortran
179 + mpi? ( virtual/mpi[fortran] )
180 +"
181 +
182 +S="${WORKDIR}/${P}-src"
183 +
184 +pkg_setup() {
185 + fortran-2_pkg_setup
186 + python_set_active_version 2
187 + python_pkg_setup
188 +}
189 +
190 +src_prepare() {
191 + epatch "${FILESDIR}"/nwchem-${PV}-makefile.patch
192 + epatch "${FILESDIR}"/nwchem-${PV}-nwchemrc.patch
193 + epatch "${FILESDIR}"/nwchem-${PV}-adjust-dir-length.patch
194 + if use python ; then
195 + epatch "${FILESDIR}"/nwchem-${PV}-python_makefile.patch
196 + fi
197 + sed -e "s:DBASIS_LIBRARY=\"'\$(SRCDIR)'\":DBASIS_LIBRARY=\"'${EPREFIX}/usr/share/NWChem'\":g" \
198 + -i src/basis/MakeFile \
199 + -i src/basis/GNUmakefile || die
200 + sed -e "s:DNWPW_LIBRARY=\"'\$(SRCDIR)'\":DNWPW_LIBRARY=\"'${EPREFIX}/usr/share/NWChem'\":g" \
201 + -i src/nwpw/libraryps/GNUmakefile || die
202 + sed -e "s:-DCOMPILATION_DIR=\"'\$(TOPDIR)'\":-DCOMPILATION_DIR=\"''\":g" \
203 + -i src/GNUmakefile \
204 + -i src/MakeFile
205 +
206 + if [[ $(tc-getFC) == *-*-*-*-gfortran ]]; then
207 + sed -e "s:ifneq (\$(FC),gfortran):ifneq (\$(FC),$(tc-getFC)):g" \
208 + -e "s:ifeq (\$(FC),gfortran):ifeq (\$(FC),$(tc-getFC)):g" \
209 + -i src/config/makefile.h || die
210 + fi
211 +}
212 +
213 +src_compile() {
214 + export USE_SUBGROUPS=yes
215 + if use mpi ; then
216 + export MSG_COMMS=MPI
217 + export USE_MPI=yes
218 + export MPI_LOC=/usr
219 + export MPI_INCLUDE=$MPI_LOC/include
220 + export MPI_LIB=$MPI_LOC/$(get_libdir)
221 + export LIBMPI="-lfmpich -lmpich -lpthread" # fix mpi linking!
222 + fi
223 + if [ "$ARCH" = "amd64" ]; then
224 + export NWCHEM_TARGET=LINUX64
225 + elif [ "$ARCH" = "ia64" ]; then
226 + export NWCHEM_TARGET=LINUX64
227 + elif [ "$ARCH" = "x86" ]; then
228 + export NWCHEM_TARGET=LINUX
229 + elif [ "$ARCH" = "ppc" ]; then
230 + export NWCHEM_TARGET=LINUX
231 + else
232 + die "Unknown architecture"
233 + fi
234 + if use python ; then
235 + if [ "$ARCH" = "amd64" ] || [ "$ARCH" = "ia64" ]; then
236 + export USE_PYTHON64=yes
237 + fi
238 + export PYTHONHOME=/usr
239 + export PYTHONVERSION=$(eselect python show|awk -Fpython '{ print $2 }')
240 + export PYTHONPATH="./:${S}/contrib/python/"
241 + export NWCHEM_MODULES="all python"
242 + else
243 + export NWCHEM_MODULES="all"
244 + fi
245 +
246 + cd src
247 + emake \
248 + DIAG=PAR \
249 + FC=$(tc-getFC) \
250 + CC=$(tc-getCC) \
251 + CXX=$(tc-getCXX) \
252 + NWCHEM_TOP="${S}" \
253 + NWCHEM_EXECUTABLE="${S}/bin/${NWCHEM_TARGET}/nwchem" \
254 + || die "Compilation failed"
255 +}
256 +
257 +src_install() {
258 + dobin bin/${NWCHEM_TARGET}/nwchem || die "Failed to install binary"
259 +
260 + dodir /usr/share/NWChem/basis || die "Failed to create data directory"
261 + insinto /usr/share/NWChem/basis/libraries
262 + doins -r src/basis/libraries/* || die "Failed to install basis library"
263 + dodir /usr/share/NWChem/data || die "Failed to create data directory"
264 + insinto /usr/share/NWChem/data
265 + doins -r src/data/* || die "Failed to install data"
266 + dodir /usr/share/NWChem/nwpw || die "Failed to create data directory"
267 + insinto /usr/share/NWChem/nwpw/libraryps
268 + doins -r src/nwpw/libraryps/* || die "Failed to install data"
269 +
270 + insinto /etc
271 + doins nwchemrc
272 +
273 + if use examples ; then
274 + dodir /usr/share/NWChem/examples || die "Failed to create examples directory"
275 + insinto /usr/share/NWChem/examples
276 + doins -r examples/* || die "Failed to install examples"
277 + fi
278 +
279 + if use nwchem-tests ; then
280 + dodir /usr/share/NWChem/tests || die "Failed to create tests directory"
281 + insinto /usr/share/NWChem/tests
282 + doins -r QA/tests/* || "Failed to install tests"
283 + fi
284 +}
285 +
286 +pkg_postinst() {
287 + elog
288 + elog "The user will need to link \$HOME/.nwchemrc to /etc/nwchemrc"
289 + elog "or copy it in order to tell NWChem the right position of the"
290 + elog "basis library and other necessary data."
291 + elog
292 +}