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

Collapse All | Expand All

(-)/usr/portage/sci-chemistry/gromacs/gromacs-3.3.1-r1.ebuild (-159 / +126 lines)
Lines 1-10 Link Here
1
# Copyright 1999-2007 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-r1.ebuild,v 1.9 2007/06/13 18:15:51 armin76 Exp $
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 $
4
4
5
inherit eutils fortran multilib
5
inherit eutils fortran
6
6
7
IUSE="3dnow X altivec double-precision mpi sse sse2"
7
IUSE="X 3dnow altivec mpi xml double-precision sse sse2 static fortran blas lapack"
8
8
9
# mopac7 qm/mm is broken until we can get files from
9
# mopac7 qm/mm is broken until we can get files from
10
# http://md.chem.rug.nl/~groenhof/qmmm.html
10
# http://md.chem.rug.nl/~groenhof/qmmm.html
Lines 16-69 Link Here
16
16
17
LICENSE="GPL-2"
17
LICENSE="GPL-2"
18
SLOT="0"
18
SLOT="0"
19
KEYWORDS="alpha amd64 ppc64 sparc x86"
19
KEYWORDS="~alpha ~x86 ~amd64 ~ppc64 ~sparc"
20
20
21
# gromacs uses fortran intrinsics such as RSHIFT that
22
# are currently missing from gfortran; hence we need
23
# to require g77 for the time being (see bug #141672).
24
FORTRAN="g77 gfortran"
25
26
27
#mpi is a local USE flag now
28
#May become official when situation with mpich is cleared (now the only mpi implementation awailable is lam-mpi)
21
DEPEND=">=sci-libs/fftw-3.0.1
29
DEPEND=">=sci-libs/fftw-3.0.1
22
	mpi? ( virtual/mpi )
30
	mpi? ( virtual/mpi )
23
	>=sys-devel/binutils-2.12
31
	>=sys-devel/binutils-2.15
24
	app-shells/tcsh
32
	app-shells/tcsh
25
	X? ( x11-libs/libX11
33
	X? ( x11-libs/libX11
26
		x11-libs/libXt
34
                x11-libs/libXt
27
		x11-libs/libXp
35
                x11-libs/libXp
28
		x11-libs/libXext
36
                x11-libs/libXext
29
		x11-proto/xproto
37
                x11-proto/xproto
30
		virtual/motif )"
38
                virtual/motif )
39
	xml? ( dev-libs/libxml2 )
40
	blas? ( virtual/blas )
41
	lapack? ( virtual/lapack )"
42
43
pkg_setup() {
44
	if use fortran; then
45
		fortran_pkg_setup
46
	fi
47
}
31
48
32
src_unpack() {
49
src_unpack() {
33
34
	unpack ${A}
50
	unpack ${A}
35
	if use ppc64 && use altivec ; then
51
	if use ppc64 && use altivec ; then
36
		epatch "${FILESDIR}"/${PN}-ppc64-altivec.patch
52
		epatch ${FILESDIR}/${PN}-ppc64-altivec.patch
37
	fi
53
	fi
38
54
        cd "${S}"
39
	cd "${S}"
40
55
41
# Fix typos in a couple of files.
56
# Fix typos in a couple of files.
42
	sed -e "s:_nb_kerne010_x86_64_sse2:_nb_kernel010_x86_64_sse2:" \
57
        sed -e "s:_nb_kerne010_x86_64_sse2:_nb_kernel010_x86_64_sse2:" \
43
		-i src/gmxlib/nonbonded/nb_kernel_x86_64_sse2/nb_kernel010_x86_64_sse2.intel_syntax.s \
58
                -i src/gmxlib/nonbonded/nb_kernel_x86_64_sse2/nb_kernel010_x86_64_sse2.intel_syntax.s \
44
		-i src/gmxlib/nonbonded/nb_kernel_x86_64_sse2/nb_kernel010_x86_64_sse2.s \
59
                -i src/gmxlib/nonbonded/nb_kernel_x86_64_sse2/nb_kernel010_x86_64_sse2.s \
45
		|| die "Failed to fix sse2 typo."
60
                || die "Failed to fix sse2 typo."
46
61
47
	sed -e "s:+0f:-f:" -i share/tutor/gmxdemo/demo \
62
        sed -e "s:+0f:-f:" -i share/tutor/gmxdemo/demo \
48
		|| die "Failed to fixup demo script."
63
                || die "Failed to fixup demo script."
49
64
50
# Fix a sandbox violation that occurs when re-emerging with mpi.
65
# Fix a sandbox violation that occurs when re-emerging with mpi.
51
	sed "/libdir=\"\$(libdir)\"/ a\	temp_libdir=\"${D}usr/$( get_libdir )\" ; \\\\" \
66
        sed "/libdir=\"\$(libdir)\"/ a\ temp_libdir=\"${D}usr/$( get_libdir )\" ; \\\\" \
52
	-i src/tools/Makefile.am \
67
        -i src/tools/Makefile.am \
53
	|| die "sed tools/Makefile.am failed"
68
        || die "sed tools/Makefile.am failed"
69
70
        sed -e "s:\$\$libdir:\$temp_libdir:" \
71
        -i src/tools/Makefile.am \
72
        || die "sed tools/Makefile.am failed"
54
73
55
	sed -e "s:\$\$libdir:\$temp_libdir:" \
56
	-i src/tools/Makefile.am \
57
	|| die "sed tools/Makefile.am failed"
58
59
	cd "${WORKDIR}" && mv ${P} ${P}-single ;
60
61
	use double-precision && cp -prP ${P}-single ${P}-double ;
62
63
	if use mpi ; then
64
		cp -prP ${P}-single ${P}-single-mpi
65
		use double-precision && cp -prP ${P}-double ${P}-double-mpi
66
	fi
67
}
74
}
68
75
69
src_compile() {
76
src_compile() {
Lines 72-212 Link Here
72
	# Static linking should try -lgcc instead of -lgcc_s.
79
	# Static linking should try -lgcc instead of -lgcc_s.
73
	# For more info:
80
	# For more info:
74
	# http://lists.debian.org/debian-gcc/2002/debian-gcc-200201/msg00150.html
81
	# http://lists.debian.org/debian-gcc/2002/debian-gcc-200201/msg00150.html
82
        local myconf ;
75
83
76
	# We will compile single precision by default, and suffix double-precision with _d.
84
        case "${ARCH}" in
77
	# Sparc is the only arch I can test on that needs to use fortran.
78
	local myconf ;
79
80
	case "${ARCH}" in
81
82
		x86)
83
				myconf="$myconf $(use_enable sse ia32-sse)"
84
				myconf="$myconf $(use_enable sse2 ia32-sse)"
85
				myconf="$myconf $(use_enable 3dnow ia32-3dnow)"
86
87
	# If you don't enable at least one of the above, you must use g77, not gfortran.
88
				if ! use sse && ! use sse2 && ! use 3dnow ; then
89
90
					if ! has_version "=sys-devel/gcc-3*" ; then
91
						die "If you must run gromacs without sse (not recommended) gfortran will not work."
92
					else myconf="$myconf --enable-fortran" && fortran_pkg_setup
93
94
					fi
95
				fi
96
			;;
97
85
98
		amd64)
