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/elk/
Date: Fri, 01 Jul 2011 07:10:49
Message-Id: 0660974bd34f65d3738a089d144812cc74604247.honza_machacek@gentoo
1 commit: 0660974bd34f65d3738a089d144812cc74604247
2 Author: Honza Macháček <Hloupy.Honza <AT> centrum <DOT> cz>
3 AuthorDate: Fri Jul 1 07:01:36 2011 +0000
4 Commit: Honza Macháček <Hloupy.Honza <AT> centrum <DOT> cz>
5 CommitDate: Fri Jul 1 07:01:36 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=0660974b
7
8 New ebuild sci-physics/elk-1.3.15 added (a GPL-3 all-electron FP-LAPW code, used for example by sci-physics/abinit developers for comparison).
9
10 ---
11 sci-physics/elk/ChangeLog | 12 ++++
12 sci-physics/elk/elk-1.3.15.ebuild | 104 +++++++++++++++++++++++++++++++++++++
13 2 files changed, 116 insertions(+), 0 deletions(-)
14
15 diff --git a/sci-physics/elk/ChangeLog b/sci-physics/elk/ChangeLog
16 new file mode 100644
17 index 0000000..558ea51
18 --- /dev/null
19 +++ b/sci-physics/elk/ChangeLog
20 @@ -0,0 +1,12 @@
21 +# ChangeLog for sci-physics/elk
22 +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
23 +# $Header: $
24 +
25 +*elk-1.3.15 (01 Jul 2011)
26 +
27 + 01 Jul 2011; Honza Macháček <Hloupy.Honza@×××××××.cz> +elk-1.3.15.ebuild:
28 + New ebuild added. Compiled with USE=lapack against lapack-atlas at my box, it
29 + failed tests miserably, even with a lot of segfaults. Using its internal
30 + lapack with USE=-lapack, it looks well. Tested OK with USE="-lapack libxc mpi
31 + openmp".
32 +
33
34 diff --git a/sci-physics/elk/elk-1.3.15.ebuild b/sci-physics/elk/elk-1.3.15.ebuild
35 new file mode 100644
36 index 0000000..214bbea
37 --- /dev/null
38 +++ b/sci-physics/elk/elk-1.3.15.ebuild
39 @@ -0,0 +1,104 @@
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 eutils fortran-2 multilib toolchain-funcs
47 +
48 +DESCRIPTION="All-electron full-potential linearised augmented-plane wave (FP-LAPW) code with advanced features."
49 +HOMEPAGE="http://elk.sourceforge.net/"
50 +SRC_URI="mirror://sourceforge/${PN}/${P}.tgz"
51 +
52 +LICENSE="GPL-3"
53 +SLOT="0"
54 +KEYWORDS="~amd64 ~x86"
55 +IUSE="-debug lapack libxc mpi openmp test"
56 +
57 +RDEPEND="lapack? ( virtual/blas
58 + virtual/lapack )
59 + libxc? ( =sci-libs/libxc-1.0[fortran] )
60 + mpi? ( virtual/mpi )"
61 +DEPEND="${RDEPEND}
62 + dev-util/pkgconfig"
63 +
64 +pkg_setup() {
65 + fortran-2_pkg_setup
66 + if use openmp; then
67 + tc-has-openmp || \
68 + die "Please select an openmp capable compiler like gcc[openmp]"
69 + fi
70 +}
71 +
72 +src_prepare() {
73 + if use libxc; then
74 + sed -i -e's/^\(SRC_libxc =\)/#\1/' "${S}/src/Makefile"
75 + fi
76 + if use mpi; then
77 + sed -i -e's/^\(SRC_mpi =\)/#\1/' "${S}/src/Makefile"
78 + fi
79 +}
80 +
81 +src_configure() {
82 + if use mpi; then
83 + MY_FC="mpif90"
84 + MY_CC="mpicc"
85 + MY_CXX="mpic++"
86 + else
87 + MY_FC="$(tc-getFC)"
88 + MY_CC="$(tc-getCC)"
89 + MY_CXX="$(tc-getCXX)"
90 + fi
91 + if use openmp; then
92 + MY_FC="${MY_FC} -fopenmp"
93 + MY_CC="${MY_CC} -fopenmp"
94 + MY_CXX="${MY_CXX} -fopenmp"
95 + fi
96 + MY_FCFLAGS="${FCFLAGS:- ${FFLAGS:- -O3 -funroll-loops -ffast-math}}"
97 + MY_FCFLAGS="${MY_FCFLAGS} -I/usr/include -I/usr/$(get_libdir)/finclude"
98 + MY_CFLAGS="${CFLAGS:- -O3 -funroll-loops -ffast-math}"
99 + MY_CXXFLAGS="${CXXFLAGS:- ${CFLAGS:- -O3 -funroll-loops -ffast-math}}"
100 + echo "MAKE = make" > make.inc
101 + echo "F90 = $MY_FC" >> make.inc
102 + echo "F90_OPTS = $MY_FCFLAGS" >> make.inc
103 + echo "F77 = $MY_FC" >> make.inc
104 + echo "F77_OPTS = $MY_FCFLAGS" >> make.inc
105 + echo "CC = ${MY_CC}" >> make.inc
106 + echo "CXX = ${MY_CXX}" >> make.inc
107 + echo "CFLAGS = ${MY_CFLAGS}" >> make.inc
108 + echo "CXXFLAGS = ${MY_CXXFLAGS}" >> make.inc
109 + echo "LD = $(tc-getLD)" >> make.inc
110 + echo "AR = ar" >> make.inc
111 + echo "LIB_SYS = " >> make.inc
112 + if use lapack; then
113 + echo "LIB_LPK = $(pkg-config --libs lapack)" >> make.inc
114 + else
115 + echo "LIB_LPK = lapack.a blas.a" >> make.inc
116 + fi
117 + echo "LIB_FFT = fftlib.a" >> make.inc
118 + if use libxc; then
119 + echo "LIB_XC = -L/usr/$(get_libdir) -lxc" >> make.inc
120 + echo "SRC_libxc = libxc_funcs.f90 libxc.f90 libxcifc.f90" >>make.inc
121 + fi
122 +}
123 +
124 +src_compile() {
125 + emake -j1 || die "make failed"
126 +}
127 +
128 +src_test() {
129 + emake test
130 +}
131 +
132 +src_install() {
133 + dobin src/elk src/eos/eos src/spacegroup/spacegroup utilities/elk-bands
134 + dodoc README
135 + for doc in docs/*; do
136 + dodoc $doc
137 + done
138 + insinto /usr/share/${P}
139 + doins -r species
140 + doins -r utilities
141 + doins -r examples
142 + doins -r tests
143 +}