1 |
commit: e9fc59e7cc0b16c130f16ff22fc3242f1fe3333b |
2 |
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 26 09:17:53 2016 +0000 |
4 |
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 26 09:17:53 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=e9fc59e7 |
7 |
|
8 |
sci-chemistry/gamess: Version bump |
9 |
|
10 |
BugID #439908 |
11 |
|
12 |
Package-Manager: portage-2.3.0_rc1 |
13 |
|
14 |
.../gamess/files/gamess-20141205.1.gentoo.patch | 198 ++++++++++++ |
15 |
sci-chemistry/gamess/gamess-20141205.1.ebuild | 338 +++++++++++++++++++++ |
16 |
2 files changed, 536 insertions(+) |
17 |
|
18 |
diff --git a/sci-chemistry/gamess/files/gamess-20141205.1.gentoo.patch b/sci-chemistry/gamess/files/gamess-20141205.1.gentoo.patch |
19 |
new file mode 100644 |
20 |
index 0000000..742ea46 |
21 |
--- /dev/null |
22 |
+++ b/sci-chemistry/gamess/files/gamess-20141205.1.gentoo.patch |
23 |
@@ -0,0 +1,198 @@ |
24 |
+diff -urN gamess.orig/comp gamess/comp |
25 |
+--- gamess.orig/comp 2015-01-15 17:49:05.000000000 +0300 |
26 |
++++ gamess/comp 2016-05-26 11:40:00.143511481 +0300 |
27 |
+@@ -1535,7 +1535,7 @@ |
28 |
+ # |
29 |
+ case gfortran: |
30 |
+ # |
31 |
+- set OPT='-O2' |
32 |
++ set gentoo-OPT='-O2' |
33 |
+ if ($MODULE == zheev) set OPT='-O0' # defensive compiling |
34 |
+ |
35 |
+ set EXTRAOPT=" " |
36 |
+@@ -1577,6 +1577,11 @@ |
37 |
+ breaksw |
38 |
+ case 4.8: |
39 |
+ case 4.9: |
40 |
++ case 5.0: |
41 |
++ case 5.1: |
42 |
++ case 5.2: |
43 |
++ case 5.3: |
44 |
++ case 6.0: |
45 |
+ if ($MODULE == cosmo) set OPT='-O0' |
46 |
+ if ($MODULE == dcscf) set OPT='-O0' |
47 |
+ if ($MODULE == tddgrd) set OPT='-O0' |
48 |
+@@ -1605,7 +1610,7 @@ |
49 |
+ # optimizations in 32 bit mode, as a function of the ifort version. |
50 |
+ # |
51 |
+ case ifort: |
52 |
+- set OPT = '-O3' |
53 |
++ set gentoo-OPT = '-O2' |
54 |
+ if ($MODULE == delocl) set OPT='-O0' # from Cheol |
55 |
+ if ($MODULE == prpamm) set OPT='-O0' # for exam13 |
56 |
+ if ($MODULE == zheev) set OPT='-O0' |
57 |
+@@ -1740,7 +1745,7 @@ |
58 |
+ # |
59 |
+ # first, initialize OPT and EXTRAOPT |
60 |
+ # |
61 |
+- set OPT='-O2' |
62 |
++ set gentoo-OPT='-O2' |
63 |
+ if ($MODULE == zheev) set OPT='-O0' # defensive compiling |
64 |
+ |
65 |
+ set EXTRAOPT=" " |
66 |
+@@ -1793,6 +1798,11 @@ |
67 |
+ breaksw |
68 |
+ case 4.8: |
69 |
+ case 4.9: |
70 |
++ case 5.0: |
71 |
++ case 5.1: |
72 |
++ case 5.2: |
73 |
++ case 5.3: |
74 |
++ case 6.0: |
75 |
+ if ($MODULE == cosmo) set OPT='-O0' # same issue as seen in 4.6 |
76 |
+ if ($MODULE == dcscf) set OPT='-O0' # exam44, continues from 4.7 |
77 |
+ if ($MODULE == tddgrd) set OPT='-O0' # exam41, continues from 4.6 |
78 |
+@@ -1829,7 +1839,7 @@ |
79 |
+ # -WB means warn but don't fail on out-of-bounds array references |
80 |
+ # -ftz flushes underflow results to zero |
81 |
+ # |
82 |
+- set OPT = '-O2' |
83 |
++ set gentoo-OPT = '-O2' |
84 |
+ if (".$GMS_DEBUG_FLAGS" != .) set OPT="$GMS_DEBUG_FLAGS" |
85 |
+ # alas, I'm so tired of hearing about so many versions failing to |
86 |
+ # diagonalize, that this time critical code is run w/o optimization. |
87 |
+diff -urN gamess.orig/ddi/compddi gamess/ddi/compddi |
88 |
+--- gamess.orig/ddi/compddi 2015-01-15 17:49:05.000000000 +0300 |
89 |
++++ gamess/ddi/compddi 2016-05-26 11:30:34.601322818 +0300 |
90 |
+@@ -610,7 +610,7 @@ |
91 |
+ |
92 |
+ set FORTRAN=$GMS_FORTRAN # might be g77, gfortran, ifort, pgf77, f2c |
93 |
+ |
94 |
+- set CC = 'gcc' |
95 |
++ set gentoo-CC = 'gcc' |
96 |
+ set CFLAGS = "-DLINUX -O3 -fstrict-aliasing -I./" |
97 |
+ set CLIBS = "-lpthread" |
98 |
+ |
99 |
+@@ -664,7 +664,7 @@ |
100 |
+ set ARCH='-m64' |
101 |
+ if (`uname -p` == ia64) set ARCH='' |
102 |
+ |
103 |
+- set CC = 'gcc' |
104 |
++ set gentoo-CC = 'gcc' |
105 |
+ set CFLAGS = "-DLINUX $ARCH -O3 -fstrict-aliasing -I./" |
106 |
+ set CLIBS = "-lpthread" |
107 |
+ |
108 |
+diff -urN gamess.orig/ddi/kickoff/ddikick.c gamess/ddi/kickoff/ddikick.c |
109 |
+--- gamess.orig/ddi/kickoff/ddikick.c 2011-11-22 23:54:33.000000000 +0400 |
110 |
++++ gamess/ddi/kickoff/ddikick.c 2016-05-26 11:30:34.601322818 +0300 |
111 |
+@@ -105,7 +105,7 @@ |
112 |
+ remoteshell = argv[++i]; |
113 |
+ } else { |
114 |
+ if((remoteshell = getenv("DDI_RSH")) == NULL) { |
115 |
+- remoteshell = (char *) strdup("rsh"); |
116 |
++ remoteshell = (char *) strdup("ssh"); |
117 |
+ } |
118 |
+ } |
119 |
+ |
120 |
+diff -urN gamess.orig/gms-files.csh gamess/gms-files.csh |
121 |
+--- gamess.orig/gms-files.csh 2014-05-16 18:14:43.000000000 +0400 |
122 |
++++ gamess/gms-files.csh 2016-05-26 11:30:34.601322818 +0300 |
123 |
+@@ -28,7 +28,7 @@ |
124 |
+ # to see all the file definitions (one is just below). |
125 |
+ # |
126 |
+ #---quiet---set echo |
127 |
+-setenv AUXDATA $GMSPATH/auxdata |
128 |
++setenv AUXDATA /usr/share/gamess |
129 |
+ setenv EXTBAS /dev/null |
130 |
+ setenv NUCBAS /dev/null |
131 |
+ setenv POSBAS /dev/null |
132 |
+diff -urN gamess.orig/lked gamess/lked |
133 |
+--- gamess.orig/lked 2014-12-08 20:56:59.000000000 +0300 |
134 |
++++ gamess/lked 2016-05-26 11:41:11.124667982 +0300 |
135 |
+@@ -356,12 +356,12 @@ |
136 |
+ switch ($GMS_FORTRAN) |
137 |
+ case gfortran: |
138 |
+ set LDR='gfortran' |
139 |
+- set LDOPTS=' ' |
140 |
++ set gentoo-LDOPTS=' ' |
141 |
+ set FORTLIBS=' ' |
142 |
+ breaksw |
143 |
+ case ifort: |
144 |
+ set LDR='ifort' |
145 |
+- set LDOPTS=' ' # add '-Wl,-M' to see load map |
146 |
++ set gentoo-LDOPTS=' ' # add '-Wl,-M' to see load map |
147 |
+ set FORTLIBS='-Vaxlib' |
148 |
+ breaksw |
149 |
+ case pgfortran: |
150 |
+@@ -420,12 +420,7 @@ |
151 |
+ # Otherwise, attempt a link against shared object libs. |
152 |
+ # See the 64 bit Atlas below for a way to fix the linker's |
153 |
+ # not being able to locate -lf77blas, if that happens. |
154 |
+- if (-e $GMS_MATHLIB_PATH/libf77blas.a) then |
155 |
+- set MATHLIBS="$GMS_MATHLIB_PATH/libf77blas.a" |
156 |
+- set MATHLIBS="$MATHLIBS $GMS_MATHLIB_PATH/libatlas.a" |
157 |
+- else |
158 |
+- set MATHLIBS="-L$GMS_MATHLIB_PATH -lf77blas -latlas" |
159 |
+- endif |
160 |
++ set MATHLIBS=`${PKG_CONFIG} --libs blas` |
161 |
+ set BLAS=' ' |
162 |
+ breaksw |
163 |
+ |
164 |
+@@ -459,12 +454,12 @@ |
165 |
+ switch ($GMS_FORTRAN) |
166 |
+ case gfortran: |
167 |
+ set LDR='gfortran' |
168 |
+- set LDOPTS=' ' |
169 |
++ set gentoo-LDOPTS=' ' |
170 |
+ set FORTLIBS=' ' |
171 |
+ breaksw |
172 |
+ case ifort: |
173 |
+ set LDR='ifort' |
174 |
+- set LDOPTS='-i8' # -Wl,-M generates a load map |
175 |
++ set gentoo-LDOPTS=' ' # -Wl,-M generates a load map |
176 |
+ # this auxiliary library seems to have disappeared in ifort 10 |
177 |
+ set FORTLIBS=' ' |
178 |
+ if($GMS_IFORT_VERNO < 10) set FORTLIBS='-Vaxlib' |
179 |
+@@ -581,13 +576,7 @@ |
180 |
+ # ln -s liblapack_atlas.so.3.0 liblapack.so |
181 |
+ # ln -s liblapack.so.3.0 liblapack.so |
182 |
+ # It is strange the RPM's don't do these soft links for us. |
183 |
+- if (-e $GMS_MATHLIB_PATH/libf77blas.a) then |
184 |
+- set MATHLIBS="$GMS_MATHLIB_PATH/libf77blas.a" |
185 |
+- set MATHLIBS="$MATHLIBS $GMS_MATHLIB_PATH/libatlas.a" |
186 |
+- else |
187 |
+- set MATHLIBS="-L$GMS_MATHLIB_PATH -lf77blas -latlas" |
188 |
+- if ($CCHEM == true) set MATHLIBS="$MATHLIBS -llapack" |
189 |
+- endif |
190 |
++ set MATHLIBS=`${PKG_CONFIG} --libs blas` |
191 |
+ set BLAS=' ' |
192 |
+ breaksw |
193 |
+ |
194 |
+diff -urN gamess.orig/runall gamess/runall |
195 |
+--- gamess.orig/runall 2012-02-03 03:55:01.000000000 +0400 |
196 |
++++ gamess/runall 2016-05-26 11:30:34.603322822 +0300 |
197 |
+@@ -46,7 +46,7 @@ |
198 |
+ xgms -v $VERNO -q $QUEUE -l exam$NUM.log exam$NUM |
199 |
+ sleep 2 |
200 |
+ else |
201 |
+- ./rungms exam$NUM $VERNO 1 >& exam$NUM.log |
202 |
++ rungms exam$NUM $VERNO 1 >& exam$NUM.log |
203 |
+ endif |
204 |
+ @ i++ |
205 |
+ end |
206 |
+diff -urN gamess.orig/rungms gamess/rungms |
207 |
+--- gamess.orig/rungms 2014-12-10 19:01:06.000000000 +0300 |
208 |
++++ gamess/rungms 2016-05-26 11:42:23.316828732 +0300 |
209 |
+@@ -60,9 +60,9 @@ |
210 |
+ # See also a very old LoadLeveler "ll-gms" for some IBM systems. |
211 |
+ # |
212 |
+ set TARGET=sockets |
213 |
+-set SCR=/scr/$USER |
214 |
+-set USERSCR=/u1/$USER/scr |
215 |
+-set GMSPATH=/u1/mike/gamess |
216 |
++set SCR=`pwd` |
217 |
++set USERSCR=`pwd` |
218 |
++set GMSPATH=/usr/bin |
219 |
+ # |
220 |
+ set JOB=$1 # name of the input file xxx.inp, give only the xxx part |
221 |
+ set VERNO=$2 # revision number of the executable created by 'lked' step |
222 |
|
223 |
diff --git a/sci-chemistry/gamess/gamess-20141205.1.ebuild b/sci-chemistry/gamess/gamess-20141205.1.ebuild |
224 |
new file mode 100644 |
225 |
index 0000000..1fb80b7 |
226 |
--- /dev/null |
227 |
+++ b/sci-chemistry/gamess/gamess-20141205.1.ebuild |
228 |
@@ -0,0 +1,338 @@ |
229 |
+# Copyright 1999-2016 Gentoo Foundation |
230 |
+# Distributed under the terms of the GNU General Public License v2 |
231 |
+# $Id$ |
232 |
+ |
233 |
+EAPI=5 |
234 |
+ |
235 |
+inherit eutils fortran-2 flag-o-matic pax-utils toolchain-funcs |
236 |
+ |
237 |
+DESCRIPTION="A powerful quantum chemistry package" |
238 |
+HOMEPAGE="http://www.msg.chem.iastate.edu/GAMESS/GAMESS.html" |
239 |
+SRC_URI=" |
240 |
+ ${P}.tar.gz |
241 |
+ qmmm-tinker? ( tinker.tar.gz )" |
242 |
+ |
243 |
+SLOT="0" |
244 |
+LICENSE="gamess" |
245 |
+# NOTE: PLEASE do not stabilize gamess. It does not make sense |
246 |
+# since the tarball has fetch restrictions and upstream only |
247 |
+# provides the latest version. In other words: As soon as a |
248 |
+# new version comes out the stable version will be useless since |
249 |
+# users can not get at the tarball any more. |
250 |
+KEYWORDS="~amd64 ~ppc ~x86" |
251 |
+IUSE="mpi neo pax_kernel qmmm-tinker" |
252 |
+ |
253 |
+CDEPEND=" |
254 |
+ app-shells/tcsh |
255 |
+ mpi? ( virtual/mpi ) |
256 |
+ virtual/blas" |
257 |
+DEPEND="${CDEPEND} |
258 |
+ virtual/pkgconfig" |
259 |
+RDEPEND="${CDEPEND} |
260 |
+ net-misc/openssh" |
261 |
+ |
262 |
+S="${WORKDIR}/${PN}" |
263 |
+ |
264 |
+RESTRICT="fetch" |
265 |
+ |
266 |
+GAMESS_DOWNLOAD="http://www.msg.ameslab.gov/GAMESS/License_Agreement.html" |
267 |
+GAMESS_VERSION="5 DEC 2014 (R1)" |
268 |
+ |
269 |
+pkg_nofetch() { |
270 |
+ echo |
271 |
+ elog "Please download ${PN}-current.tar.gz from" |
272 |
+ elog "${GAMESS_DOWNLOAD}." |
273 |
+ elog "Be sure to select the version ${GAMESS_VERSION} tarball!!" |
274 |
+ elog "Then move the tarball to" |
275 |
+ elog "${DISTDIR}/${P}.tar.gz" |
276 |
+ if use qmmm-tinker ; then |
277 |
+ elog "Also download http://www.msg.ameslab.gov/GAMESS/tinker.tar.Z" |
278 |
+ elog "and place tinker.tar.Z to ${DISTDIR}" |
279 |
+ fi |
280 |
+ echo |
281 |
+} |
282 |
+ |
283 |
+get_fcomp() { |
284 |
+ case $(tc-getFC) in |
285 |
+ *gfortran* ) |
286 |
+ FCOMP="gfortran" ;; |
287 |
+ ifort ) |
288 |
+ FCOMP="ifc" ;; |
289 |
+ * ) |
290 |
+ FCOMP=$(tc-getFC) ;; |
291 |
+ esac |
292 |
+} |
293 |
+ |
294 |
+pkg_setup() { |
295 |
+ fortran-2_pkg_setup |
296 |
+ get_fcomp |
297 |
+ # currently amd64 is only supported with gfortran |
298 |
+ if [[ "${ARCH}" == "amd64" ]] && [[ ${FCOMP} != *gfortran* ]]; |
299 |
+ then die "You will need gfortran to compile gamess on amd64" |
300 |
+ fi |
301 |
+ |
302 |
+ # note about qmmm-tinker |
303 |
+ if use qmmm-tinker; then |
304 |
+ einfo "By default MM subsistem is restricted to 1000 atoms" |
305 |
+ einfo "if you want larger MM subsystems then you should set" |
306 |
+ einfo "QMMM_GAMESS_MAXMM variable to needed value in your make.conf" |
307 |
+ einfo "By default maximum number of atom classes types and size of" |
308 |
+ einfo "hessian are restricted to 250, 500 and 1000000 respectively" |
309 |
+ einfo "If you want larger sizes set:" |
310 |
+ einfo "QMMM_GAMESS_MAXCLASS" |
311 |
+ einfo "QMMM_GAMESS_MAXCTYP" |
312 |
+ einfo "QMMM_GAMESS_MAXHESS" |
313 |
+ einfo "in your make.conf" |
314 |
+ fi |
315 |
+ |
316 |
+ #note about mpi |
317 |
+ if use mpi; then |
318 |
+ ewarn "" |
319 |
+ ewarn "You should adjust rungms script for your mpi implentation" |
320 |
+ ewarn "because deafult one will not work" |
321 |
+ ewarn "" |
322 |
+ fi |
323 |
+} |
324 |
+ |
325 |
+src_unpack() { |
326 |
+ unpack ${A} |
327 |
+ |
328 |
+ if use qmmm-tinker; then |
329 |
+ mv tinker gamess/ || die "failed to move tinker directory" |
330 |
+ fi |
331 |
+} |
332 |
+ |
333 |
+src_prepare() { |
334 |
+ tc-export PKG_CONFIG |
335 |
+ # apply LINUX-arch patches to gamess makesfiles |
336 |
+ epatch "${FILESDIR}/${P}.gentoo.patch" |
337 |
+ # select arch |
338 |
+ # NOTE: please leave lked alone; it should be good as is!! |
339 |
+ cd "${S}" |
340 |
+ local active_arch; |
341 |
+ if [[ "${ARCH}" == "amd64" ]]; then |
342 |
+ active_arch="linux64"; |
343 |
+ else |
344 |
+ active_arch="linux32"; |
345 |
+ fi |
346 |
+ |
347 |
+ # for hardened-gcc let't turn off ssp, since it breakes |
348 |
+ # a few routines |
349 |
+ if use pax_kernel && [[ ${FCOMP} == g77 ]]; then |
350 |
+ FFLAGS="${FFLAGS} -fno-stack-protector-all" |
351 |
+ fi |
352 |
+ |
353 |
+ # Enable mpi stuff |
354 |
+ if use mpi; then |
355 |
+ sed -e "s:set COMM = sockets:set COMM = mpi:g" \ |
356 |
+ -i ddi/compddi || die "Enabling mpi build failed" |
357 |
+ sed -e "s:MPI_INCLUDE_PATH = ' ':MPI_INCLUDE_PATH = '-I/usr/include ':g" \ |
358 |
+ -i ddi/compddi || die "Enabling mpi build failed" |
359 |
+ sed -e "s:MSG_LIBRARIES='../ddi/libddi.a -lpthread':MSG_LIBRARIES='../ddi/libddi.a -lmpi -lpthread':g" \ |
360 |
+ -i lked || die "Enabling mpi build failed" |
361 |
+ fi |
362 |
+ |
363 |
+ # enable NEO |
364 |
+ if use neo; then |
365 |
+ sed -e "s:NEO=false:NEO=true:" -i compall lked || \ |
366 |
+ die "Failed to enable NEO code" |
367 |
+ else |
368 |
+ sed -e "s:NEO=true:NEO=false:" -i compall lked || \ |
369 |
+ die "Failed to disable NEO code" |
370 |
+ fi |
371 |
+ # enable GAMESS-qmmm |
372 |
+ if use qmmm-tinker; then |
373 |
+ epatch "${FILESDIR}/${PN}-qmmm-tinker-fix-idate.patch" |
374 |
+ sed -e "s:TINKER=false:TINKER=true:" -i compall lked || \ |
375 |
+ die "Failed to enable TINKER code" |
376 |
+ if [ "x$QMMM_GAMESS_MAXMM" == "x" ]; then |
377 |
+ einfo "No QMMM_GAMESS_MAXMM set. Using default value = 1000" |
378 |
+ else |
379 |
+ einfo "Setting QMMM_GAMESS_MAXMM to $QMMM_GAMESS_MAXMM" |
380 |
+ sed -e "s:maxatm=1000:maxatm=$QMMM_GAMESS_MAXMM:g" \ |
381 |
+ -i tinker/sizes.i \ |
382 |
+ || die "Setting QMMM_GAMESS_MAXMM failed" |
383 |
+ sed -e "s:MAXATM=1000:MAXATM=$QMMM_GAMESS_MAXMM:g" \ |
384 |
+ -i source/inputb.src \ |
385 |
+ || die "Setting QMMM_GAMESS_MAXMM failed" |
386 |
+ fi |
387 |
+ if [ "x$QMMM_GAMESS_MAXCLASS" == "x" ]; then |
388 |
+ einfo "No QMMM_GAMESS_MAXMM set. Using default value = 250" |
389 |
+ else |
390 |
+ sed -e "s:maxclass=250:maxclass=$QMMM_GAMESS_MAXCLASS:g" \ |
391 |
+ -i tinker/sizes.i \ |
392 |
+ || die "Setting QMMM_GAMESS_MAXCLASS failed" |
393 |
+ fi |
394 |
+ if [ "x$QMMM_GAMESS_MAXCTYP" == "x" ]; then |
395 |
+ einfo "No QMMM_GAMESS_MAXCTYP set. Using default value = 500" |
396 |
+ else |
397 |
+ sed -e "s:maxtyp=500:maxtyp=$QMMM_GAMESS_MAXCTYP:g" \ |
398 |
+ -i tinker/sizes.i \ |
399 |
+ || die "Setting QMMM_GAMESS_MAXCTYP failed" |
400 |
+ fi |
401 |
+ if [ "x$QMMM_GAMESS_MAXHESS" == "x" ]; then |
402 |
+ einfo "No QMMM_GAMESS_MAXHESS set. Usingdefault value = 1000000" |
403 |
+ else |
404 |
+ sed -e "s:maxhess=1000000:maxhess=$QMMM_GAMESS_MAXHESS:g" \ |
405 |
+ -i tinker/sizes.i \ |
406 |
+ || die "Setting QMMM_GAMESS_MAXHESS failed" |
407 |
+ fi |
408 |
+ fi |
409 |
+ # create proper activate sourcefile |
410 |
+ cp "./tools/actvte.code" "./tools/actvte.f" || \ |
411 |
+ die "Failed to create actvte.f" |
412 |
+ sed -e "s/^\*UNX/ /" -i "./tools/actvte.f" || \ |
413 |
+ die "Failed to perform UNX substitutions in actvte.f" |
414 |
+ |
415 |
+ # fix GAMESS' compall script to use proper CC |
416 |
+ sed -e "s|\$CCOMP -c \$extraflags source/zunix.c|$(tc-getCC) -c \$extraflags source/zunix.c|" \ |
417 |
+ -i compall || die "Failed setting up compall script" |
418 |
+ |
419 |
+ # insert proper FFLAGS into GAMESS' comp makefile |
420 |
+ # in case we're using ifc let's strip all the gcc |
421 |
+ # specific stuff |
422 |
+ if [[ ${FCOMP} == "ifort" ]]; then |
423 |
+ sed -e "s/gentoo-OPT = '-O2'/OPT = '${FFLAGS} -quiet'/" \ |
424 |
+ -i comp || die "Failed setting up comp script" |
425 |
+ elif ! use x86; then |
426 |
+ sed -e "s/-malign-double //" \ |
427 |
+ -e "s/gentoo-OPT='-O2'/OPT='${FFLAGS}'/" \ |
428 |
+ -i comp || die "Failed setting up comp script" |
429 |
+ else |
430 |
+ sed -e "s/gentoo-OPT = '-O2'/OPT = '${FFLAGS}'/" \ |
431 |
+ -i comp || die "Failed setting up comp script" |
432 |
+ fi |
433 |
+ |
434 |
+ # fix up GAMESS' linker script; |
435 |
+ sed -e "s/gentoo-LDOPTS=' '/LDOPTS='${LDFLAGS}'/" \ |
436 |
+ -i lked || die "Failed setting up lked script" |
437 |
+ # fix up GAMESS' ddi TCP/IP socket build |
438 |
+ sed -e "s/gentoo-CC = 'gcc'/CC = '$(tc-getCC)'/" \ |
439 |
+ -i ddi/compddi || die "Failed setting up compddi script" |
440 |
+ # Creating install.info |
441 |
+ cat > install.info <<-EOF |
442 |
+ #!/bin/csh |
443 |
+ setenv GMS_PATH $WORKDIR/gamess |
444 |
+ setenv GMS_BUILD_DIR $WORKDIR/gamess |
445 |
+ setenv GMS_TARGET $active_arch |
446 |
+ setenv GMS_FORTRAN $FCOMP |
447 |
+ setenv GMS_GFORTRAN_VERNO $(gcc-major-version).$(gcc-minor-version) |
448 |
+ setenv GMS_MATHLIB atlas |
449 |
+ setenv GMS_MATHLIB_PATH /usr/$(get_libdir)/atlas |
450 |
+ setenv GMS_DDI_COMM sockets |
451 |
+ EOF |
452 |
+ |
453 |
+} |
454 |
+ |
455 |
+src_compile() { |
456 |
+ # build actvte |
457 |
+ cd "${S}"/tools |
458 |
+ ${FCOMP} -o actvte.x actvte.f || \ |
459 |
+ die "Failed to compile actvte.x" |
460 |
+ |
461 |
+ # for hardened (PAX) users and ifc we need to turn |
462 |
+ # MPROTECT off |
463 |
+ if [[ ${FCOMP} == "ifort" ]] && use pax_kernel; then |
464 |
+ pax-mark -PemRxS actvte.x |
465 |
+ fi |
466 |
+ |
467 |
+ # build gamess |
468 |
+ cd "${S}" |
469 |
+ ./compall || die "compall failed" |
470 |
+ |
471 |
+ # build the ddi TCP/IP socket stuff |
472 |
+ cd ${S}/"ddi" |
473 |
+ ./compddi || die "compddi failed" |
474 |
+ |
475 |
+ # finally, link it all together |
476 |
+ cd "${S}" |
477 |
+ ./lked || die "lked failed" |
478 |
+ |
479 |
+ # for hardened (PAX) users and ifc we need to turn |
480 |
+ # MPROTECT off |
481 |
+ if [[ ${FCOMP} == "ifort" ]] && use pax_kernel; then |
482 |
+ pax-mark -PemRxS ${PN}.00.x |
483 |
+ fi |
484 |
+} |
485 |
+ |
486 |
+src_install() { |
487 |
+ # the executables |
488 |
+ dobin ${PN}.00.x rungms gms-files.csh \ |
489 |
+ || die "Failed installing binaries" |
490 |
+ if use !mpi; then |
491 |
+ dobin ddi/ddikick.x \ |
492 |
+ || die "Failed installing binaries" |
493 |
+ fi |
494 |
+ |
495 |
+ # the docs |
496 |
+ dodoc *.DOC qmnuc/*.DOC |
497 |
+ |
498 |
+ # install ericftm |
499 |
+ insinto /usr/share/${PN} |
500 |
+ doins auxdata/ericfmt.dat |
501 |
+ |
502 |
+ # install mcpdata |
503 |
+ insinto /usr/share/${PN}/MCP |
504 |
+ doins auxdata/MCP/* |
505 |
+ |
506 |
+ # install BASES |
507 |
+ insinto /usr/share/${PN}/BASES |
508 |
+ doins auxdata/BASES/* |
509 |
+ |
510 |
+ # install QUANPOL |
511 |
+ insinto /usr/share/${PN}/QUANPOL |
512 |
+ doins auxdata/QUANPOL/* |
513 |
+ |
514 |
+ # install tinker params in case of qmmm |
515 |
+ if use qmmm-tinker ; then |
516 |
+ dodoc tinker/simomm.doc |
517 |
+ insinto /usr/share/${PN} |
518 |
+ doins -r tinker/params51 |
519 |
+ fi |
520 |
+ |
521 |
+ # install the tests the user should run, and |
522 |
+ # fix up the runscript; also grab a copy of rungms |
523 |
+ # so the user is ready to run the tests |
524 |
+ insinto /usr/share/${PN}/tests |
525 |
+ insopts -m0644 |
526 |
+ doins -r tests/* |
527 |
+ insopts -m0744 |
528 |
+ doins runall |
529 |
+ #doins tools/checktst/checktst tools/checktst/chkabs || \ |
530 |
+ # die "Failed to install main test checker" |
531 |
+ #doins tools/checktst/exam* || \ |
532 |
+ # die "Failed to install individual test files" |
533 |
+ |
534 |
+ insinto /usr/share/${PN}/neotests |
535 |
+ insopts -m0644 |
536 |
+ doins -r qmnuc/neotests/* |
537 |
+} |
538 |
+ |
539 |
+pkg_postinst() { |
540 |
+ echo |
541 |
+ einfo "Before you use GAMESS for any serious work you HAVE" |
542 |
+ einfo "to run the supplied test files located in" |
543 |
+ einfo "/usr/share/gamess/tests and check them thoroughly." |
544 |
+ einfo "Otherwise all scientific publications resulting from" |
545 |
+ einfo "your GAMESS runs should be immediately rejected :)" |
546 |
+ einfo "To do so copy the content of /usr/share/gamess/tests" |
547 |
+ einfo "to some temporary location and execute './runall'. " |
548 |
+ einfo "Then run the checktst script in the same directory to" |
549 |
+ einfo "validate the tests." |
550 |
+ einfo "Please consult TEST.DOC and the other docs!" |
551 |
+ |
552 |
+ if [[ ${FCOMP} == "ifort" ]]; then |
553 |
+ echo |
554 |
+ ewarn "IMPORTANT NOTE: We STRONGLY recommend to stay away" |
555 |
+ ewarn "from ifc-9.0 for now and use the ifc-8.1 series of" |
556 |
+ ewarn "compilers UNLESS you can run through ALL of the " |
557 |
+ ewarn "test cases (see above) successfully." |
558 |
+ fi |
559 |
+ |
560 |
+ echo |
561 |
+ einfo "If you want to run on more than a single CPU" |
562 |
+ einfo "you will have to acquaint yourself with the way GAMESS" |
563 |
+ einfo "does multiprocessor runs and adjust rungms according to" |
564 |
+ einfo "your target network architecture." |
565 |
+ echo |
566 |
+} |