86
                x86)
99
				myconf="$myconf --enable-x86-64-sse"
87
                                myconf="$myconf $(use_enable sse ia32-sse)"
100
			;;
88
                                myconf="$myconf $(use_enable sse2 ia32-sse)"
89
                                myconf="$myconf $(use_enable 3dnow ia32-3dnow)"
101
90
102
		ppc)
91
        # If you don't enable at least one of the above, you must use g77, not gfortran.
103
				if use altivec ; then
92
                                if ! use sse && ! use sse2 && ! use 3dnow ; then
104
					myconf="$myconf --enable-ppc-altivec --disable-fortran"
105
				else
106
					if ! has_version "=sys-devel/gcc-3*" ; then
107
108
						die "If you must run gromacs without sse (not recommended) gfortran will not work."
109
					fi
110
					myconf="$myconf --enable-fortran" && fortran_pkg_setup
111
				fi
112
			;;
113
114
		ppc64)
115
				if use altivec ; then
116
					myconf="$myconf --enable-ppc-altivec --disable-fortran"
117
				else
118
					if ! has_version "=sys-devel/gcc-3*" ; then
119
						die "If you must run gromacs without sse (not recommended) gfortran will not work."
120
					fi
121
					myconf="$myconf --enable-fortran" && fortran_pkg_setup
122
				fi
123
			;;
124
93
125
		sparc)
94
                                        if ! has_version "=sys-devel/gcc-3*" ; then
126
				if ! has_version "=sys-devel/gcc-3*" ; then
95
                                                die "If you must run gromacs without sse (not recommended) gfortranwill not work."
96
                                        else myconf="$myconf --enable-fortran" && fortran_pkg_setup
127
97
128
					die "If you must run gromacs without sse (not recommended) gfortran will not work."
98
                                        fi
129
				else
99
                                fi
130
					myconf="$myconf --enable-fortran" && fortran_pkg_setup
100
                        ;;
131
				fi
132
			;;
133
134
		ia64)
135
				myconf="$myconf --enable-ia64-asm"
136
			;;
137
138
		alpha)
139
				myconf="$myconf --enable-axp-asm --disable-fortran"
140
			;;
141
142
	esac
143
144
	myconf="--enable-shared \
145
			--datadir=/usr/share \
146
			--bindir=/usr/bin \
147
			--libdir=/usr/$(get_libdir) \
148
			--with-fft=fftw3 \
149
			$(use_with X x) \
150
			${myconf}"
151
152
	#		$(use_with mopac7 qmmm-mopac) \
153
154
	cd "${WORKDIR}"/${P}-single
