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: Thu, 17 Dec 2015 15:13:23
Message-Id: 1450365181.7ef51291018b4ac018b40fc36574900264285a53.nicolasbock@gentoo
1 commit: 7ef51291018b4ac018b40fc36574900264285a53
2 Author: Nicolas Bock <nicolasbock <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 17 15:12:28 2015 +0000
4 Commit: Nicolas Bock <nicolasbock <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 17 15:13:01 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ef51291
7
8 sci-physics/lammps: Version bump
9
10 Package-Manager: portage-2.2.24
11
12 sci-physics/lammps/Manifest | 1 +
13 sci-physics/lammps/lammps-20151211.ebuild | 217 ++++++++++++++++++++++++++++++
14 2 files changed, 218 insertions(+)
15
16 diff --git a/sci-physics/lammps/Manifest b/sci-physics/lammps/Manifest
17 index a8d944c..feecc9a 100644
18 --- a/sci-physics/lammps/Manifest
19 +++ b/sci-physics/lammps/Manifest
20 @@ -1,5 +1,6 @@
21 DIST lammps-10Aug15.tar.gz 87890369 SHA256 450a765f94b70a6f38637854f1d7496dca98d359414c527f8de99bed1fdd94d2 SHA512 fc395cf7e59de7e71bad64e2500224d33ff0f76bb79530fdcde5ec9879b91c332d1421a25e5d5bb9cc47a55745e760d01b2ac8ad29f9e71c8a90a0ace9212618 WHIRLPOOL 3f50513137283f4deb9b6a2c13a7ba63814b0ddd59d33e428fba9d3f94f61baa1b3b9d9d080982453a7828d2a98e619cded4d27716fd165db595832a157c9f6b
22 DIST lammps-10Feb15.tar.gz 62912048 SHA256 59373e9b5592f7b697a144bbce1fb742726e03536b7bb355dac7a9e013ddf9b8 SHA512 a7804377a23f03f338bdaf443439dffcdc52293b4c45e6369b340a1107510fed0b8a198e3b5afcff2e04e109985b52ee62e7b28276697bae37ac6f783d1ab9f2 WHIRLPOOL 09f29cadf8b072d388abe45ec219341d2a14a6c9cc9e4010a0f7945e930e9984738f7837748d117ab95ca76ce0c8d9160fe88dcec17e8d21b81f385dec8f7005
23 +DIST lammps-11Dec15.tar.gz 82386057 SHA256 f95cce2efa5f9d5649de22c19c96281f3af7b0f65a1f051a268131fe526542d9 SHA512 dce3c29811ee25b8404774b69d7e9746535bed5c4ae9a1c21aaf6979e411bb4b777ca95a4f788d16f6093785e074dbc5275c2d99b1c1d6a28aa0706069855a77 WHIRLPOOL a0b7fcf202745d22511ced803c8bc55b0487a8cdb2c32a0c9a121569a7e5641b072ccbcc70ef7a1529da736d6166d6d2afd80769fc84fc4f07af25b023710a57
24 DIST lammps-11Sep15.tar.gz 87274144 SHA256 79a40bc395a9052345cf1c7caa8da69f6ec0603e0be09503b060c51672a9734f SHA512 a478470d6e90c870dad606649009c085451d3890632dfc05a84890ff9d69e8465eff52d4853b4dc4a82ebcb15074c8f2fd07bbde132404a01c1c5df0867ee3f2 WHIRLPOOL 21225df1baadd02dbdc9f0b7aea6a2323ac1a1ac177453b67d5387b87a711e505395d17efada9ca5d079d919842da69c6d41d9a3a6ec6375d8526c3ed32f8ad3
25 DIST lammps-15May15.tar.gz 63835027 SHA256 0233ea98c7d77d31bd0a538bb674c0ee8f000f1d0ee1b8c049072873192aa228 SHA512 a23c16b98117590b15ca7662b878fb2f76ec41399c329c98deb48e28a0ffce293443269513a96c2503389894b598787b19dadc210d4b4dbc6a7432caf633e7d1 WHIRLPOOL 4c4edfd772bbf534e42fc43e1feaf3b8f76e74c58ec1e985e3c29ee0d8e64aa8c501b8e45e078643409c320a1d834b0d5eb699e7d1ec29df06be0126d12492f1
26 DIST lammps-20Nov15.tar.gz 90227651 SHA256 7c392c848e73335226b2fef6bb8034b1152f91862d955a3bae00502bf9d8e8fe SHA512 4bff70e45fb30be10a33b4c6c60b73cceddf8d42588b0630b4802f1e61dea3c237c01c3667585ad210ef2cdb811491b1b8495718a90bb57853c58245e29d1fe4 WHIRLPOOL a01f54911a5edb666ef5af5302cf60d61d58d20f2112578e4d7bd16787b2bf59da09e9fe7ffa021fb6a97db40b23301ed77010f48a05e5471742c0e71413b7e1
27
28 diff --git a/sci-physics/lammps/lammps-20151211.ebuild b/sci-physics/lammps/lammps-20151211.ebuild
29 new file mode 100644
30 index 0000000..e692e6f
31 --- /dev/null
32 +++ b/sci-physics/lammps/lammps-20151211.ebuild
33 @@ -0,0 +1,217 @@
34 +# Copyright 1999-2015 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +# $Id$
37 +
38 +EAPI=5
39 +
40 +PYTHON_COMPAT=( python{2_7,3_3,3_4} )
41 +
42 +inherit eutils flag-o-matic fortran-2 multilib python-r1
43 +
44 +convert_month() {
45 + local months=( "" Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec )
46 + echo ${months[${1#0}]}
47 +}
48 +
49 +MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2}
50 +
51 +DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
52 +HOMEPAGE="http://lammps.sandia.gov/"
53 +SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz"
54 +
55 +LICENSE="GPL-2"
56 +SLOT="0"
57 +KEYWORDS="~amd64 ~x86"
58 +IUSE="doc examples gzip lammps-memalign mpi python static-libs"
59 +
60 +DEPEND="
61 + mpi? (
62 + virtual/blas
63 + virtual/lapack
64 + virtual/mpi
65 + )
66 + gzip? ( app-arch/gzip )
67 + sci-libs/voro++
68 + python? ( ${PYTHON_DEPS} )
69 + "
70 +RDEPEND="${DEPEND}"
71 +
72 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
73 +
74 +S="${WORKDIR}/${MY_P}"
75 +
76 +lmp_emake() {
77 + local LAMMPS_INCLUDEFLAGS
78 + LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')"
79 + LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN=64' '')"
80 +
81 + # The lammps makefile uses CC to indicate the C++ compiler.
82 + emake \
83 + ARCHIVE="$(tc-getAR)" \
84 + CC="$(usex mpi "mpic++" "$(tc-getCXX)")" \
85 + F90="$(usex mpi "mpif90" "$(tc-getFC)")" \
86 + LINK="$(usex mpi "mpic++" "$(tc-getCXX)")" \
87 + CCFLAGS="${CXXFLAGS}" \
88 + F90FLAGS="${FCFLAGS}" \
89 + LINKFLAGS="${LDFLAGS}" \
90 + LMP_INC="${LAMMPS_INCLUDEFLAGS}" \
91 + MPI_INC="$(usex mpi "" "-I../STUBS")" \
92 + MPI_PATH="$(usex mpi "" "-L../STUBS")" \
93 + MPI_LIB="$(usex mpi "" "-lmpi_stubs")" \
94 + user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\
95 + "$@"
96 +}
97 +
98 +lmp_activate_packages() {
99 + # Build packages
100 + local packages=( yes-asphere yes-body yes-class2 yes-colloid \
101 + yes-coreshell yes-dipole yes-fld yes-granular yes-kspace \
102 + yes-manybody yes-mc yes-meam yes-misc \
103 + $(usex mpi "yes-user-atc" "") \
104 + yes-molecule yes-opt yes-peri yes-poems yes-qeq yes-reax \
105 + yes-replica yes-rigid yes-shock yes-snap yes-srd \
106 + yes-user-eff yes-user-fep \
107 + $(usex mpi "yes-user-lb" "") \
108 + yes-user-phonon yes-user-sph yes-voronoi yes-xtc )
109 +
110 + for p in ${packages[@]}; do
111 + lmp_emake -C src ${p}
112 + done
113 +}
114 +
115 +lmp_build_packages() {
116 + lmp_emake -C lib/meam -j1 -f Makefile.gfortran
117 + lmp_emake -C lib/poems -f Makefile.g++
118 + lmp_emake -C lib/reax -j1 -f Makefile.gfortran
119 + use mpi && lmp_emake -C lib/atc -f Makefile.g++
120 +}
121 +
122 +lmp_clean_packages() {
123 + lmp_emake -C lib/meam -f Makefile.gfortran clean
124 + lmp_emake -C lib/poems -f Makefile.g++ clean
125 + lmp_emake -C lib/reax -f Makefile.gfortran clean
126 + use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean
127 +}
128 +
129 +src_prepare() {
130 + # Fix inconsistent use of SHFLAGS.
131 + sed -i \
132 + -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \
133 + -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \
134 + lib/voronoi/Makefile.lammps || die
135 +
136 + # Fix missing .so name.
137 + sed -i \
138 + -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \
139 + src/MAKE/Makefile.serial || die
140 +
141 + # Fix makefile in tools.
142 + sed -i \
143 + -e 's:g++:$(CXX) $(CXXFLAGS):' \
144 + -e 's:gcc:$(CC) $(CCFLAGS):' \
145 + -e 's:ifort:$(FC) $(FCFLAGS):' \
146 + tools/Makefile || die
147 +
148 + # Patch python.
149 + epatch "${FILESDIR}/lammps-python3-r1.patch"
150 + epatch "${FILESDIR}/python-shebang.patch"
151 +}
152 +
153 +src_compile() {
154 + # Fix atc...
155 + append-cxxflags -I../../src
156 +
157 + # Acticate packages.
158 + elog "Activating lammps packages..."
159 + lmp_activate_packages
160 +
161 + # STUBS/mpi.c is using '#include <mpi.h>' now instead of '#include
162 + # "mpi.h"' which requires an additional '-I.'.
163 + append-cxxflags -I.
164 +
165 + # Compile stubs for serial version.
166 + use mpi || lmp_emake -C src mpi-stubs
167 +
168 + elog "Building packages..."
169 + lmp_build_packages
170 +
171 + if use static-libs; then
172 + # Build static library.
173 + elog "Building static library..."
174 + lmp_emake -C src mode=lib serial
175 + fi
176 +
177 + # Clean out packages (that's not done by the build system with the clean
178 + # target), so we can rebuild the packages with -fPIC.
179 + elog "Cleaning packages..."
180 + lmp_clean_packages
181 +
182 + # The build system does not rebuild the packages with -fPIC, adding flag
183 + # manually.
184 + append-cxxflags -fPIC
185 + append-fflags -fPIC
186 +
187 + # Compile stubs for serial version.
188 + use mpi || lmp_emake -C src mpi-stubs
189 +
190 + elog "Building packages..."
191 + lmp_build_packages
192 +
193 + # Build shared library.
194 + elog "Building shared library..."
195 + lmp_emake -C src mode=shlib serial
196 +
197 + # Compile main executable. The shared library is always built, and
198 + # mode=shexe is simply a way to re-use the object files built in the
199 + # "shlib" step when linking the executable. The executable is not actually
200 + # using the shared library. If we have built the static library, then we
201 + # link that into the executable.
202 + elog "Linking executable..."
203 + if use static-libs; then
204 + lmp_emake -C src mode=exe serial
205 + else
206 + lmp_emake -C src mode=shexe serial
207 + fi
208 +
209 + # Compile tools.
210 + elog "Building tools..."
211 + lmp_emake -C tools binary2txt chain data2xmovie micelle2d
212 +}
213 +
214 +src_install() {
215 + use static-libs && newlib.a src/liblammps_serial.a liblammps.a
216 + newlib.so src/liblammps_serial.so liblammps.so.0.0.0
217 + dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so
218 + dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0
219 + newbin src/lmp_serial lmp
220 + dobin tools/binary2txt
221 + dobin tools/chain
222 + dobin tools/data2xmovie
223 + dobin tools/micelle2d
224 + # Don't forget to add header files of optional packages as they are added
225 + # to this ebuild. There may also be .mod files from Fortran based
226 + # packages.
227 + insinto "/usr/include/${PN}"
228 + doins -r src/*.h lib/meam/*.mod
229 +
230 + local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
231 + insinto "/${LAMMPS_POTENTIALS}"
232 + doins potentials/*
233 + echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
234 + doenvd 99lammps
235 +
236 + # Install python script.
237 + use python && python_foreach_impl python_domodule python/lammps.py
238 +
239 + if use examples; then
240 + local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
241 + insinto "${LAMMPS_EXAMPLES}"
242 + doins -r examples/*
243 + fi
244 +
245 + dodoc README
246 + if use doc; then
247 + dodoc doc/Manual.pdf
248 + dohtml -r doc/*
249 + fi
250 +}