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/bigdft/, sci-physics/bigdft/files/
Date: Fri, 05 Sep 2014 13:09:59
Message-Id: 1409922393.fba081143ca9e86c13f5cfb561d4b6a9fd6e9d8b.honza_machacek@gentoo
1 commit: fba081143ca9e86c13f5cfb561d4b6a9fd6e9d8b
2 Author: Honza Macháček <Hloupy.Honza <AT> centrum <DOT> cz>
3 AuthorDate: Fri Sep 5 13:06:33 2014 +0000
4 Commit: Honza Macháček <Hloupy.Honza <AT> centrum <DOT> cz>
5 CommitDate: Fri Sep 5 13:06:33 2014 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=fba08114
7
8 sci-physics/bigdft bumped to 1.7.5, after a long pause.
9
10 Package-Manager: portage-2.2.8-r1
11
12 ---
13 sci-physics/bigdft/ChangeLog | 11 ++-
14 ...bigdft-1.7_pre24.ebuild => bigdft-1.7.5.ebuild} | 77 +++++++++++----
15 .../files/bigdft-1.7-dev.24-nolib_mods.patch | 25 -----
16 .../bigdft/files/bigdft-1.7.5-dynamic_memory.patch | 106 +++++++++++++++++++++
17 .../bigdft/files/bigdft-1.7.5-pkgconfig.patch | 10 ++
18 sci-physics/bigdft/metadata.xml | 30 ++++++
19 6 files changed, 213 insertions(+), 46 deletions(-)
20
21 diff --git a/sci-physics/bigdft/ChangeLog b/sci-physics/bigdft/ChangeLog
22 index 3a27413..a0d1fa4 100644
23 --- a/sci-physics/bigdft/ChangeLog
24 +++ b/sci-physics/bigdft/ChangeLog
25 @@ -1,7 +1,16 @@
26 # ChangeLog for sci-physics/bigdft
27 -# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 +# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
29 # $Header: $
30
31 +*bigdft-1.7.5 (05 Sep 2014)
32 +
33 + 05 Sep 2014; Honza Macháček <Hloupy.Honza@×××××××.cz>
34 + -bigdft-1.7_pre24.ebuild, +bigdft-1.7.5.ebuild,
35 + +files/bigdft-1.7.5-dynamic_memory.patch,
36 + +files/bigdft-1.7.5-pkgconfig.patch,
37 + -files/bigdft-1.7-dev.24-nolib_mods.patch, +metadata.xml:
38 + Version bump, after a long pause.
39 +
40 19 Jun 2013; Honza Macháček <Hloupy.Honza@×××××××.cz>
41 bigdft-1.7_pre24.ebuild:
42 Filter LDFLAGS for cuda use not to break nvcc.
43
44 diff --git a/sci-physics/bigdft/bigdft-1.7_pre24.ebuild b/sci-physics/bigdft/bigdft-1.7.5.ebuild
45 similarity index 62%
46 rename from sci-physics/bigdft/bigdft-1.7_pre24.ebuild
47 rename to sci-physics/bigdft/bigdft-1.7.5.ebuild
48 index 2b0e95e..6782e66 100644
49 --- a/sci-physics/bigdft/bigdft-1.7_pre24.ebuild
50 +++ b/sci-physics/bigdft/bigdft-1.7.5.ebuild
51 @@ -8,16 +8,15 @@ PYTHON_COMPAT=( python2_5 python2_6 python2_7 )
52
53 inherit autotools-utils eutils flag-o-matic fortran-2 python-any-r1 toolchain-funcs
54
55 -REAL_PV="${PV/_pre/-dev.}"
56
57 DESCRIPTION="A DFT electronic structure code using a wavelet basis set"
58 HOMEPAGE="http://bigdft.org/"
59 -SRC_URI="http://launchpad.net/${PN}/master/${REAL_PV}/+download/${PN}-${REAL_PV}.tar.gz"
60 +SRC_URI="http://launchpad.net/${PN}/${PV%.*}/${PV}/+download/${P}.tar.xz"
61
62 LICENSE="GPL-3"
63 SLOT="0"
64 KEYWORDS="~amd64 ~x86 ~amd64-linux"
65 -IUSE="cuda doc etsf_io mpi netcdf openmp opencl test"
66 +IUSE="cuda doc etsf_io glib mpi netcdf openmp opencl scalapack test"
67
68 RDEPEND="
69 >=sci-libs/libxc-1.2.0-r1[fortran]
70 @@ -28,12 +27,14 @@ RDEPEND="
71 mpi? ( virtual/mpi )
72 cuda? ( dev-util/nvidia-cuda-sdk )
73 opencl? ( virtual/opencl )
74 - etsf_io? ( sci-libs/etsf_io )
75 + glib? ( >=dev-libs/glib-2.22 )
76 + etsf_io? ( >=sci-libs/etsf_io-1.0.3-r2 )
77 netcdf? ( || (
78 sci-libs/netcdf[fortran]
79 sci-libs/netcdf-fortran
80 )
81 - )"
82 + )
83 + scalapack? ( virtual/scalapack )"
84 DEPEND="${RDEPEND}
85 virtual/pkgconfig
86 >=sys-devel/autoconf-2.59
87 @@ -44,8 +45,6 @@ DEPEND="${RDEPEND}
88 app-arch/tar
89 app-arch/gzip"
90
91 -S="${WORKDIR}/${PN}-${REAL_PV}"
92 -
93 DOCS=( README INSTALL ChangeLog AUTHORS NEWS )
94
95 FORTRAN_STANDARD=90
96 @@ -56,47 +55,70 @@ pkg_setup() {
97 export FC="mpif90"
98 export F77="mpif77"
99 export CC="mpicc"
100 + export CXX="mpic++"
101 else
102 - tc-export FC F77 CC
103 + tc-export FC F77 CC CXX
104 fi
105
106 + use openmp && FORTRAN_NEED_OPENMP=1
107 +
108 fortran-2_pkg_setup
109 - if use openmp && [[ $(tc-getCC)$ == *gcc* ]] && ! tc-has-openmp; then
110 - die "Please select an openmp capable compiler like gcc[openmp]"
111 +
112 + if use openmp; then
113 + # based on _fortran-has-openmp() of fortran-2.eclass
114 + local openmp=""
115 + local fcode=ebuild-openmp-flags.f
116 + local _fc=$(tc-getFC)
117 +
118 + pushd "${T}"
119 + cat <<- EOF > "${fcode}"
120 + 1 call omp_get_num_threads
121 + 2 end
122 + EOF
123 +
124 + for openmp in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do
125 + "${_fc}" "${openmp}" "${fcode}" -o "${fcode}.x" && break
126 + done
127 +
128 + rm -f "${fcode}.*"
129 + popd
130 +
131 + append-flags "${openmp}"
132 fi
133 +
134 python-any-r1_pkg_setup
135 }
136
137 src_prepare() {
138 epatch \
139 - "${FILESDIR}"/"${PN}-${REAL_PV}"-nolib_mods.patch
140 + "${FILESDIR}"/"${P}"-pkgconfig.patch \
141 + "${FILESDIR}"/"${P}"-dynamic_memory.patch
142
143 eautoreconf
144 }
145
146 src_configure() {
147 - local openmp=""
148 - use openmp && openmp="-fopenmp"
149 local modules="${EPREFIX}/usr/include"
150 local netcdff_libs="-lnetcdff"
151 filter-flags '-m*' '-O*' "-pipe"
152 local nvcflags="${CFLAGS}"
153 _filter-var nvcflags '-m*' '-O*' "-pipe" "-W*"
154 use cuda && filter-ldflags '-m*' '-O*' "-pipe" "-W*"
155 + local mylapack="lapack"
156 + use scalapack && mylapack="scalapack"
157 local myeconfargs=(
158 $(use_enable mpi)
159 --enable-optimised-convolution
160 --enable-pseudo
161 --enable-libbigdft
162 --enable-binaries
163 + --disable-bindings
164 --disable-minima-hopping
165 --disable-internal-libyaml
166 --enable-internal-libabinit
167 --with-moduledir="${modules}"
168 - --with-ext-linalg="$($(tc-getPKG_CONFIG) --libs-only-l lapack) \
169 - $($(tc-getPKG_CONFIG) --libs-only-l blas)"
170 - --with-ext-linalg-path="$($(tc-getPKG_CONFIG) --libs-only-L lapack) \
171 - $($(tc-getPKG_CONFIG) --libs-only-L blas)"
172 + --with-ext-linalg="$($(tc-getPKG_CONFIG) --libs-only-l "${mylapack}")"
173 + --with-ext-linalg-path="$($(tc-getPKG_CONFIG) --libs-only-L "${mylapack}")"
174 --with-libxc="yes"
175 --disable-internal-libxc
176 $(use_enable cuda cuda-gpu)
177 @@ -105,8 +127,13 @@ src_configure() {
178 $(use_enable opencl)
179 $(use_with etsf_io etsf-io)
180 "$(use etsf_io && echo "--with-netcdf-libs=$($(tc-getPKG_CONFIG) --libs netcdf) ${netcdff_libs}")"
181 + $(use_with glib gobject)
182 + $(use_with scalapack)
183 + $(use_with scalapack scalapack-path "${EPREFIX}/usr/$(get_libdir)")
184 + $(use_with scalapack blacs)
185 + $(use_with scalapack blacs-path "${EPREFIX}/usr/$(get_libdir)")
186 PKG_CONFIG="$(tc-getPKG_CONFIG)"
187 - FCFLAGS="${FCFLAGS} ${openmp} -I${modules}"
188 + FCFLAGS="${FCFLAGS} -I${modules}"
189 LD="$(tc-getLD)"
190 CPP="$(tc-getCPP)"
191 )
192 @@ -122,7 +149,10 @@ src_compile() {
193 popd > /dev/null
194
195 #autotools-utils_src_compile
196 - use doc && autotools-utils_src_compile doc
197 + if use doc; then
198 + VARTEXFONTS="${T}/fonts"
199 + autotools-utils_src_compile doc
200 + fi
201 }
202
203 src_test() {
204 @@ -138,5 +168,12 @@ src_test() {
205 }
206
207 src_install() {
208 - autotools-utils_src_install HAVE_LIBXC=1
209 + autotools-utils_src_install
210 + if use test; then
211 + _check_build_dir
212 + pushd "${BUILD_DIR}" > /dev/null || die
213 + insinto /usr/share/"${P}"
214 + doins -r tests
215 + popd > /dev/null
216 + fi
217 }
218
219 diff --git a/sci-physics/bigdft/files/bigdft-1.7-dev.24-nolib_mods.patch b/sci-physics/bigdft/files/bigdft-1.7-dev.24-nolib_mods.patch
220 deleted file mode 100644
221 index de3555b..0000000
222 --- a/sci-physics/bigdft/files/bigdft-1.7-dev.24-nolib_mods.patch
223 +++ /dev/null
224 @@ -1,25 +0,0 @@
225 -diff -Naurp bigdft-1.7-dev.24.orig/src/Makefile.am bigdft-1.7-dev.24/src/Makefile.am
226 ---- bigdft-1.7-dev.24.orig/src/Makefile.am 2013-03-12 12:56:53.000000000 +0000
227 -+++ bigdft-1.7-dev.24/src/Makefile.am 2013-04-10 09:29:31.073319847 +0000
228 -@@ -56,6 +56,9 @@ bigdft_library_rpath =
229 - endif
230 - if BUILD_LIB_BIGDFT
231 - lib_bigdft = libbigdft.a libdft_common.a
232 -+else
233 -+lib_bigdft =
234 -+endif
235 - PS_SOURCES = PSolver/Build_Kernel.f90 \
236 - PSolver/xcenergy.f90 \
237 - PSolver/3Dgradient.f90 \
238 -@@ -64,11 +67,6 @@ PS_SOURCES = PSolver/Build_Kernel.f90 \
239 - PSolver/wofz.f90 \
240 - lib/fft/fft3d.f90
241 - PS_MODULES = PSolver/Poisson_Solver.f90
242 --else
243 --lib_bigdft =
244 --PS_SOURCES =
245 --PS_MODULES =
246 --endif
247 - if BUILD_BINARIES
248 - binaries_sources = bigdft memguess splsad NEB frequencies MDanalysis $(minima_hopping_sources) bart abscalc BigDFT2Wannier WaCo NEB_images
249 - local_binaries = test_forces
250
251 diff --git a/sci-physics/bigdft/files/bigdft-1.7.5-dynamic_memory.patch b/sci-physics/bigdft/files/bigdft-1.7.5-dynamic_memory.patch
252 new file mode 100644
253 index 0000000..7271223
254 --- /dev/null
255 +++ b/sci-physics/bigdft/files/bigdft-1.7.5-dynamic_memory.patch
256 @@ -0,0 +1,106 @@
257 +diff -Naurp bigdft-1.7.5_orig/src/wavelib/i-o-etsf.f90 bigdft-1.7.5/src/wavelib/i-o-etsf.f90
258 +--- bigdft-1.7.5_orig/src/wavelib/i-o-etsf.f90 2014-07-09 12:56:18.000000000 +0000
259 ++++ bigdft-1.7.5/src/wavelib/i-o-etsf.f90 2014-09-04 07:05:36.256646737 +0000
260 +@@ -178,6 +178,7 @@ module internal_etsf
261 + subroutine etsf_gcoordToLocreg(n1, n2, n3, nvctr_c, nvctr, gcoord, lr)
262 + use module_defs
263 + use module_types
264 ++ use dynamic_memory
265 +
266 + implicit none
267 +
268 +@@ -401,6 +402,7 @@ subroutine read_waves_from_list_etsf(ipr
269 + & wfd,psi,norb,nspinor,iorbparr,isorb,eval)
270 + use module_base
271 + use module_types
272 ++ use dynamic_memory
273 + use etsf_io_low_level
274 + use etsf_io
275 + use internal_etsf
276 +@@ -744,11 +746,18 @@ subroutine read_waves_etsf(iproc,filenam
277 + character(len = *), intent(in) :: filename
278 + ! Local variables
279 + integer :: i
280 ++ real(wp), dimension(:), allocatable :: eval
281 ++
282 ++ eval = f_malloc(size(orbs%eval),id='eval')
283 ++ eval = orbs%eval
284 +
285 + i = 0
286 + call read_waves_from_list_etsf(iproc,filename,n1,n2,n3,hx,hy,hz,at,rxyz_old,rxyz, &
287 + & wfd,psi,orbs%norbp,orbs%nspinor,(/ (i, i=1, orbs%norbp*orbs%nspinor) /), &
288 +- & orbs%isorb,orbs%eval(orbs%isorb + 1))
289 ++ & orbs%isorb,eval(orbs%isorb + 1))
290 ++
291 ++ orbs%eval = eval
292 ++ call f_free(eval)
293 + END SUBROUTINE read_waves_etsf
294 +
295 + subroutine read_one_wave_etsf(iproc,filename,iorbp,isorb,nspinor,n1,n2,n3,&
296 +@@ -765,14 +774,16 @@ subroutine read_one_wave_etsf(iproc,file
297 + real(gp), dimension(3,at%astruct%nat), intent(out) :: rxyz_old
298 + real(wp), dimension(wfd%nvctr_c+7*wfd%nvctr_f,nspinor), intent(out) :: psi
299 + character(len = *), intent(in) :: filename
300 ++ real(wp), dimension(1) :: eval1
301 +
302 + if (nspinor == 1) then
303 + call read_waves_from_list_etsf(iproc,filename,n1,n2,n3,hx,hy,hz,at,rxyz_old,rxyz, &
304 +- & wfd,psi,1,nspinor,(/ iorbp /),isorb,eval)
305 ++ & wfd,psi,1,nspinor,(/ iorbp /),isorb,eval1)
306 + else
307 + call read_waves_from_list_etsf(iproc,filename,n1,n2,n3,hx,hy,hz,at,rxyz_old,rxyz, &
308 +- & wfd,psi,1,nspinor,(/ 2 * iorbp - 1, 2 * iorbp /),isorb,eval)
309 ++ & wfd,psi,1,nspinor,(/ 2 * iorbp - 1, 2 * iorbp /),isorb,eval1)
310 + end if
311 ++ eval = eval1(1)
312 + END SUBROUTINE read_one_wave_etsf
313 +
314 + subroutine write_psi_compress_etsf(ncid, iorbp, orbs, nvctr, wfd, psi)
315 +@@ -1062,7 +1073,7 @@ subroutine write_waves_etsf(iproc,filena
316 + end do
317 + znucl = f_malloc(at%astruct%ntypes,id='znucl')
318 + znucl = real(at%nzatom)
319 +- spnames = f_malloc(at%astruct%ntypes,id='spnames')
320 ++ spnames = f_malloc_str(etsf_chemlen,at%astruct%ntypes,id='spnames')
321 + do iat = 1, at%astruct%ntypes, 1
322 + !call nzsymbol(at%nzatom(iat), spnames(iat))
323 + call atomic_info(at%nzatom(iat),at%nelpsp(iat),symbol=spnames(iat))
324 +@@ -1080,7 +1091,7 @@ subroutine write_waves_etsf(iproc,filena
325 + if (.not. lstat) call etsf_error(error)
326 + call f_free(xred)
327 + call f_free(znucl)
328 +- call f_free(spnames)
329 ++ call f_free_str(etsf_chemlen,spnames)
330 + ! The eigenvalues & occupation.
331 + if (dims%number_of_spins == 1) then
332 + elec%eigenvalues%data1D => orbs%eval
333 +@@ -1138,6 +1149,8 @@ subroutine write_waves_etsf(iproc,filena
334 + END SUBROUTINE etsf_write_global
335 +
336 + subroutine build_grid(n1,n2,n3,nvctr, gcoord, wfd)
337 ++ use dynamic_memory
338 ++
339 + integer, intent(in) :: n1, n2, n3
340 + type(wavefunctions_descriptors), intent(in) :: wfd
341 + integer, intent(out) :: nvctr(wfd%nvctr_c)
342 +diff -Naurp bigdft-1.7.5_orig/src/wavelib/plotting-etsf.f90 bigdft-1.7.5/src/wavelib/plotting-etsf.f90
343 +--- bigdft-1.7.5_orig/src/wavelib/plotting-etsf.f90 2014-06-05 14:07:35.000000000 +0000
344 ++++ bigdft-1.7.5/src/wavelib/plotting-etsf.f90 2014-09-04 07:04:42.335813661 +0000
345 +@@ -141,7 +141,7 @@ subroutine write_etsf_density(filename,m
346 + end do
347 + znucl = f_malloc(at%astruct%ntypes,id='znucl')
348 + znucl = real(at%nzatom)
349 +- spnames = f_malloc(at%astruct%ntypes,id='spnames')
350 ++ spnames = f_malloc_str(etsf_chemlen,at%astruct%ntypes,id='spnames')
351 + do iat = 1, at%astruct%ntypes, 1
352 + !call nzsymbol(at%nzatom(iat), spnames(iat))
353 + call atomic_info(at%nzatom(iat),at%nelpsp(iat),symbol=spnames(iat))
354 +@@ -159,7 +159,7 @@ subroutine write_etsf_density(filename,m
355 + end if
356 + call f_free(xred)
357 + call f_free(znucl)
358 +- call f_free(spnames)
359 ++ call f_free_str(etsf_chemlen,spnames)
360 +
361 + ! We switch to write mode.
362 + call etsf_io_low_set_write_mode(ncid, lstat, error_data = error)
363
364 diff --git a/sci-physics/bigdft/files/bigdft-1.7.5-pkgconfig.patch b/sci-physics/bigdft/files/bigdft-1.7.5-pkgconfig.patch
365 new file mode 100644
366 index 0000000..fdf5937
367 --- /dev/null
368 +++ b/sci-physics/bigdft/files/bigdft-1.7.5-pkgconfig.patch
369 @@ -0,0 +1,10 @@
370 +diff -Naurp bigdft-1.7.1.orig/bigdft.pc.in bigdft-1.7.1/bigdft.pc.in
371 +--- bigdft-1.7.1.orig/bigdft.pc.in 2013-12-11 09:31:00.000000000 +0000
372 ++++ bigdft-1.7.1/bigdft.pc.in 2014-01-27 10:17:14.314387505 +0000
373 +@@ -7,5 +7,5 @@ Name: libbigdft
374 + Description: Library for DFT calculation over wavelets.
375 + Requires:
376 + Version: @VERSION@
377 +-Libs: -L${libdir} @LIBS_DEPENDENCIES@ @FCLIBS@
378 ++Libs: -L${libdir} @LIBS_SHORT_DEPS@ @FCLIBS@
379 + Cflags: -I${includedir}
380
381 diff --git a/sci-physics/bigdft/metadata.xml b/sci-physics/bigdft/metadata.xml
382 new file mode 100644
383 index 0000000..855d625
384 --- /dev/null
385 +++ b/sci-physics/bigdft/metadata.xml
386 @@ -0,0 +1,30 @@
387 +<?xml version="1.0" encoding="UTF-8"?>
388 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
389 +<pkgmetadata>
390 + <herd>sci-physics</herd>
391 + <longdescription lang="en">
392 +BigDFT is a DFT massively parallel electronic structure code (GPL license) using a wavelet basis set. Wavelets form a real space basis set distributed on an adaptive mesh (two levels of resolution in our implementation). GTH or HGH pseudopotentials are used to remove the core electrons. Thanks to our Poisson solver based on a Green function formalism, periodic systems, surfaces and isolated systems can be simulated with the proper boundary conditions.
393 +</longdescription>
394 + <use>
395 + <flag name="cuda">Enable support for nVidia CUDA GPU acceleration</flag>
396 + </use>
397 + <use>
398 + <flag name="etsf_io">
399 + Enable support for reading and writing the European Theoretical
400 + Spectroscopy facility (ETSF) file format.
401 + </flag>
402 + </use>
403 + <use>
404 + <flag name="glib">
405 + Compile with GLib Object System support
406 + </flag>
407 + </use>
408 + <use>
409 + <flag name="opencl">Enable support for OpenCL GPU acceleration</flag>
410 + </use>
411 + <use>
412 + <flag name="scalapack">
413 + Use ScaLAPACK, a subset of LAPACK routines redesigned for heterogenous computing
414 + </flag>
415 + </use>
416 +</pkgmetadata>