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