Gentoo Archives: gentoo-commits

From: "Honza Macháček" <Hloupy.Honza@×××××××.cz>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-physics/abinit/
Date: Wed, 29 Jun 2011 15:28:45
Message-Id: 79939872cb3e7fcc5666f22abedf59d937ea9dfe.honza_machacek@gentoo
1 commit: 79939872cb3e7fcc5666f22abedf59d937ea9dfe
2 Author: Honza Macháček <Hloupy.Honza <AT> centrum <DOT> cz>
3 AuthorDate: Wed Jun 29 15:27:45 2011 +0000
4 Commit: Honza Macháček <Hloupy.Honza <AT> centrum <DOT> cz>
5 CommitDate: Wed Jun 29 15:27:45 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=79939872
7
8 Yet another quick version bump, no improvement to the ebuild. Compiles well for me but has problems testing. The fault may be just in my openmpi installation but use with caution.
9
10 ---
11 sci-physics/abinit/ChangeLog | 7 +
12 sci-physics/abinit/abinit-6.8.1.ebuild | 196 ++++++++++++++++++++++++++++++++
13 2 files changed, 203 insertions(+), 0 deletions(-)
14
15 diff --git a/sci-physics/abinit/ChangeLog b/sci-physics/abinit/ChangeLog
16 index 237af8e..fea0657 100644
17 --- a/sci-physics/abinit/ChangeLog
18 +++ b/sci-physics/abinit/ChangeLog
19 @@ -2,6 +2,13 @@
20 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
21 # $Header: $
22
23 +*abinit-6.8.1 (29 Jun 2011)
24 +
25 + 29 Jun 2011; Honza Macháček <Hloupy.Honza@×××××××.cz> +abinit-6.8.1.ebuild:
26 + Yet another quick version bump, no improvement to the ebuild. Compiles well
27 + for me but has problems testing. The fault may be just in my openmpi
28 + installation but use with caution.
29 +
30 29 Jun 2011; Honza Macháček <Hloupy.Honza@×××××××.cz> abinit-6.6.3.ebuild:
31 Restored the support for threaded fftw. Works for me. NEVER DISABLE FEATURES
32 FOR OTHERS.
33
34 diff --git a/sci-physics/abinit/abinit-6.8.1.ebuild b/sci-physics/abinit/abinit-6.8.1.ebuild
35 new file mode 100644
36 index 0000000..3799d05
37 --- /dev/null
38 +++ b/sci-physics/abinit/abinit-6.8.1.ebuild
39 @@ -0,0 +1,196 @@
40 +# Copyright 1999-2011 Gentoo Foundation
41 +# Distributed under the terms of the GNU General Public License v2
42 +# $Header: $
43 +
44 +EAPI="3"
45 +
46 +inherit autotools eutils fortran-2 multilib toolchain-funcs
47 +
48 +DESCRIPTION="Find total energy, charge density and electronic structure using density functional theory"
49 +HOMEPAGE="http://www.abinit.org/"
50 +SRC_URI="http://ftp.abinit.org/${P}.tar.gz"
51 +
52 +LICENSE="GPL-2"
53 +SLOT="0"
54 +KEYWORDS="~amd64 ~x86"
55 +IUSE="cuda -debug +fftw +fox gsl +hdf5 mpi +netcdf python -test +threads -vdwxc"
56 +
57 +RDEPEND=">=sci-libs/bigdft-1.2.0.2
58 + sci-libs/etsf_io
59 + =sci-libs/libxc-1.0[fortran]
60 + sci-physics/atompaw[libxc]
61 + fox? ( sci-libs/fox[dom,sax,wcml,wxml] )
62 + netcdf? (
63 + sci-libs/netcdf[fortran]
64 + hdf5? (
65 + sci-libs/netcdf[fortran,hdf5]
66 + )
67 + )
68 + hdf5? ( sci-libs/hdf5[fortran] )
69 + sci-libs/wannier90
70 + virtual/blas
71 + virtual/lapack
72 + gsl? ( sci-libs/gsl )
73 + fftw? (
74 + sci-libs/fftw:3.0
75 + threads? ( sci-libs/fftw:3.0[threads] )
76 + )
77 + mpi? ( virtual/mpi )
78 + python? ( dev-python/numpy )
79 + cuda? ( dev-util/nvidia-cuda-sdk )"
80 +DEPEND="${RDEPEND}
81 + dev-util/pkgconfig
82 + dev-perl/Text-Markdown"
83 +
84 +S=${WORKDIR}/${P%[a-z]}
85 +
86 +pkg_setup() {
87 + fortran-2_pkg_setup
88 + # Doesn't compile with gcc-4.0, only >=4.1
89 + if [[ $(tc-getFC) == *gfortran ]]; then
90 + if [[ $(gcc-major-version) -eq 4 ]] \
91 + && [[ $(gcc-minor-version) -lt 1 ]]; then
92 + die "Requires gcc-4.1 or newer"
93 + fi
94 + fi
95 +}
96 +
97 +src_prepare() {
98 + epatch "${FILESDIR}"/6.2.2-change-default-directories.patch
99 + epatch "${FILESDIR}"/6.0.3-fftw.patch
100 + eautoreconf
101 +}
102 +
103 +src_configure() {
104 + local libs="-L/usr/$(get_libdir)"
105 + local modules="-I/usr/$(get_libdir)/finclude"
106 + local FoX_libs="${libs} -lFoX_dom -lFoX_sax -lFoX_wcml -lFoX_wxml -lFoX_common -lFoX_utils -lFoX_fsys"
107 + local trio_flavor="etsf_io"
108 + use fox && trio_flavor="${trio_flavor}+fox"
109 + use netcdf && trio_flavor="${trio_flavor}+netcdf"
110 + local netcdff_libs="-lnetcdff"
111 + use hdf5 && netcdff_libs="${netcdff_libs} -lhdf5_fortran"
112 + local fft_flavor="fftw3"
113 + local fft_libs="-L/usr/lib"
114 + # Since now, fftw threads support is protected by black magick.
115 + # Anybody removes it again, dies.
116 + # If it does not work FOR YOU, disable the "threads" USE flag
117 + # for the package at YOUR box. If YOU want it disabled selectively
118 + # for fftw use in abinit, you may consider adding a special USE flag
119 + # for that. NEVER REMOVE AN OPTION FOR OTHERS, at least if there is
120 + # anybody it works for.
121 + if use threads; then
122 + fft_libs="${fft_libs} $(pkg-config --libs fftw3_threads)"
123 + fft_flavor="fftw3-threads"
124 + else
125 + fft_libs="${fft_libs} $(pkg-config --libs fftw3)"
126 + fi
127 + if use mpi; then
128 + MY_FC="mpif90"
129 + MY_CC="mpicc"
130 + MY_CXX="mpic++"
131 + else
132 + MY_FC="$(tc-getFC)"
133 + MY_CC="$(tc-getCC)"
134 + MY_CXX="$(tc-getCXX)"
135 + fi
136 + MARKDOWN=Markdown.pl econf \
137 + $(use_enable debug debug enhanced) \
138 + $(use_enable mpi) \
139 + $(use_enable mpi mpi-io) \
140 + --disable-smp \
141 + $(use_enable vdwxc) \
142 + $(use_enable cuda gpu) \
143 + "$(use cuda && echo "--with-gpu-flavor=cuda-single")" \
144 + "$(use cuda && echo "--with-gpu-prefix=/opt/cuda/")" \
145 + "$(use gsl && echo "--with-math-flavor=gsl")" \
146 + "$(use gsl && echo "--with-math-incs=$(pkg-config --cflags gsl)")" \
147 + "$(use gsl && echo "--with-math-libs=$(pkg-config --libs gsl)")" \
148 + --with-linalg-flavor="atlas" \
149 + --with-linalg-libs="$(pkg-config --libs lapack)" \
150 + --with-trio-flavor="${trio_flavor}" \
151 + "$(use netcdf && echo "--with-netcdf-incs=-I/usr/include")" \
152 + "$(use netcdf && echo "--with-netcdf-libs=$(pkg-config --libs netcdf) ${netcdff_libs}")" \
153 + "$(use fox && echo "--with-fox-incs=${modules}")" \
154 + "$(use fox && echo "--with-fox-libs=${FoX_libs}")" \
155 + --with-etsf-io-incs="${modules}" \
156 + --with-etsf-io-libs="${libs} -letsf_io -letsf_io_utils -letsf_io_low_level" \
157 + --with-dft-flavor="libxc+bigdft+atompaw+wannier90" \
158 + --with-libxc-incs="${modules}" \
159 + --with-libxc-libs="${libs} -lxc" \
160 + --with-bigdft-incs="${modules}" \
161 + --with-bigdft-libs="${libs} -lpoissonsolver -lbigdft" \
162 + --with-atompaw-incs="${modules}" \
163 + --with-atompaw-libs="${libs} -latompaw" \
164 + --with-wannier90-bins="/usr/bin" \
165 + --with-wannier90-incs="${modules}" \
166 + --with-wannier90-libs="${libs} -lwannier $(pkg-config --libs lapack)" \
167 + "$(use fftw && echo "--with-fft-flavor=${fft_flavor}")" \
168 + "$(use fftw && echo "--with-fft-incs=-I/usr/include")" \
169 + "$(use fftw && echo "--with-fft-libs=${fft_libs}")" \
170 + --with-timer-flavor="abinit" \
171 + FC="${MY_FC}" \
172 + CC="${MY_CC}" \
173 + CXX="${MY_CXX}" \
174 + LD="$(tc-getLD)" \
175 + FCFLAGS="${FCFLAGS:- ${FFLAGS:- -O2}} ${modules} -I/usr/include"
176 +}
177 +
178 +src_compile() {
179 + emake || die
180 +}
181 +
182 +src_test() {
183 + einfo "The tests take quite a while, on the order of 1-2 hours"
184 + einfo "on an Intel Penryn (2.5 GHz)."
185 + cd "${S}"/tests
186 + emake tests_min || ewarn "Minimal tests failed"
187 + emake tests_paw || ewarn "PAW tests failed"
188 + emake tests_gw || ewarn "GW tests failed"
189 + emake tests_gw_paw || ewarn "GW-PAW tests failed"
190 + emake tests tdft || ewarn "TDFT tests failed"
191 + emake tests_bench || ewarn "Benchmarks failed"
192 +
193 + local REPORT
194 + for REPORT in $(find . -name report); do
195 + REPORT=${REPORT#*/}
196 + elog "Parameters and unusual results for ${REPORT%%/*} tests"
197 + echo "Parameters and unusual results for ${REPORT%%/*} tests" >>tests_summary.txt
198 + while read line; do
199 + elog "${line}"
200 + echo "${line}" >>tests_summary.txt
201 + done \
202 + < <(grep -v -e succeeded -e passed ${REPORT})
203 + done
204 +
205 + local testdir
206 + find . -name "tmp-test*" -print | \
207 + while read testdir; do
208 + if [ -e summary_of_tests.tar ]; then
209 + tar rvf summary_of_tests.tar ${testdir}
210 + else tar cvf summary_of_tests.tar ${testdir}
211 + fi
212 + done
213 +
214 + elog "The full test results will be installed as summary_of_tests.tar.bz2."
215 + elog "Also a concise report tests_summary.txt is installed."
216 +}
217 +
218 +src_install() {
219 + emake DESTDIR="${D}" install || die "make install failed"
220 +
221 + if use test; then
222 + dodoc tests/tests_summary.txt || ewarn "Copying tests summary failed"
223 + dodoc tests/summary_tests.tar || ewarn "Copying tests results failed"
224 + dodoc tests/summary_of_tests.tar || ewarn "Copying tests results failed"
225 + fi
226 +
227 + dodoc KNOWN_PROBLEMS README || die "Copying doc files failed"
228 +}
229 +
230 +pkg_postinst() {
231 + if use test; then
232 + elog "The full test results will be installed as summary_tests.tar.bz2."
233 + elog "Also a concise report tests_summary.txt is installed."
234 + fi
235 +}