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/gromacs: gromacs-4.0.7-r4.ebuild ChangeLog gromacs-4.0.7-r5.ebuild gromacs-4.5.3.ebuild gromacs-4.5.1.ebuild gromacs-4.0.4.ebuild gromacs-4.0.5.ebuild
Date: Thu, 25 Nov 2010 13:09:04
Message-Id: 20101125130858.EDDAB20051@flycatcher.gentoo.org
1 alexxy 10/11/25 13:08:58
2
3 Modified: gromacs-4.0.7-r4.ebuild ChangeLog
4 Added: gromacs-4.0.7-r5.ebuild gromacs-4.5.3.ebuild
5 Removed: gromacs-4.5.1.ebuild gromacs-4.0.4.ebuild
6 gromacs-4.0.5.ebuild
7 Log:
8 [sci-chemistry/gromacs] Version bump. Clean up old versions. Thanks to Christoph Junghans
9
10 (Portage version: 2.2.0_alpha5_p2/cvs/Linux x86_64)
11
12 Revision Changes Path
13 1.9 sci-chemistry/gromacs/gromacs-4.0.7-r4.ebuild
14
15 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gromacs/gromacs-4.0.7-r4.ebuild?rev=1.9&view=markup
16 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gromacs/gromacs-4.0.7-r4.ebuild?rev=1.9&content-type=text/plain
17 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gromacs/gromacs-4.0.7-r4.ebuild?r1=1.8&r2=1.9
18
19 Index: gromacs-4.0.7-r4.ebuild
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/sci-chemistry/gromacs/gromacs-4.0.7-r4.ebuild,v
22 retrieving revision 1.8
23 retrieving revision 1.9
24 diff -u -r1.8 -r1.9
25 --- gromacs-4.0.7-r4.ebuild 25 Oct 2010 08:53:31 -0000 1.8
26 +++ gromacs-4.0.7-r4.ebuild 25 Nov 2010 13:08:58 -0000 1.9
27 @@ -1,6 +1,6 @@
28 # Copyright 1999-2010 Gentoo Foundation
29 # Distributed under the terms of the GNU General Public License v2
30 -# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/gromacs/gromacs-4.0.7-r4.ebuild,v 1.8 2010/10/25 08:53:31 ssuominen Exp $
31 +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/gromacs/gromacs-4.0.7-r4.ebuild,v 1.9 2010/11/25 13:08:58 alexxy Exp $
32
33 EAPI="3"
34
35 @@ -14,7 +14,7 @@
36 SRC_URI="ftp://ftp.gromacs.org/pub/${PN}/${P}.tar.gz
37 mirror://gentoo/${P}_upstream2010-06-08.patch.gz
38 test? ( ftp://ftp.gromacs.org/pub/tests/gmxtest-${TEST_PV}.tgz )
39 - doc? ( ftp://ftp.gromacs.org/pub/manual/manual-4.0.pdf )
40 + doc? ( ftp://ftp.gromacs.org/pub/manual/manual-4.0.pdf -> gromacs-manual-4.0.pdf )
41 ffamber? ( http://ffamber.cnsm.csulb.edu/ffamber_v4.0-doc.tar.gz )"
42
43 LICENSE="GPL-2"
44
45
46
47 1.62 sci-chemistry/gromacs/ChangeLog
48
49 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gromacs/ChangeLog?rev=1.62&view=markup
50 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gromacs/ChangeLog?rev=1.62&content-type=text/plain
51 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gromacs/ChangeLog?r1=1.61&r2=1.62
52
53 Index: ChangeLog
54 ===================================================================
55 RCS file: /var/cvsroot/gentoo-x86/sci-chemistry/gromacs/ChangeLog,v
56 retrieving revision 1.61
57 retrieving revision 1.62
58 diff -u -r1.61 -r1.62
59 --- ChangeLog 25 Oct 2010 08:53:31 -0000 1.61
60 +++ ChangeLog 25 Nov 2010 13:08:58 -0000 1.62
61 @@ -1,6 +1,18 @@
62 # ChangeLog for sci-chemistry/gromacs
63 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
64 -# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/gromacs/ChangeLog,v 1.61 2010/10/25 08:53:31 ssuominen Exp $
65 +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/gromacs/ChangeLog,v 1.62 2010/11/25 13:08:58 alexxy Exp $
66 +
67 +*gromacs-4.5.3 (25 Nov 2010)
68 +*gromacs-4.0.7-r5 (25 Nov 2010)
69 +
70 + 25 Nov 2010; Alexey Shvetsov <alexxy@g.o> -gromacs-4.0.4.ebuild,
71 + -files/gromacs-4.0.4-configure-gfortran.patch,
72 + -files/gromacs-4.0.4-sparc-cyclecounter.patch, -gromacs-4.0.5.ebuild,
73 + gromacs-4.0.7-r4.ebuild, +gromacs-4.0.7-r5.ebuild,
74 + -files/gromacs-4.0.9999-ccache.patch,
75 + -files/gromacs-4.0.9999-configure-gfortran.patch, -gromacs-4.5.1.ebuild,
76 + +gromacs-4.5.3.ebuild:
77 + Version bump. Clean up old versions. Thanks to Christoph Junghans
78
79 25 Oct 2010; Samuli Suominen <ssuominen@g.o>
80 gromacs-4.0.7-r4.ebuild:
81
82
83
84 1.1 sci-chemistry/gromacs/gromacs-4.0.7-r5.ebuild
85
86 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gromacs/gromacs-4.0.7-r5.ebuild?rev=1.1&view=markup
87 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gromacs/gromacs-4.0.7-r5.ebuild?rev=1.1&content-type=text/plain
88
89 Index: gromacs-4.0.7-r5.ebuild
90 ===================================================================
91 # Copyright 1999-2010 Gentoo Foundation
92 # Distributed under the terms of the GNU General Public License v2
93 # $Header: /var/cvsroot/gentoo-x86/sci-chemistry/gromacs/gromacs-4.0.7-r5.ebuild,v 1.1 2010/11/25 13:08:58 alexxy Exp $
94
95 EAPI="3"
96
97 LIBTOOLIZE="true"
98 TEST_PV="4.0.4"
99
100 inherit autotools bash-completion eutils fortran multilib toolchain-funcs
101
102 DESCRIPTION="The ultimate molecular dynamics simulation package"
103 HOMEPAGE="http://www.gromacs.org/"
104 SRC_URI="ftp://ftp.gromacs.org/pub/${PN}/${P}.tar.gz
105 mirror://gentoo/${P}_upstream2010-09-15.patch.bz2
106 mirror://gentoo/${P}_missing_distfiles.patch.bz2
107 test? ( ftp://ftp.gromacs.org/pub/tests/gmxtest-${TEST_PV}.tgz )
108 doc? ( ftp://ftp.gromacs.org/pub/manual/manual-4.0.pdf -> gromacs-manual-4.0.pdf )
109 ffamber? ( http://ffamber.cnsm.csulb.edu/ffamber_v4.0-doc.tar.gz )"
110
111 LICENSE="GPL-2"
112 SLOT="0"
113 KEYWORDS="~alpha ~amd64 ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
114 IUSE="X blas dmalloc doc -double-precision ffamber +fftw fkernels +gsl lapack
115 mpi +single-precision static static-libs test +xml zsh-completion"
116
117 DEPEND="app-shells/tcsh
118 X? ( x11-libs/libX11
119 x11-libs/libSM
120 x11-libs/libICE )
121 dmalloc? ( dev-libs/dmalloc )
122 blas? ( virtual/blas )
123 fftw? ( sci-libs/fftw:3.0 )
124 gsl? ( sci-libs/gsl )
125 lapack? ( virtual/lapack )
126 mpi? ( virtual/mpi )
127 xml? ( dev-libs/libxml2 )"
128
129 RDEPEND="${DEPEND}"
130
131 RESTRICT="test"
132
133 QA_EXECSTACK="usr/lib/libgmx.so.*
134 usr/lib/libgmx_d.so.*"
135
136 use static && QA_EXECSTACK="$QA_EXECSTACK usr/bin/*"
137
138 pkg_setup() {
139 if use fkernels; then
140 FORTRAN="g77 gfortran ifc"
141 fortran_pkg_setup
142 else
143 FORTRANC=""
144 fi
145 }
146
147 src_prepare() {
148
149 ( use single-precision || use double-precision ) || \
150 die "Nothing to compile, enable single-precision and/or double-precision"
151
152 if use static; then
153 use X && die "You cannot compile a static version with X support, disable X or static"
154 use xml && die "You cannot compile a static version with xml support
155 (see bug #306479), disable xml or static"
156 fi
157
158 epatch "${WORKDIR}/${P}_upstream2010-09-15.patch"
159 epatch "${WORKDIR}/${P}_missing_distfiles.patch"
160 sed -e '/AC_INIT/s/4\.0\.7/&-2010-09-15/' -i configure.ac \
161 || die "Failed to change version in configure.ac"
162
163 # Fix typos in a couple of files.
164 sed -e "s:+0f:-f:" -i share/tutor/gmxdemo/demo \
165 || die "Failed to fixup demo script."
166
167 epatch_user
168 eautoreconf
169 GMX_DIRS=""
170 use single-precision && GMX_DIRS+=" single"
171 use double-precision && GMX_DIRS+=" double"
172 for x in ${GMX_DIRS}; do
173 mkdir "${S}-${x}" || die
174 use test && cp -r "${WORKDIR}"/gmxtest "${S}-${x}"
175 use mpi || continue
176 mkdir "${S}-${x}_mpi" || die
177 done
178 }
179
180 src_configure() {
181 local myconf
182 local myconfsingle
183 local myconfdouble
184 local suffixdouble
185
186 #leave all assembly options enabled mdrun is smart enough to deside itself
187 #there so no gentoo on bluegene!
188 myconf="${myconf} --disable-bluegene"
189
190 #from gromacs configure
191 if ! use fftw; then
192 ewarn "WARNING: The built-in FFTPACK routines are slow."
193 ewarn "Are you sure you don\'t want to use FFTW?"
194 ewarn "It is free and much faster..."
195 fi
196
197 if [[ $(gcc-version) == "4.1" ]]; then
198 eerror "gcc 4.1 is not supported by gromacs"
199 eerror "please run test suite"
200 die
201 fi
202
203 #note for gentoo-PREFIX on apple: use --enable-apple-64bit
204
205 #fortran will gone in gromacs 4.1 anyway
206 #note for gentoo-PREFIX on aix, fortran (xlf) is still much faster
207 if use fkernels; then
208 ewarn "Fortran kernels are usually not faster than C kernels and assembly"
209 ewarn "I hope, you know what are you doing..."
210 myconf="${myconf} --enable-fortran"
211 else
212 myconf="${myconf} --disable-fortran"
213 fi
214
215 # if we need external blas
216 if use blas; then
217 export LIBS="${LIBS} -lblas"
218 myconf="${myconf} $(use_with blas external-blas)"
219 fi
220
221 # if we need external lapack
222 if use lapack; then
223 export LIBS="${LIBS} -llapack"
224 myconf="${myconf} $(use_with lapack external-lapack)"
225 fi
226
227 # by default its better to have dynamicaly linked binaries
228 if use static; then
229 #gmx build static libs by default
230 myconf="${myconf} --disable-shared $(use_enable static all-static)"
231 else
232 myconf="${myconf} --disable-all-static --enable-shared $(use_enable static-libs static)"
233 fi
234
235 myconf="--datadir="${EPREFIX}"/usr/share \
236 --bindir="${EPREFIX}"/usr/bin \
237 --libdir="${EPREFIX}"/usr/$(get_libdir) \
238 --docdir="${EPREFIX}"/usr/share/doc/"${PF}" \
239 $(use_with dmalloc) \
240 $(use_with fftw fft fftw3) \
241 $(use_with gsl) \
242 $(use_with X x) \
243 $(use_with xml) \
244 ${myconf}"
245
246 #if we build single and double - double is suffixed
247 if ( use double-precision && use single-precision ); then
248 suffixdouble="_d"
249 else
250 suffixdouble=""
251 fi
252
253 if use double-precision ; then
254 #from gromacs manual
255 elog
256 elog "For most simulations single precision is accurate enough. In some"
257 elog "cases double precision is required to get reasonable results:"
258 elog
259 elog "-normal mode analysis, for the conjugate gradient or l-bfgs minimization"
260 elog " and the calculation and diagonalization of the Hessian "
261 elog "-calculation of the constraint force between two large groups of atoms"
262 elog "-energy conservation: this can only be done without temperature coupling and"
263 elog " without cutoffs"
264 elog
265 fi
266
267 if use mpi ; then
268 elog "You have enabled mpi, only mdrun will make use of mpi, that is why"
269 elog "we configure/compile gromacs twice (with and without mpi) and only"
270 elog "install mdrun with mpi support. In addtion you will get libgmx and"
271 elog "libmd with and without mpi support."
272 fi
273
274 myconfdouble="${myconf} --enable-double --program-suffix='${suffixdouble}'"
275 myconfsingle="${myconf} --enable-float --program-suffix=''"
276 for x in ${GMX_DIRS}; do
277 einfo "Configuring for ${x} precision"
278 cd "${S}-${x}"
279 local p=myconf${x}
280 ECONF_SOURCE="${S}" econf ${!p} --disable-mpi CC="$(tc-getCC)" F77="${FORTRANC}"
281 use mpi || continue
282 cd "${S}-${x}_mpi"
283 ECONF_SOURCE="${S}" econf ${!p} --enable-mpi CC="$(tc-getCC)" F77="${FORTRANC}"
284 done
285 }
286
287 src_compile() {
288 for x in ${GMX_DIRS}; do
289 cd "${S}-${x}"
290 einfo "Compiling for ${x} precision"
291 emake || die "emake for ${x} precision failed"
292 use mpi || continue
293 cd "${S}-${x}_mpi"
294 emake mdrun || die "emake mdrun for ${x} precision failed"
295 done
296 }
297
298 src_test() {
299 for x in ${GMX_DIRS}; do
300 local oldpath="${PATH}"
301 export PATH="${S}-${x}/src/kernel:${S}-{x}/src/tools:${PATH}"
302 cd "${S}-${x}"
303 emake -j1 tests || die "${x} Precision test failed"
304 export PATH="${oldpath}"
305 done
306 }
307
308 src_install() {
309 for x in ${GMX_DIRS}; do
310 cd "${S}-${x}"
311 emake DESTDIR="${D}" install || die "emake install for ${x} failed"
312 use mpi || continue
313 cd "${S}-${x}_mpi"
314 emake DESTDIR="${D}" install-mdrun || die "emake install-mdrun for ${x} failed"
315 done
316 #we have pkg-config files
317 rm "${ED}"/usr/$(get_libdir)/*.la
318
319 sed -n -e '/^GMXBIN/,/^GMXDATA/p' "${ED}"/usr/bin/GMXRC.bash > "${T}/80gromacs"
320 doenvd "${T}/80gromacs"
321 rm -f "${ED}"/usr/bin/GMXRC*
322
323 dobashcompletion "${ED}"/usr/bin/completion.bash ${PN}
324 if use zsh-completion ; then
325 insinto /usr/share/zsh/site-functions
326 newins "${ED}"/usr/bin/completion.zsh _${PN}
327 fi
328 rm -f "${ED}"/usr/bin/completion.*
329
330 cd "${S}"
331 dodoc AUTHORS INSTALL README
332 if use doc; then
333 newdoc "${DISTDIR}/gromacs-manual-4.0.pdf" "manual-4.0.pdf"
334 dohtml -r "${ED}usr/share/gromacs/html/"
335 fi
336 rm -rf "${ED}usr/share/gromacs/html/"
337
338 if use ffamber; then
339 use doc && dodoc "${WORKDIR}/ffamber_v4.0/README/pdfs/*.pdf"
340 # prepare vdwradii.dat
341 cat >>"${ED}"/usr/share/gromacs/top/vdwradii.dat <<-EOF
342 SOL MW 0
343 SOL LP 0
344 EOF
345 # regenerate aminoacids.dat
346 cat "${WORKDIR}"/ffamber_v4.0/aminoacids*.dat \
347 "${ED}"/usr/share/gromacs/top/aminoacids.dat \
348 | awk '{print $1}' | sort -u | tail -n+4 | wc -l \
349 >> "${ED}"/usr/share/gromacs/top/aminoacids.dat.new
350 cat "${WORKDIR}"/ffamber_v4.0/aminoacids*.dat \
351 "${ED}"/usr/share/gromacs/top/aminoacids.dat \
352 | awk '{print $1}' | sort -u | tail -n+4 \
353 >> "${ED}"/usr/share/gromacs/top/aminoacids.dat.new
354 mv -f "${ED}"/usr/share/gromacs/top/aminoacids.dat.new \
355 "${ED}"/usr/share/gromacs/top/aminoacids.dat
356 # copy ff files
357 for x in ffamber94 ffamber96 ffamber99 ffamber99p ffamber99sb \
358 ffamberGS ffamberGSs ffamber03 ; do
359 einfo "Adding ${x} to gromacs"
360 cp "${WORKDIR}"/ffamber_v4.0/${x}/* "${ED}"/usr/share/gromacs/top
361 done
362 # copy suplementary files
363 cp "${WORKDIR}"/ffamber_v4.0/*.gro "${ED}"/usr/share/gromacs/top
364 cp "${WORKDIR}"/ffamber_v4.0/*.itp "${ED}"/usr/share/gromacs/top
365 # actualy add records to FF.dat
366 cat >>"${ED}"/usr/share/gromacs/top/FF.dat.new <<-EOF
367 ffamber94 AMBER94 Cornell protein/nucleic forcefield
368 ffamber96 AMBER96 Kollman protein/nucleic forcefield
369 ffamberGS AMBER-GS Garcia & Sanbonmatsu forcefield
370 ffamberGSs AMBER-GSs Nymeyer & Garcia forcefield
371 ffamber99 AMBER99 Wang protein/nucleic acid forcefield
372 ffamber99p AMBER99p protein/nucleic forcefield
373 ffamber99sb AMBER99sb Hornak protein/nucleic forcefield
374 ffamber03 AMBER03 Duan protein/nucleic forcefield
375 EOF
376 cat "${ED}"/usr/share/gromacs/top/FF.dat \
377 "${ED}"/usr/share/gromacs/top/FF.dat.new \
378 | tail -n+2 > "${ED}"/usr/share/gromacs/top/FF.dat.new2
379 cat "${ED}"/usr/share/gromacs/top/FF.dat.new2 | wc -l > \
380 "${ED}"/usr/share/gromacs/top/FF.dat
381 cat "${ED}"/usr/share/gromacs/top/FF.dat.new2 >> \
382 "${ED}"/usr/share/gromacs/top/FF.dat
383 rm -f "${ED}"/usr/share/gromacs/top/FF.dat.new*
384 fi
385 }
386
387 pkg_postinst() {
388 env-update && source /etc/profile
389 elog
390 elog "Please read and cite:"
391 elog "Gromacs 4, J. Chem. Theory Comput. 4, 435 (2008). "
392 elog "http://dx.doi.org/10.1021/ct700301q"
393 elog
394 bash-completion_pkg_postinst
395 elog
396 elog $(luck)
397 elog "For more Gromacs cool quotes (gcq) add luck to your .bashrc"
398 elog
399 }
400
401
402
403 1.1 sci-chemistry/gromacs/gromacs-4.5.3.ebuild
404
405 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gromacs/gromacs-4.5.3.ebuild?rev=1.1&view=markup
406 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-chemistry/gromacs/gromacs-4.5.3.ebuild?rev=1.1&content-type=text/plain
407
408 Index: gromacs-4.5.3.ebuild
409 ===================================================================
410 # Copyright 1999-2010 Gentoo Foundation
411 # Distributed under the terms of the GNU General Public License v2
412 # $Header: /var/cvsroot/gentoo-x86/sci-chemistry/gromacs/gromacs-4.5.3.ebuild,v 1.1 2010/11/25 13:08:58 alexxy Exp $
413
414 EAPI="3"
415
416 LIBTOOLIZE="true"
417 TEST_PV="4.0.4"
418 MANUAL_PV="4.5.3"
419
420 inherit autotools bash-completion eutils fortran multilib toolchain-funcs
421
422 DESCRIPTION="The ultimate molecular dynamics simulation package"
423 HOMEPAGE="http://www.gromacs.org/"
424 SRC_URI="ftp://ftp.gromacs.org/pub/${PN}/${P}.tar.gz
425 test? ( ftp://ftp.gromacs.org/pub/tests/gmxtest-${TEST_PV}.tgz )
426 doc? ( http://www.gromacs.org/@api/deki/files/133/=manual-${MANUAL_PV}.pdf -> gromacs-manual-${MANUAL_PV}.pdf )"
427
428 LICENSE="GPL-2"
429 SLOT="0"
430 KEYWORDS="~alpha ~amd64 ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
431 IUSE="X blas dmalloc doc -double-precision +fftw fkernels +gsl lapack
432 mpi +single-precision static static-libs test +threads +xml zsh-completion"
433
434 DEPEND="app-shells/tcsh
435 X? ( x11-libs/libX11
436 x11-libs/libSM
437 x11-libs/libICE )
438 dmalloc? ( dev-libs/dmalloc )
439 blas? ( virtual/blas )
440 fftw? ( sci-libs/fftw:3.0 )
441 gsl? ( sci-libs/gsl )
442 lapack? ( virtual/lapack )
443 mpi? ( virtual/mpi )
444 xml? ( dev-libs/libxml2 )"
445
446 RDEPEND="${DEPEND}"
447
448 RESTRICT="test"
449
450 QA_EXECSTACK="usr/lib/libgmx.so.*
451 usr/lib/libgmx_d.so.*"
452
453 use static && QA_EXECSTACK="$QA_EXECSTACK usr/bin/*"
454
455 pkg_setup() {
456 if use fkernels; then
457 FORTRAN="g77 gfortran ifc"
458 fortran_pkg_setup
459 else
460 FORTRANC=""
461 fi
462 }
463
464 src_prepare() {
465
466 ( use single-precision || use double-precision ) || \
467 die "Nothing to compile, enable single-precision and/or double-precision"
468
469 if use mpi && use threads; then
470 elog "mdrun uses only threads OR mpi, and gromacs favours the"
471 elog "use of mpi over threads, so a mpi-version of mdrun will"
472 elog "be compiled. If you want to run mdrun on shared memory"
473 elog "machines only, you can safely disable mpi"
474 fi
475
476 if use static; then
477 use X && die "You cannot compile a static version with X support, disable X or static"
478 use xml && die "You cannot compile a static version with xml support
479 (see bug #306479), disable xml or static"
480 fi
481 epatch_user
482 eautoreconf
483 GMX_DIRS=""
484 use single-precision && GMX_DIRS+=" single"
485 use double-precision && GMX_DIRS+=" double"
486 for x in ${GMX_DIRS}; do
487 mkdir "${S}-${x}" || die
488 use test && cp -r "${WORKDIR}"/gmxtest "${S}-${x}"
489 use mpi || continue
490 mkdir "${S}-${x}_mpi" || die
491 done
492 }
493
494 src_configure() {
495 local myconf
496 local myconfsingle
497 local myconfdouble
498 local suffixdouble
499
500 #leave all assembly options enabled mdrun is smart enough to deside itself
501 #there so no gentoo on bluegene!
502 myconf="${myconf} --disable-bluegene"
503
504 #we have pkg-config files
505 myconf="${myconf} --disable-la-files"
506
507 #from gromacs configure
508 if ! use fftw; then
509 ewarn "WARNING: The built-in FFTPACK routines are slow."
510 ewarn "Are you sure you don\'t want to use FFTW?"
511 ewarn "It is free and much faster..."
512 fi
513
514 if [[ $(gcc-version) == "4.1" ]]; then
515 eerror "gcc 4.1 is not supported by gromacs"
516 eerror "please run test suite"
517 die
518 fi
519
520 #note for gentoo-PREFIX on apple: use --enable-apple-64bit
521
522 #fortran will gone in gromacs 4.1 anyway
523 #note for gentoo-PREFIX on aix, fortran (xlf) is still much faster
524 if use fkernels; then
525 use threads && die "You cannot compile fortran kernel with threads"
526 ewarn "Fortran kernels are usually not faster than C kernels and assembly"
527 ewarn "I hope, you know what are you doing..."
528 myconf="${myconf} --enable-fortran"
529 else
530 myconf="${myconf} --disable-fortran"
531 fi
532
533 # if we need external blas
534 if use blas; then
535 export LIBS="${LIBS} -lblas"
536 myconf="${myconf} $(use_with blas external-blas)"
537 fi
538
539 # if we need external lapack
540 if use lapack; then
541 export LIBS="${LIBS} -llapack"
542 myconf="${myconf} $(use_with lapack external-lapack)"
543 fi
544
545 # by default its better to have dynamicaly linked binaries
546 if use static; then
547 #gmx build static libs by default
548 myconf="${myconf} --disable-shared $(use_enable static all-static)"
549 else
550 myconf="${myconf} --disable-all-static --enable-shared $(use_enable static-libs static)"
551 fi
552
553 myconf="--datadir="${EPREFIX}"/usr/share \
554 --bindir="${EPREFIX}"/usr/bin \
555 --libdir="${EPREFIX}"/usr/$(get_libdir) \
556 --docdir="${EPREFIX}"/usr/share/doc/"${PF}" \
557 $(use_with dmalloc) \
558 $(use_with fftw fft fftw3) \
559 $(use_with gsl) \
560 $(use_with X x) \
561 $(use_with xml) \
562 $(use_enable threads) \
563 ${myconf}"
564
565 #if we build single and double - double is suffixed
566 if ( use double-precision && use single-precision ); then
567 suffixdouble="_d"
568 else
569 suffixdouble=""
570 fi
571
572 if use double-precision ; then
573 #from gromacs manual
574 elog
575 elog "For most simulations single precision is accurate enough. In some"
576 elog "cases double precision is required to get reasonable results:"
577 elog
578 elog "-normal mode analysis, for the conjugate gradient or l-bfgs minimization"
579 elog " and the calculation and diagonalization of the Hessian "
580 elog "-calculation of the constraint force between two large groups of atoms"
581 elog "-energy conservation: this can only be done without temperature coupling and"
582 elog " without cutoffs"
583 elog
584 fi
585
586 if use mpi ; then
587 elog "You have enabled mpi, only mdrun will make use of mpi, that is why"
588 elog "we configure/compile gromacs twice (with and without mpi) and only"
589 elog "install mdrun with mpi support. In addtion you will get libgmx and"
590 elog "libmd with and without mpi support."
591 fi
592
593 myconfdouble="${myconf} --enable-double --program-suffix='${suffixdouble}'"
594 myconfsingle="${myconf} --enable-float --program-suffix=''"
595 for x in ${GMX_DIRS}; do
596 einfo "Configuring for ${x} precision"
597 cd "${S}-${x}"
598 local p=myconf${x}
599 ECONF_SOURCE="${S}" econf ${!p} --disable-mpi CC="$(tc-getCC)" F77="${FORTRANC}"
600 use mpi || continue
601 cd "${S}-${x}_mpi"
602 ECONF_SOURCE="${S}" econf ${!p} --enable-mpi CC="$(tc-getCC)" F77="${FORTRANC}"
603 done
604 }
605
606 src_compile() {
607 for x in ${GMX_DIRS}; do
608 cd "${S}-${x}"
609 einfo "Compiling for ${x} precision"
610 emake || die "emake for ${x} precision failed"
611 use mpi || continue
612 cd "${S}-${x}_mpi"
613 emake mdrun || die "emake mdrun for ${x} precision failed"
614 done
615 }
616
617 src_test() {
618 for x in ${GMX_DIRS}; do
619 local oldpath="${PATH}"
620 export PATH="${S}-${x}/src/kernel:${S}-{x}/src/tools:${PATH}"
621 cd "${S}-${x}"
622 emake -j1 tests || die "${x} Precision test failed"
623 export PATH="${oldpath}"
624 done
625 }
626
627 src_install() {
628 for x in ${GMX_DIRS}; do
629 cd "${S}-${x}"
630 emake DESTDIR="${D}" install || die "emake install for ${x} failed"
631 use mpi || continue
632 cd "${S}-${x}_mpi"
633 emake DESTDIR="${D}" install-mdrun || die "emake install-mdrun for ${x} failed"
634 done
635
636 sed -n -e '/^GMXBIN/,/^GMXDATA/p' "${ED}"/usr/bin/GMXRC.bash > "${T}/80gromacs"
637 echo "VMD_PLUGIN_PATH=${EPREFIX}/usr/$(get_libdir)/vmd/plugins/*/molfile/" >> "${T}/80gromacs"
638
639 doenvd "${T}/80gromacs"
640 rm -f "${ED}"/usr/bin/GMXRC*
641
642 dobashcompletion "${ED}"/usr/bin/completion.bash ${PN}
643 if use zsh-completion ; then
644 insinto /usr/share/zsh/site-functions
645 newins "${ED}"/usr/bin/completion.zsh _${PN}
646 fi
647 rm -f "${ED}"/usr/bin/completion.*
648
649 # Fix typos in a couple of files.
650 sed -e "s:+0f:-f:" -i "${ED}"usr/share/gromacs/tutor/gmxdemo/demo \
651 || die "Failed to fixup demo script."
652
653 cd "${S}"
654 dodoc AUTHORS INSTALL* README*
655 if use doc; then
656 newdoc "${DISTDIR}/gromacs-manual-${MANUAL_PV}.pdf" "manual-${MANUAL_PV}.pdf"
657 dohtml -r "${ED}usr/share/gromacs/html/"
658 fi
659 rm -rf "${ED}usr/share/gromacs/html/"
660 }
661
662 pkg_postinst() {
663 env-update && source /etc/profile
664 elog
665 elog "Please read and cite:"
666 elog "Gromacs 4, J. Chem. Theory Comput. 4, 435 (2008). "
667 elog "http://dx.doi.org/10.1021/ct700301q"
668 elog
669 bash-completion_pkg_postinst
670 elog
671 elog $(g_luck)
672 elog "For more Gromacs cool quotes (gcq) add luck to your .bashrc"
673 elog
674 elog "Gromacs can use sci-chemistry/vmd to read additional file formats"
675 elog
676 }