Gentoo Archives: gentoo-commits

From: Nicolas Bock <nicolasbock@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-physics/lammps/
Date: Mon, 31 Aug 2015 14:40:44
Message-Id: 1441032012.3277d583c52240a79494bca8ef6e3df41e2dbeb9.nicolasbock@gentoo
1 commit: 3277d583c52240a79494bca8ef6e3df41e2dbeb9
2 Author: Nicolas Bock <nicolasbock <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 31 14:40:12 2015 +0000
4 Commit: Nicolas Bock <nicolasbock <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 31 14:40:12 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3277d583
7
8 sci-physics/lammps: Version bump.
9
10 Package-Manager: portage-2.2.20.1
11
12 sci-physics/lammps/Manifest | 1 +
13 sci-physics/lammps/lammps-20150829.ebuild | 267 ++++++++++++++++++++++++++++++
14 2 files changed, 268 insertions(+)
15
16 diff --git a/sci-physics/lammps/Manifest b/sci-physics/lammps/Manifest
17 index 17bb0ea..978a7fb 100644
18 --- a/sci-physics/lammps/Manifest
19 +++ b/sci-physics/lammps/Manifest
20 @@ -10,4 +10,5 @@ DIST lammps-21Jul15.tar.gz 66715434 SHA256 2e24a7b6131a35ef83cec08f4dc9f7cc5188c
21 DIST lammps-22Jul15.tar.gz 67275212 SHA256 b75cdf8ead17f20433737c203c8d29c0cc3e157c9b3d175093467873aea0b869 SHA512 f6e5eaf3ca8bcd25a580a4608e0aec0021f2ed5eb23cf9ccd0a707cb8bc320568504ccffc25cccb5acfe2fc3515c58f8afc8936aea63acb3062bdc897a5eb2ee WHIRLPOOL 13c09e1045a0bdabe15e2125ccef0ea622cb12fcce63d8441b7f9843b8f1a3f7aa0c13908a2e215c1fdba8a579a17a5833111b5cf31a2471bf66e781ef281c59
22 DIST lammps-24Jul15.tar.gz 67180142 SHA256 bd183f7b073e1ca86656a8f6ea99195123ce3c7829c872ca45216da4132ff96d SHA512 e285a1f326658bd23f32ecf9409d9f0bf16ed635656bbcee0d84da58e1c008363c7815001bcaa5b7701d99b3318a56240b021447e94754607c2ceb178e377122 WHIRLPOOL 003237f8e9a7caec98aa1f8f0c5e03c0cda6d60f20460e32c4eea3c92707e349f4e1a71510f1290b6e6aeac1621951080f904b1bb2224c8eb9e25067206d2b1b
23 DIST lammps-28Apr15.tar.gz 63883556 SHA256 6e7c32690cf8bb5a4fb147bab6029cc1d03594ec7b3ea3833e7dc89acc596d8a SHA512 414c786e8666cddd31a3200baedc76974371280dc219636914dd7863f03e32e11f637a9c184af78d8d4da22afe4cf734b6a0eb32c78d6f53ee95d796a3e080c0 WHIRLPOOL c57a91f9d5e977d26cdb2076b5bbd2f3b5791396c23b5326f16cc609b9646e80c602a492b312b4e5f78d1d638c4a6b66e9a49b1ced02274ad7202821a2884975
24 +DIST lammps-29Aug15.tar.gz 87253305 SHA256 fff69b47c40936d4ccd90a8443ce5bb1bcf4cb449ae06a5822c1b11a2ab2dd67 SHA512 991c56608a3288ebdcd2fb0857c595d42047b5ed0780b6d4ddb98388627499727b6c04fe0eff3e7221238dba2a8601f0b4b4067b5aa5ec2f356b4ee13f6c129c WHIRLPOOL 88da74fa65aeb187330439417512d516fe8adf4a5df4be48fdafafa198e8c4d657ecce7f04f749d77cb2f8a7881ac47f4604cf6bc8eb3ca8b2cbc7988d866a87
25 DIST lammps-30Apr15.tar.gz 63892754 SHA256 d4a193fd5aa9417ec9d15a3be1e2b149302aacf3d9321886a806b0f4ca91611e SHA512 889fc315719e6f50f802b72a8a0c6e6d7eedb84b67e8b39ae9ea93feb2d526914639848cbfbcbb6dd8b8718c3b332f617f001c6ef04fe14d0685106fcac821bd WHIRLPOOL a681662a0c37fcb701ced8f2cd4f085dfd0ff250faac2c62abd07b718e3bf12ddbf366f725fbc21bc4547e6ef3ca3042ee84571a1fa0277a4c3d7d273ccaa099
26
27 diff --git a/sci-physics/lammps/lammps-20150829.ebuild b/sci-physics/lammps/lammps-20150829.ebuild
28 new file mode 100644
29 index 0000000..1a244c8
30 --- /dev/null
31 +++ b/sci-physics/lammps/lammps-20150829.ebuild
32 @@ -0,0 +1,267 @@
33 +# Copyright 1999-2015 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +# $Id$
36 +
37 +EAPI=5
38 +
39 +PYTHON_COMPAT=( python{2_7,3_3} )
40 +
41 +inherit eutils flag-o-matic fortran-2 multilib python-r1
42 +
43 +convert_month() {
44 + case $1 in
45 + 01) echo Jan
46 + ;;
47 + 02) echo Feb
48 + ;;
49 + 03) echo Mar
50 + ;;
51 + 04) echo Apr
52 + ;;
53 + 05) echo May
54 + ;;
55 + 06) echo Jun
56 + ;;
57 + 07) echo Jul
58 + ;;
59 + 08) echo Aug
60 + ;;
61 + 09) echo Sep
62 + ;;
63 + 10) echo Oct
64 + ;;
65 + 11) echo Nov
66 + ;;
67 + 12) echo Dec
68 + ;;
69 + *) echo unknown
70 + ;;
71 + esac
72 +}
73 +
74 +MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
75 +
76 +DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
77 +HOMEPAGE="http://lammps.sandia.gov/"
78 +SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
79 +
80 +LICENSE="GPL-2"
81 +SLOT="0"
82 +KEYWORDS="~amd64 ~x86"
83 +IUSE="doc examples gzip lammps-memalign mpi python static-libs"
84 +
85 +DEPEND="
86 + mpi? (
87 + virtual/blas
88 + virtual/lapack
89 + virtual/mpi
90 + )
91 + gzip? ( app-arch/gzip )
92 + sci-libs/voro++
93 + python? ( ${PYTHON_DEPS} )
94 + "
95 +RDEPEND="${DEPEND}"
96 +
97 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
98 +
99 +S="${WORKDIR}/${MY_P}"
100 +
101 +lmp_emake() {
102 + local LAMMPS_INCLUDEFLAGS
103 + LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
104 + LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN=64' '')"
105 +
106 + # The lammps makefile uses CC to indicate the C++ compiler.
107 + emake \
108 + ARCHIVE=$(tc-getAR) \
109 + CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
110 + F90=$(usex mpi "mpif90" "$(tc-getFC)") \
111 + LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
112 + CCFLAGS="${CXXFLAGS}" \
113 + F90FLAGS="${FCFLAGS}" \
114 + LINKFLAGS="${LDFLAGS}" \
115 + LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
116 + MPI_INC=$(usex mpi "" "-I../STUBS") \
117 + MPI_PATH=$(usex mpi "" "-L../STUBS") \
118 + MPI_LIB=$(usex mpi "" "-lmpi_stubs") \
119 + user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
120 + "$@"
121 +}
122 +
123 +lmp_activate_packages() {
124 + # Build packages
125 + lmp_emake -C src yes-asphere
126 + lmp_emake -C src yes-body
127 + lmp_emake -C src yes-class2
128 + lmp_emake -C src yes-colloid
129 + lmp_emake -C src yes-coreshell
130 + lmp_emake -C src yes-dipole
131 + lmp_emake -C src yes-fld
132 + #lmp_emake -C src yes-gpu
133 + lmp_emake -C src yes-granular
134 + # Need OpenKIM external dependency.
135 + #lmp_emake -C src yes-kim
136 + # Need Kokkos external dependency.
137 + #lmp_emake -C src yes-kokkos
138 + lmp_emake -C src yes-kspace
139 + lmp_emake -C src yes-manybody
140 + lmp_emake -C src yes-mc
141 + lmp_emake -C src yes-meam
142 + lmp_emake -C src yes-misc
143 + lmp_emake -C src yes-molecule
144 + #lmp_emake -C src yes-mpiio
145 + lmp_emake -C src yes-opt
146 + lmp_emake -C src yes-peri
147 + lmp_emake -C src yes-poems
148 + lmp_emake -C src yes-qeq
149 + lmp_emake -C src yes-reax
150 + lmp_emake -C src yes-replica
151 + lmp_emake -C src yes-rigid
152 + lmp_emake -C src yes-shock
153 + lmp_emake -C src yes-snap
154 + lmp_emake -C src yes-srd
155 + lmp_emake -C src yes-voronoi
156 + lmp_emake -C src yes-xtc
157 +
158 + if use mpi; then
159 + lmp_emake -C src yes-user-atc
160 + fi
161 + lmp_emake -C src yes-user-eff
162 + lmp_emake -C src yes-user-fep
163 + use mpi && lmp_emake -C src yes-user-lb
164 + lmp_emake -C src yes-user-phonon
165 + lmp_emake -C src yes-user-sph
166 +}
167 +
168 +lmp_build_packages() {
169 + lmp_emake -C lib/meam -j1 -f Makefile.gfortran
170 + lmp_emake -C lib/poems -f Makefile.g++
171 + lmp_emake -C lib/reax -j1 -f Makefile.gfortran
172 + use mpi && lmp_emake -C lib/atc -f Makefile.g++
173 +}
174 +
175 +lmp_clean_packages() {
176 + lmp_emake -C lib/meam -f Makefile.gfortran clean
177 + lmp_emake -C lib/poems -f Makefile.g++ clean
178 + lmp_emake -C lib/reax -f Makefile.gfortran clean
179 + use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
180 +}
181 +
182 +src_prepare() {
183 + # Fix inconsistent use of SHFLAGS.
184 + sed -i \
185 + -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
186 + -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
187 + lib/voronoi/Makefile.lammps || die
188 +
189 + # Fix missing .so name.
190 + sed -i \
191 + -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
192 + src/MAKE/Makefile.serial || die
193 +
194 + # Fix makefile in tools.
195 + sed -i \
196 + -e 's:g++:$(CXX) $(CXXFLAGS):' \
197 + -e 's:gcc:$(CC) $(CCFLAGS):' \
198 + -e 's:ifort:$(FC) $(FCFLAGS):' \
199 + tools/Makefile || die
200 +
201 + # Patch python.
202 + epatch "${FILESDIR}/lammps-python3.patch"
203 + epatch "${FILESDIR}/python-shebang.patch"
204 +}
205 +
206 +src_compile() {
207 + # Fix atc...
208 + append-cxxflags -I../../src
209 +
210 + # Acticate packages.
211 + elog "Activating lammps packages..."
212 + lmp_activate_packages
213 +
214 + # Compile stubs for serial version.
215 + use mpi || lmp_emake -C src mpi-stubs
216 +
217 + elog "Building packages..."
218 + lmp_build_packages
219 +
220 + if use static-libs; then
221 + # Build static library.
222 + elog "Building static library..."
223 + lmp_emake -C src mode=lib serial
224 + fi
225 +
226 + # Clean out packages (that's not done by the build system with the clean
227 + # target), so we can rebuild the packages with -fPIC.
228 + elog "Cleaning packages..."
229 + lmp_clean_packages
230 +
231 + # The build system does not rebuild the packages with -fPIC, adding flag
232 + # manually.
233 + append-cxxflags -fPIC
234 + append-fflags -fPIC
235 +
236 + # Compile stubs for serial version.
237 + use mpi || lmp_emake -C src mpi-stubs
238 +
239 + elog "Building packages..."
240 + lmp_build_packages
241 +
242 + # Build shared library.
243 + elog "Building shared library..."
244 + lmp_emake -C src mode=shlib serial
245 +
246 + # Compile main executable. The shared library is always built, and
247 + # mode=shexe is simply a way to re-use the object files built in the
248 + # "shlib" step when linking the executable. The executable is not actually
249 + # using the shared library. If we have built the static library, then we
250 + # link that into the executable.
251 + elog "Linking executable..."
252 + if use static-libs; then
253 + lmp_emake -C src mode=exe serial
254 + else
255 + lmp_emake -C src mode=shexe serial
256 + fi
257 +
258 + # Compile tools.
259 + elog "Building tools..."
260 + lmp_emake -C tools binary2txt chain data2xmovie micelle2d
261 +}
262 +
263 +src_install() {
264 + use static-libs && newlib.a src/liblammps_serial.a liblammps.a
265 + newlib.so src/liblammps_serial.so liblammps.so.0.0.0
266 + dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
267 + dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
268 + newbin src/lmp_serial lmp
269 + dobin tools/binary2txt
270 + dobin tools/chain
271 + dobin tools/data2xmovie
272 + dobin tools/micelle2d
273 + # Don't forget to add header files of optional packages as they are added
274 + # to this ebuild. There may also be .mod files from Fortran based
275 + # packages.
276 + insinto "/usr/include/${PN}"
277 + doins -r src/*.h lib/meam/*.mod
278 +
279 + local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
280 + insinto "/${LAMMPS_POTENTIALS}"
281 + doins potentials/*
282 + echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
283 + doenvd 99lammps
284 +
285 + # Install python script.
286 + use python && python_foreach_impl python_domodule python/lammps.py
287 +
288 + if use examples; then
289 + local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
290 + insinto "${LAMMPS_EXAMPLES}"
291 + doins -r examples/*
292 + fi
293 +
294 + dodoc README
295 + if use doc; then
296 + dodoc doc/Manual.pdf
297 + dohtml -r doc/*
298 + fi
299 +}