Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 118421 | Differences between
and this patch

Collapse All | Expand All

(-)gromacs-3.3.1.ebuild (-37 / +146 lines)
Lines 1-10 Link Here
1
# Copyright 1999-2006 Gentoo Foundation
1
# Copyright 1999-2006 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/gromacs/gromacs-3.3.1.ebuild,v 1.1 2006/08/08 02:54:41 markusle Exp $
3
# $Header: $
4
4
5
inherit eutils fortran
5
inherit eutils fortran multilib
6
6
7
IUSE="altivec mpi xml"
7
IUSE="3dnow X altivec double-precision mopac7 mpi sse sse2"
8
8
9
DESCRIPTION="The ultimate molecular dynamics simulation package"
9
DESCRIPTION="The ultimate molecular dynamics simulation package"
10
SRC_URI="ftp://ftp.gromacs.org/pub/${PN}/${P}.tar.gz"
10
SRC_URI="ftp://ftp.gromacs.org/pub/${PN}/${P}.tar.gz"
Lines 12-50 Link Here
12
12
13
LICENSE="GPL-2"
13
LICENSE="GPL-2"
14
SLOT="0"
14
SLOT="0"
15
KEYWORDS="~x86 ~amd64 ~ppc64"
15
KEYWORDS="~x86 ~amd64 ~sparc ~ppc64"
16
16
17
# gromacs uses fortran intrinsics such as RSHIFT that
17
DEPEND=">=sci-libs/fftw-3.0.1
18
# are currently missing from gfortran; hence we need
18
	mpi? ( >=sys-cluster/lam-mpi-7.0.6 )
19
# to require g77 for the time being (see bug #141672).
19
	>=sys-devel/binutils-2.12*
20
FORTRAN="g77"
21
22
23
#mpi is a local USE flag now
24
#May become official when situation with mpich is cleared (now the only mpi implementation awailable is lam-mpi)
25
DEPEND="=sci-libs/fftw-2.1*
26
	mpi? ( >=sys-cluster/lam-mpi-6.5.6 )
27
	>=sys-devel/binutils-2.10.91.0.2
28
	app-shells/tcsh
20
	app-shells/tcsh
29
	xml? ( dev-libs/libxml2 )"
21
	X? ( x11-libs/lesstif
30
22
		virtual/x11 )
23
	mopac7? ( sci-chemistry/mopac7 )
24
	sparc? ( =sys-devel/gcc-3* )"
31
pkg_setup() {
25
pkg_setup() {
32
	# !!!Please note!!!
26
	# !!!Please note!!!
33
	# for troublesome work gromacs should be compiled with the same mpi setting
27
	# for troublesome work gromacs should be compiled with the same mpi setting
34
	# as fftw.
28
	# as fftw.
35
	if use mpi; then
29
	if use mpi; then
36
		if ! built_with_use =sci-libs/fftw-2.1* mpi; then
30
		if ! built_with_use =sci-libs/fftw-3* mpi; then
37
			die "=sci-libs/fftw-2.1* must be built with USE=mpi."
31
			die "=sci-libs/fftw-3* must be built with USE=mpi."
38
		fi
32
		fi
39
	fi
33
	fi
40
34
41
	fortran_pkg_setup
42
}
35
}
43
36
44
src_unpack() {
37
src_unpack() {
38
45
	unpack ${A}
39
	unpack ${A}
46
	if use ppc64 && use altivec ; then
40
	if use ppc64 && use altivec ; then
47
		epatch ${FILESDIR}/${PN}-ppc64-altivec.patch
41
		epatch "${FILESDIR}"/${PN}-ppc64-altivec.patch
42
	fi
43
	cd "${S}"
44
45
# Fix a typo in a couple of files.
46
	sed -e "s:_nb_kerne010_x86_64_sse2:_nb_kernel010_x86_64_sse2:" \
47
		-i src/gmxlib/nonbonded/nb_kernel_x86_64_sse2/nb_kernel010_x86_64_sse2.intel_syntax.s \
48
		-i src/gmxlib/nonbonded/nb_kernel_x86_64_sse2/nb_kernel010_x86_64_sse2.s \
49
		|| die "Failed to fix sse2 typo."
50
51
# Fix a sandbox violation that occurs when re-emerging with mpi.
52
	sed "/libdir=\"\$(libdir)\"/ a\	temp_libdir=\"${D}usr/$( get_libdir )\" ; \\\\" \
53
	-i src/tools/Makefile.am \
54
	|| die "sed tools/Makefile.am failed"
55
56
	sed -e "s:\$\$libdir:\$temp_libdir:" \
57
	-i src/tools/Makefile.am \
58
	|| die "sed tools/Makefile.am failed"
59
60
	cd "${WORKDIR}" && mv ${P} ${P}-single ;
61
62
	use double-precision && cp -prP ${P}-single ${P}-double ;
63
64
	if use mpi ; then
65
		cp -prP ${P}-single ${P}-single-mpi
66
		use double-precision && cp -prP ${P}-double ${P}-double-mpi
48
	fi
67
	fi
49
}
68
}
50
69
Lines 54-81 Link Here
54
	# Static linking should try -lgcc instead of -lgcc_s.
