Gentoo Archives: gentoo-commits

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