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:38:36
Message-Id: 1441031873.6b87c500700e9c2ff4c39f41b804b36bfe5d1e65.nicolasbock@gentoo
1 commit: 6b87c500700e9c2ff4c39f41b804b36bfe5d1e65
2 Author: Nicolas Bock <nicolasbock <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 24 12:30:52 2015 +0000
4 Commit: Nicolas Bock <nicolasbock <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 31 14:37:53 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b87c500
7
8 sci-physics/lammps: Version bump.
9
10 sci-physics/lammps/Manifest | 1 +
11 sci-physics/lammps/lammps-20150821.ebuild | 267 ++++++++++++++++++++++++++++++
12 2 files changed, 268 insertions(+)
13
14 diff --git a/sci-physics/lammps/Manifest b/sci-physics/lammps/Manifest
15 index 7ef6a63..17bb0ea 100644
16 --- a/sci-physics/lammps/Manifest
17 +++ b/sci-physics/lammps/Manifest
18 @@ -5,6 +5,7 @@ DIST lammps-16Apr15.tar.gz 63842472 SHA256 65aecf6f25a055734ef113890a86ecbf7f847
19 DIST lammps-18Apr15.tar.gz 63883297 SHA256 4ce74978da738383a1d808a37481c3c43d4f8f44d919770b3f2cdd4fcf03345b SHA512 be088ec59b7fe495fff3cdfcc5ccb52d2705eec20deb5c8694a215943786652c9dc22a81ba48324707495c3f56c0c347af964d1952ae077c8db02258cf31387a WHIRLPOOL c90403147cc4eda5b4f581cd1bd18bcc8f45a73b1d0e51dcd64c52fc636116c9d57337b89b5753c86e1bbf386f8a2391a9813a6e32154a819f3e35cfc816b5e2
20 DIST lammps-18Aug15.tar.gz 87893731 SHA256 513237934cda7c1e026f4983096fd53cb510fadee12c55b13b4735086155245a SHA512 5816509f5b988dbe74c9f40a9faa42b3bcf260388dfe70703a1544517acd3f868d3bc398fb4c2fa7713d24409075d44ad80b8e91a25a28db783c2605aff30977 WHIRLPOOL 7022f3aabadffdfa2ef4c8219589e46fba2572d9ed4b52591f6516a61d4895b39d637d88535ba83881db5d48661e34ca6ff2f22a6819dbec015af979721a0f53
21 DIST lammps-18Jul15.tar.gz 66065642 SHA256 deb6625b7c21cf94fc7ee9aefb2edf55a6c8dc870e919028c9ffa1cd169d57ed SHA512 d26dd0084779e037af35bc26f81cdca5a7617f841860e6eab7d52f6c023d2c001075aad5dc3d656ceb6e92650589acc472fa5c8954fd9ab81ec0b737e377284b WHIRLPOOL 66794b7250cdb077bcbeb2b95a464aecc684f7592d81f3db4a3702195ef1d8404eb4b1f38e6c1dd859a42dd8ca1ebd039cbac4d9fd11be99a376168f2c498cdd
22 +DIST lammps-21Aug15.tar.gz 87096749 SHA256 46f68e7b61e50ab3e790c53cadd82fde7c7aa58aa73e8a3257f24facff2ed0a4 SHA512 b1dd90890c43a6cf55a57a61279dcc4c10fdedb4ad90f225a06c0e93eb139d30f2d56baa233c081b38adeeb0a8419a0315ccc4b0fa15c3ffbf7db626ca261e9d WHIRLPOOL a1d7d4ab30f9ecca3fd64216e729fef6fa1b3f7a6698b9eaf104bcbfa03a66862cd8c5882e94f73e841064d94bf030aaf569ebb457d89fbd345b391f9cee6822
23 DIST lammps-21Jul15.tar.gz 66715434 SHA256 2e24a7b6131a35ef83cec08f4dc9f7cc5188c59a630ba61f2a8ac3cfbd284ef7 SHA512 cbf39b3559ac60d5ad92299370bf9af76c0bd7fec62dbaa429d5127d561978426d16b03510b815ffeb6b0acdb362523809adf7ac3fbc2fea8cc484010b1ef7bc WHIRLPOOL 41df92b1f5baf52e846032f12c80f813b84fcd1c71f8c7dad5594780da154345d1b1bdea6b68f4c4b71029346d74d4ff3a813f1101437a01be65df7cf6d0d246
24 DIST lammps-22Jul15.tar.gz 67275212 SHA256 b75cdf8ead17f20433737c203c8d29c0cc3e157c9b3d175093467873aea0b869 SHA512 f6e5eaf3ca8bcd25a580a4608e0aec0021f2ed5eb23cf9ccd0a707cb8bc320568504ccffc25cccb5acfe2fc3515c58f8afc8936aea63acb3062bdc897a5eb2ee WHIRLPOOL 13c09e1045a0bdabe15e2125ccef0ea622cb12fcce63d8441b7f9843b8f1a3f7aa0c13908a2e215c1fdba8a579a17a5833111b5cf31a2471bf66e781ef281c59
25 DIST lammps-24Jul15.tar.gz 67180142 SHA256 bd183f7b073e1ca86656a8f6ea99195123ce3c7829c872ca45216da4132ff96d SHA512 e285a1f326658bd23f32ecf9409d9f0bf16ed635656bbcee0d84da58e1c008363c7815001bcaa5b7701d99b3318a56240b021447e94754607c2ceb178e377122 WHIRLPOOL 003237f8e9a7caec98aa1f8f0c5e03c0cda6d60f20460e32c4eea3c92707e349f4e1a71510f1290b6e6aeac1621951080f904b1bb2224c8eb9e25067206d2b1b
26
27 diff --git a/sci-physics/lammps/lammps-20150821.ebuild b/sci-physics/lammps/lammps-20150821.ebuild
28 new file mode 100644
29 index 0000000..1a244c8
30 --- /dev/null
31 +++ b/sci-physics/lammps/lammps-20150821.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 +}