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