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: Wed, 28 Oct 2015 12:11:40
Message-Id: 1446034270.1d2e24fed8135675a7ddafee37dad9b6f3d27add.nicolasbock@gentoo
1 commit: 1d2e24fed8135675a7ddafee37dad9b6f3d27add
2 Author: Nicolas Bock <nicolasbock <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 28 12:10:21 2015 +0000
4 Commit: Nicolas Bock <nicolasbock <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 28 12:11:10 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d2e24fe
7
8 sci-physics/lammps: Version bump.
9
10 Package-Manager: portage-2.2.20.1
11
12 sci-physics/lammps/Manifest | 2 +
13 sci-physics/lammps/lammps-20151023.ebuild | 241 ++++++++++++++++++++++++++++++
14 sci-physics/lammps/lammps-20151026.ebuild | 241 ++++++++++++++++++++++++++++++
15 3 files changed, 484 insertions(+)
16
17 diff --git a/sci-physics/lammps/Manifest b/sci-physics/lammps/Manifest
18 index 8d361b7..65e5628 100644
19 --- a/sci-physics/lammps/Manifest
20 +++ b/sci-physics/lammps/Manifest
21 @@ -5,7 +5,9 @@ DIST lammps-15May15.tar.gz 63835027 SHA256 0233ea98c7d77d31bd0a538bb674c0ee8f000
22 DIST lammps-18Aug15.tar.gz 87893731 SHA256 513237934cda7c1e026f4983096fd53cb510fadee12c55b13b4735086155245a SHA512 5816509f5b988dbe74c9f40a9faa42b3bcf260388dfe70703a1544517acd3f868d3bc398fb4c2fa7713d24409075d44ad80b8e91a25a28db783c2605aff30977 WHIRLPOOL 7022f3aabadffdfa2ef4c8219589e46fba2572d9ed4b52591f6516a61d4895b39d637d88535ba83881db5d48661e34ca6ff2f22a6819dbec015af979721a0f53
23 DIST lammps-21Aug15.tar.gz 87096749 SHA256 46f68e7b61e50ab3e790c53cadd82fde7c7aa58aa73e8a3257f24facff2ed0a4 SHA512 b1dd90890c43a6cf55a57a61279dcc4c10fdedb4ad90f225a06c0e93eb139d30f2d56baa233c081b38adeeb0a8419a0315ccc4b0fa15c3ffbf7db626ca261e9d WHIRLPOOL a1d7d4ab30f9ecca3fd64216e729fef6fa1b3f7a6698b9eaf104bcbfa03a66862cd8c5882e94f73e841064d94bf030aaf569ebb457d89fbd345b391f9cee6822
24 DIST lammps-22Oct15.tar.gz 87938562 SHA256 8376b52e8eef4d1c3628c15ff358ecf74303e308566f41fd055701f6af3b6484 SHA512 cbe61420cccd11cd444423214802dfd2d1b2b1b28511a53dbf22e993fa3592404e8dda29fcb7bcd4e6e2d1e2251ddc6f020d48bafa66c8fceaa27d4af2e21640 WHIRLPOOL 11d09b18ff742d6ac4fcb400df93d7ac29144ee554f7241e58da80d039a99ef23b4b81709170ed12215693de97b6b48c9a6967d7d0539fd7f2f172a1e0a83661
25 +DIST lammps-23Oct15.tar.gz 87933918 SHA256 3500cdeb22344c7f3a040834a232d6c5ddb9f601820794441fcc24dadedc49b6 SHA512 a26d214b3e7c47d63cf00a364753a829d1c8f0cf4f8b73e829a4463650303d6905b6c942df5890387413b44496c8615b286296b34df9181e54806bb2f361b39a WHIRLPOOL 9a2d6e8fb57f1af2969345d9b250ed1244d2e40c97d5e2994c0ef6225ca265b490809848faa7cdc29a3eaa7c51a6223320039863f6c382a1a51da6f474e52088
26 DIST lammps-24Sep15.tar.gz 87307191 SHA256 e03cdeb2b3b6107d98969febea26575c85590603ab4f79d26efc46bac6d6cc60 SHA512 356dd556f845cec456865062375120c0898cef1870617d80b31b0e8e964585140120b21f891cd9b40ecde7aaf43beb34d7b15396830e08273624a9b14da551e4 WHIRLPOOL 667b8aaf927d268c569a192c835b7dbdc80a0f25abb1f2c96007517ea218a69b2816dde4ebe28ca82974d01472c0e1126b67e89a19fb3ef49e4020f3d9c69fba
27 +DIST lammps-26Oct15.tar.gz 89265403 SHA256 c69356b3056881cbbb7eb659eb9cd4fc9d86e7f010502fe47c91ed865cbabea7 SHA512 738cd9fb7b11cb1e7304814ac4463d534f0a5dda1c70cc483d3c19b038c15cd61a2c03c6972cccc69afbe42d88bf01ef33d0972bba9516a840026891fc3f144a WHIRLPOOL c7c7882e32b026cdba0d5bceb1ecfa4127e77edeb9d567760e19d6103109fdf9cefe79a17fd6e3291d04347984cfdb1a999136ead0be20f0173a73e53f106d95
28 DIST lammps-29Aug15.tar.gz 87253305 SHA256 fff69b47c40936d4ccd90a8443ce5bb1bcf4cb449ae06a5822c1b11a2ab2dd67 SHA512 991c56608a3288ebdcd2fb0857c595d42047b5ed0780b6d4ddb98388627499727b6c04fe0eff3e7221238dba2a8601f0b4b4067b5aa5ec2f356b4ee13f6c129c WHIRLPOOL 88da74fa65aeb187330439417512d516fe8adf4a5df4be48fdafafa198e8c4d657ecce7f04f749d77cb2f8a7881ac47f4604cf6bc8eb3ca8b2cbc7988d866a87
29 DIST lammps-4Sep15.tar.gz 87259558 SHA256 8652c801e4ce8b6b7d42a6c71f76b68a6e741dc8efb8d7d3dad36b624fe8f150 SHA512 ee730c8bd96e14931192a68c12e4ebde301cc3525b20816d051059f155b70c6edcea7dc2ed911e0b89685d751cd5a74b4bb5eedd6c16a042a2191bf8a9665fc9 WHIRLPOOL 271ac0d74e03d3e3e118a8b2385d98ce3f566ead67f1c329a219c265f886dc267b11be17c2caa52749ebac212bbc7456fba2d0d6ec69cd25815316e601b3360a
30 DIST lammps-5Oct15.tar.gz 88451532 SHA256 a76f92ae05b99f9257abf7d79d9365c5743fa5a16b941a5e40f74036c5879211 SHA512 e0a034778cd5e3b9a27c9fc6257f1f7a6a9161732cd83bac2c4b0f82c39d5a6a385bb4640322478bfbe9467afb28b998cd19108b3d4a21e369b80c39a486e065 WHIRLPOOL 291e7820d4736421aeda9a1295854bd7b52d8ca3f14900e9394373410ee5db02ad6ab53991cf4dc8e73328b24fa44659d10693aca7cb48301227299ad622ce31
31
32 diff --git a/sci-physics/lammps/lammps-20151023.ebuild b/sci-physics/lammps/lammps-20151023.ebuild
33 new file mode 100644
34 index 0000000..39fd779
35 --- /dev/null
36 +++ b/sci-physics/lammps/lammps-20151023.ebuild
37 @@ -0,0 +1,241 @@
38 +# Copyright 1999-2015 Gentoo Foundation
39 +# Distributed under the terms of the GNU General Public License v2
40 +# $Id$
41 +
42 +EAPI=5
43 +
44 +PYTHON_COMPAT=( python{2_7,3_3} )
45 +
46 +inherit eutils flag-o-matic fortran-2 multilib python-r1
47 +
48 +convert_month() {
49 + local months=( "" Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec )
50 + echo ${months[${1#0}]}
51 +}
52 +
53 +MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
54 +
55 +DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
56 +HOMEPAGE="http://lammps.sandia.gov/"
57 +SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
58 +
59 +LICENSE="GPL-2"
60 +SLOT="0"
61 +KEYWORDS="~amd64 ~x86"
62 +IUSE="doc examples gzip lammps-memalign mpi python static-libs"
63 +
64 +DEPEND="
65 + mpi? (
66 + virtual/blas
67 + virtual/lapack
68 + virtual/mpi
69 + )
70 + gzip? ( app-arch/gzip )
71 + sci-libs/voro++
72 + python? ( ${PYTHON_DEPS} )
73 + "
74 +RDEPEND="${DEPEND}"
75 +
76 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
77 +
78 +S="${WORKDIR}/${MY_P}"
79 +
80 +lmp_emake() {
81 + local LAMMPS_INCLUDEFLAGS
82 + LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
83 + LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN=64' '')"
84 +
85 + # The lammps makefile uses CC to indicate the C++ compiler.
86 + emake \
87 + ARCHIVE=$(tc-getAR) \
88 + CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
89 + F90=$(usex mpi "mpif90" "$(tc-getFC)") \
90 + LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
91 + CCFLAGS="${CXXFLAGS}" \
92 + F90FLAGS="${FCFLAGS}" \
93 + LINKFLAGS="${LDFLAGS}" \
94 + LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
95 + MPI_INC=$(usex mpi "" "-I../STUBS") \
96 + MPI_PATH=$(usex mpi "" "-L../STUBS") \
97 + MPI_LIB=$(usex mpi "" "-lmpi_stubs") \
98 + user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
99 + "$@"
100 +}
101 +
102 +lmp_activate_packages() {
103 + # Build packages
104 + lmp_emake -C src yes-asphere
105 + lmp_emake -C src yes-body
106 + lmp_emake -C src yes-class2
107 + lmp_emake -C src yes-colloid
108 + lmp_emake -C src yes-coreshell
109 + lmp_emake -C src yes-dipole
110 + lmp_emake -C src yes-fld
111 + #lmp_emake -C src yes-gpu
112 + lmp_emake -C src yes-granular
113 + # Need OpenKIM external dependency.
114 + #lmp_emake -C src yes-kim
115 + # Need Kokkos external dependency.
116 + #lmp_emake -C src yes-kokkos
117 + lmp_emake -C src yes-kspace
118 + lmp_emake -C src yes-manybody
119 + lmp_emake -C src yes-mc
120 + lmp_emake -C src yes-meam
121 + lmp_emake -C src yes-misc
122 + lmp_emake -C src yes-molecule
123 + #lmp_emake -C src yes-mpiio
124 + lmp_emake -C src yes-opt
125 + lmp_emake -C src yes-peri
126 + lmp_emake -C src yes-poems
127 + lmp_emake -C src yes-qeq
128 + lmp_emake -C src yes-reax
129 + lmp_emake -C src yes-replica
130 + lmp_emake -C src yes-rigid
131 + lmp_emake -C src yes-shock
132 + lmp_emake -C src yes-snap
133 + lmp_emake -C src yes-srd
134 + lmp_emake -C src yes-voronoi
135 + lmp_emake -C src yes-xtc
136 +
137 + if use mpi; then
138 + lmp_emake -C src yes-user-atc
139 + fi
140 + lmp_emake -C src yes-user-eff
141 + lmp_emake -C src yes-user-fep
142 + use mpi && lmp_emake -C src yes-user-lb
143 + lmp_emake -C src yes-user-phonon
144 + lmp_emake -C src yes-user-sph
145 +}
146 +
147 +lmp_build_packages() {
148 + lmp_emake -C lib/meam -j1 -f Makefile.gfortran
149 + lmp_emake -C lib/poems -f Makefile.g++
150 + lmp_emake -C lib/reax -j1 -f Makefile.gfortran
151 + use mpi && lmp_emake -C lib/atc -f Makefile.g++
152 +}
153 +
154 +lmp_clean_packages() {
155 + lmp_emake -C lib/meam -f Makefile.gfortran clean
156 + lmp_emake -C lib/poems -f Makefile.g++ clean
157 + lmp_emake -C lib/reax -f Makefile.gfortran clean
158 + use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
159 +}
160 +
161 +src_prepare() {
162 + # Fix inconsistent use of SHFLAGS.
163 + sed -i \
164 + -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
165 + -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
166 + lib/voronoi/Makefile.lammps || die
167 +
168 + # Fix missing .so name.
169 + sed -i \
170 + -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
171 + src/MAKE/Makefile.serial || die
172 +
173 + # Fix makefile in tools.
174 + sed -i \
175 + -e 's:g++:$(CXX) $(CXXFLAGS):' \
176 + -e 's:gcc:$(CC) $(CCFLAGS):' \
177 + -e 's:ifort:$(FC) $(FCFLAGS):' \
178 + tools/Makefile || die
179 +
180 + # Patch python.
181 + epatch "${FILESDIR}/lammps-python3-r1.patch"
182 + epatch "${FILESDIR}/python-shebang.patch"
183 +}
184 +
185 +src_compile() {
186 + # Fix atc...
187 + append-cxxflags -I../../src
188 +
189 + # Acticate packages.
190 + elog "Activating lammps packages..."
191 + lmp_activate_packages
192 +
193 + # Compile stubs for serial version.
194 + use mpi || lmp_emake -C src mpi-stubs
195 +
196 + elog "Building packages..."
197 + lmp_build_packages
198 +
199 + if use static-libs; then
200 + # Build static library.
201 + elog "Building static library..."
202 + lmp_emake -C src mode=lib serial
203 + fi
204 +
205 + # Clean out packages (that's not done by the build system with the clean
206 + # target), so we can rebuild the packages with -fPIC.
207 + elog "Cleaning packages..."
208 + lmp_clean_packages
209 +
210 + # The build system does not rebuild the packages with -fPIC, adding flag
211 + # manually.
212 + append-cxxflags -fPIC
213 + append-fflags -fPIC
214 +
215 + # Compile stubs for serial version.
216 + use mpi || lmp_emake -C src mpi-stubs
217 +
218 + elog "Building packages..."
219 + lmp_build_packages
220 +
221 + # Build shared library.
222 + elog "Building shared library..."
223 + lmp_emake -C src mode=shlib serial
224 +
225 + # Compile main executable. The shared library is always built, and
226 + # mode=shexe is simply a way to re-use the object files built in the
227 + # "shlib" step when linking the executable. The executable is not actually
228 + # using the shared library. If we have built the static library, then we
229 + # link that into the executable.
230 + elog "Linking executable..."
231 + if use static-libs; then
232 + lmp_emake -C src mode=exe serial
233 + else
234 + lmp_emake -C src mode=shexe serial
235 + fi
236 +
237 + # Compile tools.
238 + elog "Building tools..."
239 + lmp_emake -C tools binary2txt chain data2xmovie micelle2d
240 +}
241 +
242 +src_install() {
243 + use static-libs && newlib.a src/liblammps_serial.a liblammps.a
244 + newlib.so src/liblammps_serial.so liblammps.so.0.0.0
245 + dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
246 + dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
247 + newbin src/lmp_serial lmp
248 + dobin tools/binary2txt
249 + dobin tools/chain
250 + dobin tools/data2xmovie
251 + dobin tools/micelle2d
252 + # Don't forget to add header files of optional packages as they are added
253 + # to this ebuild. There may also be .mod files from Fortran based
254 + # packages.
255 + insinto "/usr/include/${PN}"
256 + doins -r src/*.h lib/meam/*.mod
257 +
258 + local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
259 + insinto "/${LAMMPS_POTENTIALS}"
260 + doins potentials/*
261 + echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
262 + doenvd 99lammps
263 +
264 + # Install python script.
265 + use python && python_foreach_impl python_domodule python/lammps.py
266 +
267 + if use examples; then
268 + local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
269 + insinto "${LAMMPS_EXAMPLES}"
270 + doins -r examples/*
271 + fi
272 +
273 + dodoc README
274 + if use doc; then
275 + dodoc doc/Manual.pdf
276 + dohtml -r doc/*
277 + fi
278 +}
279
280 diff --git a/sci-physics/lammps/lammps-20151026.ebuild b/sci-physics/lammps/lammps-20151026.ebuild
281 new file mode 100644
282 index 0000000..39fd779
283 --- /dev/null
284 +++ b/sci-physics/lammps/lammps-20151026.ebuild
285 @@ -0,0 +1,241 @@
286 +# Copyright 1999-2015 Gentoo Foundation
287 +# Distributed under the terms of the GNU General Public License v2
288 +# $Id$
289 +
290 +EAPI=5
291 +
292 +PYTHON_COMPAT=( python{2_7,3_3} )
293 +
294 +inherit eutils flag-o-matic fortran-2 multilib python-r1
295 +
296 +convert_month() {
297 + local months=( "" Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec )
298 + echo ${months[${1#0}]}
299 +}
300 +
301 +MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
302 +
303 +DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
304 +HOMEPAGE="http://lammps.sandia.gov/"
305 +SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
306 +
307 +LICENSE="GPL-2"
308 +SLOT="0"
309 +KEYWORDS="~amd64 ~x86"
310 +IUSE="doc examples gzip lammps-memalign mpi python static-libs"
311 +
312 +DEPEND="
313 + mpi? (
314 + virtual/blas
315 + virtual/lapack
316 + virtual/mpi
317 + )
318 + gzip? ( app-arch/gzip )
319 + sci-libs/voro++
320 + python? ( ${PYTHON_DEPS} )
321 + "
322 +RDEPEND="${DEPEND}"
323 +
324 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
325 +
326 +S="${WORKDIR}/${MY_P}"
327 +
328 +lmp_emake() {
329 + local LAMMPS_INCLUDEFLAGS
330 + LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
331 + LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN=64' '')"
332 +
333 + # The lammps makefile uses CC to indicate the C++ compiler.
334 + emake \
335 + ARCHIVE=$(tc-getAR) \
336 + CC=$(usex mpi "mpic++" "$(tc-getCXX)") \
337 + F90=$(usex mpi "mpif90" "$(tc-getFC)") \
338 + LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \
339 + CCFLAGS="${CXXFLAGS}" \
340 + F90FLAGS="${FCFLAGS}" \
341 + LINKFLAGS="${LDFLAGS}" \
342 + LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
343 + MPI_INC=$(usex mpi "" "-I../STUBS") \
344 + MPI_PATH=$(usex mpi "" "-L../STUBS") \
345 + MPI_LIB=$(usex mpi "" "-lmpi_stubs") \
346 + user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
347 + "$@"
348 +}
349 +
350 +lmp_activate_packages() {
351 + # Build packages
352 + lmp_emake -C src yes-asphere
353 + lmp_emake -C src yes-body
354 + lmp_emake -C src yes-class2
355 + lmp_emake -C src yes-colloid
356 + lmp_emake -C src yes-coreshell
357 + lmp_emake -C src yes-dipole
358 + lmp_emake -C src yes-fld
359 + #lmp_emake -C src yes-gpu
360 + lmp_emake -C src yes-granular
361 + # Need OpenKIM external dependency.
362 + #lmp_emake -C src yes-kim
363 + # Need Kokkos external dependency.
364 + #lmp_emake -C src yes-kokkos
365 + lmp_emake -C src yes-kspace
366 + lmp_emake -C src yes-manybody
367 + lmp_emake -C src yes-mc
368 + lmp_emake -C src yes-meam
369 + lmp_emake -C src yes-misc
370 + lmp_emake -C src yes-molecule
371 + #lmp_emake -C src yes-mpiio
372 + lmp_emake -C src yes-opt
373 + lmp_emake -C src yes-peri
374 + lmp_emake -C src yes-poems
375 + lmp_emake -C src yes-qeq
376 + lmp_emake -C src yes-reax
377 + lmp_emake -C src yes-replica
378 + lmp_emake -C src yes-rigid
379 + lmp_emake -C src yes-shock
380 + lmp_emake -C src yes-snap
381 + lmp_emake -C src yes-srd
382 + lmp_emake -C src yes-voronoi
383 + lmp_emake -C src yes-xtc
384 +
385 + if use mpi; then
386 + lmp_emake -C src yes-user-atc
387 + fi
388 + lmp_emake -C src yes-user-eff
389 + lmp_emake -C src yes-user-fep
390 + use mpi && lmp_emake -C src yes-user-lb
391 + lmp_emake -C src yes-user-phonon
392 + lmp_emake -C src yes-user-sph
393 +}
394 +
395 +lmp_build_packages() {
396 + lmp_emake -C lib/meam -j1 -f Makefile.gfortran
397 + lmp_emake -C lib/poems -f Makefile.g++
398 + lmp_emake -C lib/reax -j1 -f Makefile.gfortran
399 + use mpi && lmp_emake -C lib/atc -f Makefile.g++
400 +}
401 +
402 +lmp_clean_packages() {
403 + lmp_emake -C lib/meam -f Makefile.gfortran clean
404 + lmp_emake -C lib/poems -f Makefile.g++ clean
405 + lmp_emake -C lib/reax -f Makefile.gfortran clean
406 + use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
407 +}
408 +
409 +src_prepare() {
410 + # Fix inconsistent use of SHFLAGS.
411 + sed -i \
412 + -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
413 + -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
414 + lib/voronoi/Makefile.lammps || die
415 +
416 + # Fix missing .so name.
417 + sed -i \
418 + -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
419 + src/MAKE/Makefile.serial || die
420 +
421 + # Fix makefile in tools.
422 + sed -i \
423 + -e 's:g++:$(CXX) $(CXXFLAGS):' \
424 + -e 's:gcc:$(CC) $(CCFLAGS):' \
425 + -e 's:ifort:$(FC) $(FCFLAGS):' \
426 + tools/Makefile || die
427 +
428 + # Patch python.
429 + epatch "${FILESDIR}/lammps-python3-r1.patch"
430 + epatch "${FILESDIR}/python-shebang.patch"
431 +}
432 +
433 +src_compile() {
434 + # Fix atc...
435 + append-cxxflags -I../../src
436 +
437 + # Acticate packages.
438 + elog "Activating lammps packages..."
439 + lmp_activate_packages
440 +
441 + # Compile stubs for serial version.
442 + use mpi || lmp_emake -C src mpi-stubs
443 +
444 + elog "Building packages..."
445 + lmp_build_packages
446 +
447 + if use static-libs; then
448 + # Build static library.
449 + elog "Building static library..."
450 + lmp_emake -C src mode=lib serial
451 + fi
452 +
453 + # Clean out packages (that's not done by the build system with the clean
454 + # target), so we can rebuild the packages with -fPIC.
455 + elog "Cleaning packages..."
456 + lmp_clean_packages
457 +
458 + # The build system does not rebuild the packages with -fPIC, adding flag
459 + # manually.
460 + append-cxxflags -fPIC
461 + append-fflags -fPIC
462 +
463 + # Compile stubs for serial version.
464 + use mpi || lmp_emake -C src mpi-stubs
465 +
466 + elog "Building packages..."
467 + lmp_build_packages
468 +
469 + # Build shared library.
470 + elog "Building shared library..."
471 + lmp_emake -C src mode=shlib serial
472 +
473 + # Compile main executable. The shared library is always built, and
474 + # mode=shexe is simply a way to re-use the object files built in the
475 + # "shlib" step when linking the executable. The executable is not actually
476 + # using the shared library. If we have built the static library, then we
477 + # link that into the executable.
478 + elog "Linking executable..."
479 + if use static-libs; then
480 + lmp_emake -C src mode=exe serial
481 + else
482 + lmp_emake -C src mode=shexe serial
483 + fi
484 +
485 + # Compile tools.
486 + elog "Building tools..."
487 + lmp_emake -C tools binary2txt chain data2xmovie micelle2d
488 +}
489 +
490 +src_install() {
491 + use static-libs && newlib.a src/liblammps_serial.a liblammps.a
492 + newlib.so src/liblammps_serial.so liblammps.so.0.0.0
493 + dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
494 + dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
495 + newbin src/lmp_serial lmp
496 + dobin tools/binary2txt
497 + dobin tools/chain
498 + dobin tools/data2xmovie
499 + dobin tools/micelle2d
500 + # Don't forget to add header files of optional packages as they are added
501 + # to this ebuild. There may also be .mod files from Fortran based
502 + # packages.
503 + insinto "/usr/include/${PN}"
504 + doins -r src/*.h lib/meam/*.mod
505 +
506 + local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
507 + insinto "/${LAMMPS_POTENTIALS}"
508 + doins potentials/*
509 + echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
510 + doenvd 99lammps
511 +
512 + # Install python script.
513 + use python && python_foreach_impl python_domodule python/lammps.py
514 +
515 + if use examples; then
516 + local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
517 + insinto "${LAMMPS_EXAMPLES}"
518 + doins -r examples/*
519 + fi
520 +
521 + dodoc README
522 + if use doc; then
523 + dodoc doc/Manual.pdf
524 + dohtml -r doc/*
525 + fi
526 +}