155
	econf ${myconf} --enable-float || die "configure single-precision failed"
156
157
	emake || die "emake single failed"
158
159
	if use mpi ; then
160
		cd "${WORKDIR}"/${P}-single-mpi
161
		econf ${myconf} --enable-float --enable-mpi --program-suffix=_mpi \
162
			|| die "failed to configure single-mpi mdrun"
163
		emake mdrun || die "failed to make single-precision mpi mdrun" ;
164
	fi
165
166
	if use double-precision ; then
167
		cd "${WORKDIR}"/${P}-double
168
169
		econf ${myconf} --enable-double --program-suffix=_d \
170
			|| die "configure double-precision failed"
171
101
172
		emake || die "emake double failed"
102
		amd64)
103
                                myconf="$myconf --enable-x86-64-sse"
104
                        ;;
173
105
174
		if use mpi ; then
106
                ppc)
175
			cd "${WORKDIR}"/${P}-double-mpi
107
                                if use altivec ; then
176
			econf ${myconf} --enable-double --enable-mpi --program-suffix=_mpi_d \
108
                                        myconf="$myconf --enable-ppc-altivec --disable-fortran"
177
				|| die "failed to configure double-mpi mdrun" ;
109
                                else
178
110
                                        if ! has_version "=sys-devel/gcc-3*" ; then
179
			emake mdrun \
111
180
				|| die "failed to make double-precision mpi mdrun" ;
112
                                                die "If you must run gromacs without sse (not recommended) gfortran will not work."
181
		fi
113
                                        fi
182
	fi
114
                                        myconf="$myconf --enable-fortran" && fortran_pkg_setup
115
                                fi
116
                        ;;
117
118
                ppc64)
119
                                if use altivec ; then
120
                                        myconf="$myconf --enable-ppc-altivec --disable-fortran"
121
                                else
122
                                        if ! has_version "=sys-devel/gcc-3*" ; then
123
                                                die "If you must run gromacs without sse (not recommended) gfortran will not work."
124
                                        fi
125
                                        myconf="$myconf --enable-fortran" && fortran_pkg_setup
126
                                fi
127
                        ;;
128
		sparc)
129
                                if ! has_version "=sys-devel/gcc-3*" ; then
183
130
131
                                        die "If you must run gromacs without sse (not recommended) gfortran will not work."
132
                                else
133
                                        myconf="$myconf --enable-fortran" && fortran_pkg_setup
134
                                fi
135
                        ;;
136
137
                ia64)
138
                                myconf="$myconf --enable-ia64-asm"
139
                        ;;
140
141
                alpha)
142
                                myconf="$myconf --enable-axp-asm --disable-fortran"
143
                        ;;
144
145
        esac
146
147
	if use blas; then
148
		export LIBS="$LIBS -lblas"
149
	fi
150
	if use lapack; then
151
		export LIBS="$LIBS -llapack"
152
	fi
153
	econf "${myconf}" \
154
		--datadir=/usr/share \
155
		--bindir=/usr/bin \
156
		--libdir=/usr/$(get_libdir) \
157
		--with-fft=fftw3 \
158
		--program-suffix= \
159
		$(use_with xml) \
160
		$(use_enable double-precision double) \
161
		$(use_enable mpi) \
162
		$(use_with X x) \
163
		$(use_with blas external-blas) \
164
		$(use_with lapack external-lapack) \
165
		$(use_enable static all-static) || die "Configure failed"
166
#               $(use_with mopac7 qmmm-mopac) \
167
	emake || die
184
}
168
}
185
169
186
src_install () {
170
src_install () {
187
	cd ${WORKDIR}/${P}-single ;
171
	make DESTDIR=${D} install || die
188
	emake DESTDIR=${D} install || die "installing single failed"
189
190
	if use mpi ; then
191
		cd "${WORKDIR}"/${P}-single-mpi
192
		emake DESTDIR=${D} install-mdrun \
193
		|| die "installing mdrun_mpi failed"
194
	fi
195
196
	if use double-precision ; then
197
		cd ${WORKDIR}/${P}-double && emake DESTDIR=${D} install \
198
		|| die "installing double failed"
199
200
		if use mpi ; then
201
			cd "${WORKDIR}"/${P}-double-mpi
202
			emake DESTDIR=${D} install-mdrun \
203
		|| die "installing mdrun_mpi_d failed"
204
		fi
205
206
	fi
207
172
208
	dodoc AUTHORS INSTALL README
173
	# Install documentation.
174
	dodoc AUTHORS COPYING INSTALL README
209
175
210
	# Move html and leave examples and templates under /usr/share/gromacs.
176
	#move html docs under /usr/share/doc
177
	#and leave examples and templates under /usr/gromacs...
211
	mv "${D}"/usr/share/"${PN}"/html "${D}"/usr/share/doc/"${PF}"/
178
	mv "${D}"/usr/share/"${PN}"/html "${D}"/usr/share/doc/"${PF}"/
212
}
179
}

Return to bug 193532