Gentoo Archives: gentoo-commits

From: "Alexey Shvetsov (alexxy)" <alexxy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-chemistry/gamess: gamess-20101001.1-r1.ebuild ChangeLog gamess-20101001.1.ebuild
Date: Sun, 23 Jan 2011 12:43:09
Message-Id: 20110123124259.4D37B20054@flycatcher.gentoo.org
1 alexxy 11/01/23 12:42:59
2
3 Modified: ChangeLog
4 Added: gamess-20101001.1-r1.ebuild
5 Removed: gamess-20101001.1.ebuild
6 Log:
7 [sci-chemistry/gamess] Fix neo build
8
9 (Portage version: 2.2.0_alpha18_p3/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.49 sci-chemistry/gamess/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gamess/ChangeLog?rev=1.49&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gamess/ChangeLog?rev=1.49&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gamess/ChangeLog?r1=1.48&r2=1.49
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/sci-chemistry/gamess/ChangeLog,v
21 retrieving revision 1.48
22 retrieving revision 1.49
23 diff -u -r1.48 -r1.49
24 --- ChangeLog 29 Dec 2010 18:31:56 -0000 1.48
25 +++ ChangeLog 23 Jan 2011 12:42:58 -0000 1.49
26 @@ -1,6 +1,12 @@
27 # ChangeLog for sci-chemistry/gamess
28 -# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/gamess/ChangeLog,v 1.48 2010/12/29 18:31:56 alexxy Exp $
30 +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
31 +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/gamess/ChangeLog,v 1.49 2011/01/23 12:42:58 alexxy Exp $
32 +
33 +*gamess-20101001.1-r1 (23 Jan 2011)
34 +
35 + 23 Jan 2011; Alexey Shvetsov <alexxy@g.o> -gamess-20101001.1.ebuild,
36 + +gamess-20101001.1-r1.ebuild, +files/gamess-neo-fix.patch:
37 + Fix neo build for gamess
38
39 29 Dec 2010; Alexey Shvetsov <alexxy@g.o>
40 -gamess-20090112.1-r1.ebuild, -files/gamess-20090112.1.gentoo.patch,
41
42
43
44 1.1 sci-chemistry/gamess/gamess-20101001.1-r1.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gamess/gamess-20101001.1-r1.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gamess/gamess-20101001.1-r1.ebuild?rev=1.1&content-type=text/plain
48
49 Index: gamess-20101001.1-r1.ebuild
50 ===================================================================
51 # Copyright 1999-2011 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/sci-chemistry/gamess/gamess-20101001.1-r1.ebuild,v 1.1 2011/01/23 12:42:58 alexxy Exp $
54
55 EAPI="3"
56
57 inherit eutils toolchain-funcs flag-o-matic
58
59 DESCRIPTION="A powerful quantum chemistry package"
60 LICENSE="gamess"
61 HOMEPAGE="http://www.msg.chem.iastate.edu/GAMESS/GAMESS.html"
62 SRC_URI="
63 ${P}.tar.gz
64 qmmm-tinker? ( tinker.tar.Z )"
65
66 SLOT="0"
67 # NOTE: PLEASE do not stabilize gamess. It does not make sense
68 # since the tarball has fetch restrictions and upstream only
69 # provides the latest version. In other words: As soon as a
70 # new version comes out the stable version will be useless since
71 # users can not get at the tarball any more.
72 KEYWORDS="~amd64 ~ppc ~x86"
73 IUSE="hardened mpi neo qmmm-tinker"
74
75 CDEPEND="app-shells/tcsh
76 hardened? ( sys-apps/paxctl )
77 mpi? ( virtual/mpi )
78 virtual/blas"
79 DEPEND="${CDEPEND}
80 dev-util/pkgconfig"
81 RDEPEND="${CDEPEND}
82 net-misc/openssh"
83
84 S="${WORKDIR}/${PN}"
85
86 RESTRICT="fetch"
87
88 GAMESS_DOWNLOAD="http://www.msg.ameslab.gov/GAMESS/License_Agreement.html"
89 GAMESS_VERSION="1 OCT 2010 (R1)"
90
91 pkg_nofetch() {
92 echo
93 elog "Please download ${PN}-current.tar.gz from"
94 elog "${GAMESS_DOWNLOAD}."
95 elog "Be sure to select the version ${GAMESS_VERSION} tarball!!"
96 elog "Then move the tarball to"
97 elog "${DISTDIR}/${P}.tar.gz"
98 if use qmmm-tinker ; then
99 elog "Also download http://www.msg.ameslab.gov/GAMESS/tinker.tar.Z"
100 elog "and place tinker.tar.Z to ${DISTDIR}"
101 fi
102 echo
103 }
104
105 get_fcomp() {
106 case $(tc-getFC) in
107 *gfortran* )
108 FCOMP="gfortran" ;;
109 ifort )
110 FCOMP="ifc" ;;
111 * )
112 FCOMP=$(tc-getFC) ;;
113 esac
114 }
115
116 pkg_setup() {
117 get_fcomp
118 # currently amd64 is only supported with gfortran
119 if [[ "${ARCH}" == "amd64" ]] && [[ ${FCOMP} != *gfortran* ]];
120 then die "You will need gfortran to compile gamess on amd64"
121 fi
122
123 # note about qmmm-tinker
124 if use qmmm-tinker; then
125 einfo "By default MM subsistem is restricted to 1000 atoms"
126 einfo "if you want larger MM subsystems then you should set"
127 einfo "QMMM_GAMESS_MAXMM variable to needed value in your make.conf"
128 einfo "By default maximum number of atom classes types and size of"
129 einfo "hessian are restricted to 250, 500 and 1000000 respectively"
130 einfo "If you want larger sizes set:"
131 einfo "QMMM_GAMESS_MAXCLASS"
132 einfo "QMMM_GAMESS_MAXCTYP"
133 einfo "QMMM_GAMESS_MAXHESS"
134 einfo "in your make.conf"
135 fi
136
137 #note about mpi
138 if use mpi; then
139 ewarn ""
140 ewarn "You should adjust rungms script for your mpi implentation"
141 ewarn "because deafult one will not work"
142 ewarn ""
143 fi
144 }
145
146 src_unpack() {
147 unpack ${A}
148
149 if use qmmm-tinker; then
150 mv tinker gamess/ || die "failed to move tinker directory"
151 fi
152 }
153
154 src_prepare() {
155 # apply LINUX-arch patches to gamess makesfiles
156 epatch "${FILESDIR}"/${P}.gentoo.patch
157 # select arch
158 # NOTE: please leave lked alone; it should be good as is!!
159 cd "${S}"
160 local active_arch;
161 if [[ "${ARCH}" == "amd64" ]]; then
162 active_arch="linux64";
163 else
164 active_arch="linux32";
165 fi
166
167 # for hardened-gcc let't turn off ssp, since it breakes
168 # a few routines
169 if use hardened && [[ ${FCOMP} == g77 ]]; then
170 FFLAGS="${FFLAGS} -fno-stack-protector-all"
171 fi
172
173 # Enable mpi stuff
174 if use mpi; then
175 sed -e "s:set COMM = sockets:set COMM = mpi:g" \
176 -i ddi/compddi || die "Enabling mpi build failed"
177 sed -e "s:MPI_INCLUDE_PATH = ' ':MPI_INCLUDE_PATH = '-I/usr/include ':g" \
178 -i ddi/compddi || die "Enabling mpi build failed"
179 sed -e "s:MSG_LIBRARIES='../ddi/libddi.a -lpthread':MSG_LIBRARIES='../ddi/libddi.a -lmpi -lpthread':g" \
180 -i lked || die "Enabling mpi build failed"
181 fi
182
183 # enable NEO
184 if use neo; then
185 epatch "${FILESDIR}/${PN}-neo-fix.patch"
186 sed -e "s:NEO=false:NEO=true:" -i compall lked || \
187 die "Failed to enable NEO code"
188 else
189 sed -e "s:NEO=true:NEO=false:" -i compall lked || \
190 die "Failed to disable NEO code"
191 fi
192 # enable GAMESS-qmmm
193 if use qmmm-tinker; then
194 epatch "${FILESDIR}/${PN}-qmmm-tinker-fix-idate.patch"
195 sed -e "s:TINKER=false:TINKER=true:" -i compall lked || \
196 die "Failed to enable TINKER code"
197 if [ "x$QMMM_GAMESS_MAXMM" == "x" ]; then
198 einfo "No QMMM_GAMESS_MAXMM set. Using default value = 1000"
199 else
200 einfo "Setting QMMM_GAMESS_MAXMM to $QMMM_GAMESS_MAXMM"
201 sed -e "s:maxatm=1000:maxatm=$QMMM_GAMESS_MAXMM:g" \
202 -i tinker/sizes.i \
203 || die "Setting QMMM_GAMESS_MAXMM failed"
204 sed -e "s:MAXATM=1000:MAXATM=$QMMM_GAMESS_MAXMM:g" \
205 -i source/inputb.src \
206 || die "Setting QMMM_GAMESS_MAXMM failed"
207 fi
208 if [ "x$QMMM_GAMESS_MAXCLASS" == "x" ]; then
209 einfo "No QMMM_GAMESS_MAXMM set. Using default value = 250"
210 else
211 sed -e "s:maxclass=250:maxclass=$QMMM_GAMESS_MAXCLASS:g" \
212 -i tinker/sizes.i \
213 || die "Setting QMMM_GAMESS_MAXCLASS failed"
214 fi
215 if [ "x$QMMM_GAMESS_MAXCTYP" == "x" ]; then
216 einfo "No QMMM_GAMESS_MAXCTYP set. Using default value = 500"
217 else
218 sed -e "s:maxtyp=500:maxtyp=$QMMM_GAMESS_MAXCTYP:g" \
219 -i tinker/sizes.i \
220 || die "Setting QMMM_GAMESS_MAXCTYP failed"
221 fi
222 if [ "x$QMMM_GAMESS_MAXHESS" == "x" ]; then
223 einfo "No QMMM_GAMESS_MAXHESS set. Usingdefault value = 1000000"
224 else
225 sed -e "s:maxhess=1000000:maxhess=$QMMM_GAMESS_MAXHESS:g" \
226 -i tinker/sizes.i \
227 || die "Setting QMMM_GAMESS_MAXHESS failed"
228 fi
229 fi
230 # greate proper activate sourcefile
231 cp "./tools/actvte.code" "./tools/actvte.f" || \
232 die "Failed to create actvte.f"
233 sed -e "s/^\*UNX/ /" -i "./tools/actvte.f" || \
234 die "Failed to perform UNX substitutions in actvte.f"
235
236 # fix GAMESS' compall script to use proper CC
237 sed -e "s|\$CCOMP -c \$extraflags source/zunix.c|$(tc-getCC) -c \$extraflags source/zunix.c|" \
238 -i compall || die "Failed setting up compall script"
239
240 # insert proper FFLAGS into GAMESS' comp makefile
241 # in case we're using ifc let's strip all the gcc
242 # specific stuff
243 if [[ ${FCOMP} == "ifort" ]]; then
244 sed -e "s/gentoo-OPT = '-O2'/OPT = '${FFLAGS} -quiet'/" \
245 -i comp || die "Failed setting up comp script"
246 elif ! use x86; then
247 sed -e "s/-malign-double //" \
248 -e "s/gentoo-OPT = '-O2'/OPT = '${FFLAGS}'/" \
249 -i comp || die "Failed setting up comp script"
250 else
251 sed -e "s/gentoo-OPT = '-O2'/OPT = '${FFLAGS}'/" \
252 -i comp || die "Failed setting up comp script"
253 fi
254
255 # fix up GAMESS' linker script;
256 sed -e "s/gentoo-LDOPTS=' '/LDOPTS='${LDFLAGS}'/" \
257 -i lked || die "Failed setting up lked script"
258 # fix up GAMESS' ddi TCP/IP socket build
259 sed -e "s/gentoo-CC = 'gcc'/CC = '$(tc-getCC)'/" \
260 -i ddi/compddi || die "Failed setting up compddi script"
261 # Creating install.info
262 cat > install.info <<-EOF
263 #!/bin/csh
264 setenv GMS_PATH $WORKDIR/gamess
265 setenv GMS_TARGET $active_arch
266 setenv GMS_FORTRAN $FCOMP
267 setenv GMS_MATHLIB atlas
268 setenv GMS_MATHLIB_PATH /usr/$(get_libdir)/atlas
269 setenv GMS_DDI_COMM sockets
270 EOF
271
272 }
273
274 src_compile() {
275 # build actvte
276 cd "${S}"/tools
277 ${FCOMP} -o actvte.x actvte.f || \
278 die "Failed to compile actvte.x"
279
280 # for hardened (PAX) users and ifc we need to turn
281 # MPROTECT off
282 if [[ ${FCOMP} == "ifort" ]] && use hardened; then
283 /sbin/paxctl -PemRxS actvte.x 2> /dev/null || \
284 die "paxctl failed on actvte.x"
285 fi
286
287 # build gamess
288 cd "${S}"
289 ./compall || die "compall failed"
290
291 # build the ddi TCP/IP socket stuff
292 cd ${S}/"ddi"
293 ./compddi || die "compddi failed"
294
295 # finally, link it all together
296 cd "${S}"
297 ./lked || die "lked failed"
298
299 # for hardened (PAX) users and ifc we need to turn
300 # MPROTECT off
301 if [[ ${FCOMP} == "ifort" ]] && use hardened; then
302 /sbin/paxctl -PemRxS ${PN}.00.x 2> /dev/null || \
303 die "paxctl failed on actvte.x"
304 fi
305 }
306
307 src_install() {
308 # the executables
309 dobin ${PN}.00.x rungms \
310 || die "Failed installing binaries"
311 if use !mpi; then
312 dobin ddi/ddikick.x \
313 || die "Failed installing binaries"
314 fi
315
316 # the docs
317 dodoc *.DOC qmnuc/*.DOC || die "Failed installing docs"
318
319 # install ericftm
320 insinto /usr/share/${PN}/ericfmt
321 doins ericfmt.dat || die "Failed installing ericfmt.dat"
322
323 # install mcpdata
324 insinto /usr/share/${PN}/mcpdata
325 doins mcpdata/* || die "Failed installing mcpdata"
326
327 # install tinker params in case of qmmm
328 if use qmmm-tinker ; then
329 dodoc tinker/simomm.doc || die "Failed installing docs"
330 insinto /usr/share/${PN}
331 doins -r tinker/params51 || die "Failed to install Tinker params"
332 fi
333
334 # install the tests the user should run, and
335 # fix up the runscript; also grab a copy of rungms
336 # so the user is ready to run the tests
337 insinto /usr/share/${PN}/tests
338 insopts -m0644
339 doins tests/* || die "Failed installing tests"
340 insopts -m0744
341 doins runall || die "Failed installing tests"
342 doins tools/checktst/checktst tools/checktst/chkabs || \
343 die "Failed to install main test checker"
344 doins tools/checktst/exam* || \
345 die "Failed to install individual test files"
346
347 insinto /usr/share/${PN}/neotests
348 insopts -m0644
349 doins -r qmnuc/neotests/* || die "Failed to install NEO tests"
350 }
351
352 pkg_postinst() {
353 echo
354 einfo "Before you use GAMESS for any serious work you HAVE"
355 einfo "to run the supplied test files located in"
356 einfo "/usr/share/gamess/tests and check them thoroughly."
357 einfo "Otherwise all scientific publications resulting from"
358 einfo "your GAMESS runs should be immediately rejected :)"
359 einfo "To do so copy the content of /usr/share/gamess/tests"
360 einfo "to some temporary location and execute './runall'. "
361 einfo "Then run the checktst script in the same directory to"
362 einfo "validate the tests."
363 einfo "Please consult TEST.DOC and the other docs!"
364
365 if [[ ${FCOMP} == "ifort" ]]; then
366 echo
367 ewarn "IMPORTANT NOTE: We STRONGLY recommend to stay away"
368 ewarn "from ifc-9.0 for now and use the ifc-8.1 series of"
369 ewarn "compilers UNLESS you can run through ALL of the "
370 ewarn "test cases (see above) successfully."
371 fi
372
373 echo
374 einfo "If you want to run on more than a single CPU"
375 einfo "you will have to acquaint yourself with the way GAMESS"
376 einfo "does multiprocessor runs and adjust rungms according to"
377 einfo "your target network architecture."
378 echo
379 }