73
	# Static linking should try -lgcc instead of -lgcc_s.
55
	# For more info:
74
	# For more info:
56
	# http://lists.debian.org/debian-gcc/2002/debian-gcc-200201/msg00150.html
75
	# http://lists.debian.org/debian-gcc/2002/debian-gcc-200201/msg00150.html
57
	econf \
76
58
		--enable-fortran \
77
# We will compile single precision by default, and suffix double-precision with _d.
59
		--datadir=/usr/share/${P} \
78
# Sparc is the only arch I can test on that needs to use fortran.
79
local myconf ;
80
81
case "${ARCH}" in
82
83
	x86)
84
			myconf="$myconf $(use_enable sse ia32-sse)"
85
			myconf="$myconf $(use_enable sse2 ia32-sse)"
86
			myconf="$myconf $(use_enable 3dnow ia32-3dnow)"
87
		;;
88
89
	amd64)
90
			myconf="$myconf --enable-x86-64-sse"
91
		;;
92
93
	ppc)
94
			if use altivec ; then
95
				myconf="$myconf --enable-ppc-altivec --disable-fortran"
96
			else
97
				myconf="$myconf --enable-fortran" && fortran_pkg_setup
98
			fi
99
		;;
100
101
	ppc64)
102
			if use altivec ; then
103
				myconf="$myconf --enable-ppc-altivec --disable-fortran"
104
			else
105
				myconf="$myconf --enable-fortran" && fortran_pkg_setup
106
			fi
107
		;;
108
109
	sparc)
110
			myconf="$myconf --enable-fortran" && fortran_pkg_setup
111
		;;
112
113
	ia64)
114
			myconf="$myconf --enable-ia64-asm"
115
		;;
116
117
	alpha)
118
			myconf="$myconf --enable-axp-asm"
119
		;;
120
121
esac
122
123
myconf="--enable-shared \
124
		--datadir=/usr/share \
60
		--bindir=/usr/bin \
125
		--bindir=/usr/bin \
61
		--libdir=/usr/lib \
126
		--libdir=/usr/$(get_libdir) \
62
		$(use_with xml) \
127
		--with-fft=fftw3 \
63
		$(use_enable mpi) \
128
		$(use_with X x) \
64
		$(use_enable altivec ppc-altivec) \
129
		$(use_enable mopac7) \
65
		$(use_enable alpha axp-asm) || die "configure failed"
130
		${myconf}"
131
132
cd "${WORKDIR}"/${P}-single
133
	econf ${myconf} --enable-float || die "configure single-precision failed"
134
135
	emake || die "emake single failed"
136
137
	if use mpi ; then
138
		cd "${WORKDIR}"/${P}-single-mpi
139
		econf ${myconf} --enable-float --enable-mpi --program-suffix=_mpi \
140
			|| die "failed to configure single-mpi mdrun"
141
		emake mdrun || die "failed to make single-precision mpi mdrun" ;
142
	fi
143
144
	if use double-precision ; then 
145
		cd "${WORKDIR}"/${P}-double 
66
146
67
#		$(use_enable static all-static) \
147
		econf ${myconf} --enable-double --program-suffix=_d \
148
			|| die "configure double-precision failed"
149
150
		emake || die "emake double failed"
151
152
		if use mpi ; then
153
			cd "${WORKDIR}"/${P}-double-mpi
154
			econf ${myconf} --enable-double --enable-mpi --program-suffix=_mpi_d \
155
				|| die "failed to configure double-mpi mdrun" ;
156
157
			emake mdrun \
158
				|| die "failed to make double-precision mpi mdrun" ;
159
		fi
160
	fi
68
161
69
	emake || die
70
}
162
}
71
163
72
src_install () {
164
src_install () {
73
	make DESTDIR=${D} install || die
165
	cd ${WORKDIR}/${P}-single ;
166
	emake DESTDIR=${D} install || die "installing single failed"
167
168
	if use mpi ; then 
169
		cd "${WORKDIR}"/${P}-single-mpi
170
		emake DESTDIR=${D} install-mdrun \
171
		|| die "installing mdrun_mpi failed"
172
	fi
173
174
	if use double-precision ; then
175
		cd ${WORKDIR}/${P}-double && emake DESTDIR=${D} install \
176
		|| die "installing double failed"
177
178
		if use mpi ; then
179
			cd "${WORKDIR}"/${P}-double-mpi
180
			emake DESTDIR=${D} install-mdrun \
181
		|| die "installing mdrun_mpi_d failed"
182
		fi
183
184
	fi
74
185
75
	# Install documentation.
186
	dodoc AUTHORS INSTALL README
76
	dodoc AUTHORS COPYING INSTALL README
77
187
78
	#move html docs under /usr/share/doc
188
	# Move html and leave examples and templates under /usr/share/gromacs.
79
	#and leave examples and templates under /usr/gromacs...
189
	mv "${D}"/usr/share/"${PN}"/html "${D}"/usr/share/doc/"${PF}"/
80
	mv ${D}/usr/share/${P}/html ${D}/usr/share/doc/${PF}
81
}
190
}

Return to bug 118421