diff options
author | 2015-07-24 12:22:26 +0000 | |
---|---|---|
committer | 2015-07-24 12:22:26 +0000 | |
commit | c04817db84193dce800c632bad794826c9545cce (patch) | |
tree | c139035303e5f8830cb1901434e7ffc76ee084b7 /sci-physics | |
parent | ia64 stable wrt bug #552408 (diff) | |
download | historical-c04817db84193dce800c632bad794826c9545cce.tar.gz historical-c04817db84193dce800c632bad794826c9545cce.tar.bz2 historical-c04817db84193dce800c632bad794826c9545cce.zip |
Version bump.
Package-Manager: portage-2.2.18/cvs/Linux x86_64
Manifest-Sign-Key: 0xAC91CA52
Diffstat (limited to 'sci-physics')
-rw-r--r-- | sci-physics/lammps/ChangeLog | 9 | ||||
-rw-r--r-- | sci-physics/lammps/Manifest | 20 | ||||
-rw-r--r-- | sci-physics/lammps/lammps-20150721.ebuild | 267 | ||||
-rw-r--r-- | sci-physics/lammps/lammps-20150722.ebuild | 267 |
4 files changed, 554 insertions, 9 deletions
diff --git a/sci-physics/lammps/ChangeLog b/sci-physics/lammps/ChangeLog index 9338f501ac1a..e564c5fdaf62 100644 --- a/sci-physics/lammps/ChangeLog +++ b/sci-physics/lammps/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sci-physics/lammps # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-physics/lammps/ChangeLog,v 1.106 2015/07/18 21:59:49 nicolasbock Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-physics/lammps/ChangeLog,v 1.107 2015/07/24 12:22:22 nicolasbock Exp $ + +*lammps-20150721 (24 Jul 2015) +*lammps-20150722 (24 Jul 2015) + + 24 Jul 2015; Nicolas Bock <nicolasbock@gentoo.org> +lammps-20150721.ebuild, + +lammps-20150722.ebuild: + Version bump. *lammps-20150718 (18 Jul 2015) diff --git a/sci-physics/lammps/Manifest b/sci-physics/lammps/Manifest index 1b2444e71447..2b1a7d8d16a8 100644 --- a/sci-physics/lammps/Manifest +++ b/sci-physics/lammps/Manifest @@ -8,6 +8,8 @@ DIST lammps-15May15.tar.gz 63835027 SHA256 0233ea98c7d77d31bd0a538bb674c0ee8f000 DIST lammps-16Apr15.tar.gz 63842472 SHA256 65aecf6f25a055734ef113890a86ecbf7f8478105238c507e5f9bcbeb657bc99 SHA512 95639145db66e76bd27a865849dc0ad15d3920f7ca9f1fb9a426e457376d0c939c57440e89fa6903d1989ca5e5c6c97d8d283928e1dbf33dd94ba88dbb05a252 WHIRLPOOL 422f6814093f22820cfd8fada1d97735c1a8f0388b34e6bad49e361e411b254ea89e6bf7afa8390c0cba1371a6d038fa84cf93583568c5223e42d95210f13515 DIST lammps-18Apr15.tar.gz 63883297 SHA256 4ce74978da738383a1d808a37481c3c43d4f8f44d919770b3f2cdd4fcf03345b SHA512 be088ec59b7fe495fff3cdfcc5ccb52d2705eec20deb5c8694a215943786652c9dc22a81ba48324707495c3f56c0c347af964d1952ae077c8db02258cf31387a WHIRLPOOL c90403147cc4eda5b4f581cd1bd18bcc8f45a73b1d0e51dcd64c52fc636116c9d57337b89b5753c86e1bbf386f8a2391a9813a6e32154a819f3e35cfc816b5e2 DIST lammps-18Jul15.tar.gz 66065642 SHA256 deb6625b7c21cf94fc7ee9aefb2edf55a6c8dc870e919028c9ffa1cd169d57ed SHA512 d26dd0084779e037af35bc26f81cdca5a7617f841860e6eab7d52f6c023d2c001075aad5dc3d656ceb6e92650589acc472fa5c8954fd9ab81ec0b737e377284b WHIRLPOOL 66794b7250cdb077bcbeb2b95a464aecc684f7592d81f3db4a3702195ef1d8404eb4b1f38e6c1dd859a42dd8ca1ebd039cbac4d9fd11be99a376168f2c498cdd +DIST lammps-21Jul15.tar.gz 66715434 SHA256 2e24a7b6131a35ef83cec08f4dc9f7cc5188c59a630ba61f2a8ac3cfbd284ef7 SHA512 cbf39b3559ac60d5ad92299370bf9af76c0bd7fec62dbaa429d5127d561978426d16b03510b815ffeb6b0acdb362523809adf7ac3fbc2fea8cc484010b1ef7bc WHIRLPOOL 41df92b1f5baf52e846032f12c80f813b84fcd1c71f8c7dad5594780da154345d1b1bdea6b68f4c4b71029346d74d4ff3a813f1101437a01be65df7cf6d0d246 +DIST lammps-22Jul15.tar.gz 67275212 SHA256 b75cdf8ead17f20433737c203c8d29c0cc3e157c9b3d175093467873aea0b869 SHA512 f6e5eaf3ca8bcd25a580a4608e0aec0021f2ed5eb23cf9ccd0a707cb8bc320568504ccffc25cccb5acfe2fc3515c58f8afc8936aea63acb3062bdc897a5eb2ee WHIRLPOOL 13c09e1045a0bdabe15e2125ccef0ea622cb12fcce63d8441b7f9843b8f1a3f7aa0c13908a2e215c1fdba8a579a17a5833111b5cf31a2471bf66e781ef281c59 DIST lammps-28Apr15.tar.gz 63883556 SHA256 6e7c32690cf8bb5a4fb147bab6029cc1d03594ec7b3ea3833e7dc89acc596d8a SHA512 414c786e8666cddd31a3200baedc76974371280dc219636914dd7863f03e32e11f637a9c184af78d8d4da22afe4cf734b6a0eb32c78d6f53ee95d796a3e080c0 WHIRLPOOL c57a91f9d5e977d26cdb2076b5bbd2f3b5791396c23b5326f16cc609b9646e80c602a492b312b4e5f78d1d638c4a6b66e9a49b1ced02274ad7202821a2884975 DIST lammps-30Apr15.tar.gz 63892754 SHA256 d4a193fd5aa9417ec9d15a3be1e2b149302aacf3d9321886a806b0f4ca91611e SHA512 889fc315719e6f50f802b72a8a0c6e6d7eedb84b67e8b39ae9ea93feb2d526914639848cbfbcbb6dd8b8718c3b332f617f001c6ef04fe14d0685106fcac821bd WHIRLPOOL a681662a0c37fcb701ced8f2cd4f085dfd0ff250faac2c62abd07b718e3bf12ddbf366f725fbc21bc4547e6ef3ca3042ee84571a1fa0277a4c3d7d273ccaa099 EBUILD lammps-20150210.ebuild 4947 SHA256 d3bf0c40480bb9d230678c50d64d40e41cb627a03ac7c258920a9e42c3f883cd SHA512 189bcfce8a7ace252f2bb749ee651ab77f3c2572a453752b6925b96a31383d4e08c7d95092635e28b31f88601ad3eba2e33c9316d33928255e408fce6925869e WHIRLPOOL af857a14e98226c6450386d175e8c1a100bc5aa477659460bf12a74557f72ef825d1149a66083c166d4d0ae14cf0080feba8fcaebd6e762abe81bb08e0732364 @@ -17,16 +19,18 @@ EBUILD lammps-20150428.ebuild 6832 SHA256 65b7165907191e4ac8369d4aa8463f88332330 EBUILD lammps-20150430.ebuild 6832 SHA256 e03b59672c49b6b4a2544c2cdc71c9c2318fa56b702961616f7c2e23d69db10a SHA512 b667229ea19ff29130f26e8b9340a49763544b767195fad88d4b6d5bfaa98771888340b073f09ac679ffa1f1b9ea2baf36e13e1860102c324552275894c16690 WHIRLPOOL 4971609fc471fc551cbd4faac905f5ae86444dc8163a211d76cf63c85f89db02ccc8d09543a74635cd6b48dc7731f6d4f31810a584e06fa073f3676b7271b607 EBUILD lammps-20150515.ebuild 6823 SHA256 e6d5270928f726a0ea2cbd8a97594692460ec120c7b5e551a6710c60684b3257 SHA512 9cde0cbc15b42d2c83fb95a11e66d2be5214edfd486f8ce36e620cb9e2ae4352b0383b8271ac047cc81e04b7e2c8032e7db750764892c8830ccbd1a9a267ed7c WHIRLPOOL 535cef0d8e477d08427275df3a24aea407ab92136615890bca2097cc6eb923c94c92f1341315973a2e7809b0e90567c04bc04a61c440ab5f99d5c24663d0a585 EBUILD lammps-20150718.ebuild 6832 SHA256 ddae0705ad287713e68ac2aa00c669f042057dfd157c995eeb1e01db4b4debed SHA512 32568996a1e9fe768ce04bc9afa7c07c7f8e50b766bde05a33081920616f7e905dea38c29f9dcddfaeaacdecb9a618b467ffb0d74fe2d57870992f350d121e68 WHIRLPOOL 951bd37fbc68a7701bb0c2bccf1ce089f0ced322aa6bc29f321ad19c6c09acbac48c0cff90e8e3431f6760adc8f78b70189ecfbc6451031417b02ad8c5468b79 -MISC ChangeLog 18084 SHA256 d9eeb45cc2a65245a2258ac597a8232961d97f02f9af07bc8c1a722635dadf83 SHA512 249728c16116cbb819d06d26f2e905d9ebed768b790d073453172d2ac2b923ded4564520d128c6d035d09a3147ca6a7885d59d2f1578c00236344e842f3b16ad WHIRLPOOL d1cc3dc1eaa5f4643307dd376ab016968ced270c4a2422790905be1e7e3aa6a41c1d9deb5a678dfadb7c8c539a628ea02829eee887840b9c2edb6b71d9624778 +EBUILD lammps-20150721.ebuild 6832 SHA256 78eeb3095cb63556b61ac64dc2fbe5e77cf838d1be40d1243c146a8d25b07551 SHA512 7bc8f7f0bad9c11b38f76a7cd41f70906055d71d10765b89236384317b185d3ca6b9dae3c18bf65f739034daa635ff891a7bd7c3d4ff9aebef8372a9b9feb982 WHIRLPOOL 13a01f97dde4ac69236c22efbb098f478903f1b5e0110b31b3f5334ecd1693d2f851ed5ad7b0e9dc0ee7dc0d4b4c3642272933d31092740d1b56d43a506a903e +EBUILD lammps-20150722.ebuild 6832 SHA256 36ce99bc1f14ba14d57100b3d6373d0ae70cb11436c4aeb2ea94527301971ba9 SHA512 b483d0e8dcf3210eb79fc59e821dd69121f754372a96233cae50d69261b20a66a24b75b6904b896ea7b0fc6b4feb6486c41e8ae99712cad35cca6cd57646ad33 WHIRLPOOL 0362e81fdcfb5c30ca7a0bb7d5ad5a3e4818172834d524901d7ad89133bf8a69a2e297a2bfe46e6549ed31cce329c84b0d4d98fb5e99a8681c9aae21d67cf9b6 +MISC ChangeLog 18269 SHA256 095136fffb0649178823208908d16008184bb9c62552d647cf4cd398f618d563 SHA512 260d01d63450c4c353ab814cd2c1878ffe3aecc81e2dc9473daeb18bc66ee1c3c59f60ff6d45ccbaf3272c117342db0209b9da02734217ce93d841398bcbc0f3 WHIRLPOOL 708ddd9b3dd131b2503d843736b69b647d3835d1f75aa1459d9de171b4f8a17e05a8ad70c6d3b802a6ed0f7e558441e72c3afc16449ff2fac9ab7d0218c2e6cb MISC metadata.xml 1140 SHA256 c1c836b9a61f0d0c881a3c9de63f7dda4bbe55c187c163154a4fce296d0cc7c2 SHA512 ff4ee9b4a49b43c104fc2f5161f1ca6a32aa536cc2025a61ea0cf1d035d40be194d7889cd6048e2120325542ccfaa1cada82b8a1c8c2c11d5d23ca3ead2130cc WHIRLPOOL 35167e15aff5a79526a9d69fbec8405640c06c1cf69017072984a1f139ba2a939b42aab96c9b5be629d84205414623a4b1a9b9536957777234ad4a26f870401f -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iQEcBAEBCAAGBQJVqsxZAAoJEF1ww0n44d9N7jsIAK8brsXlnMBtAF9uDs31fmbf -bkslLKmKxvCIkaQwz5XYC/r+mFnyoUTOvoIRzDw2U0KdfesN2R/Sf0RmkvMrENa+ -Kc/S0DFvcgiE26lHlEwPHdhmGOt6HT2LyNYsl0m88T+W3Ef2Vx9I0LiJk3cLOv19 -CcM82nFnYW+w78EH4WGgSolR1UArIj2Q3Bs3ripLLmyS9VZ2P2Yi2uoiuYV8OAp/ -+MmYtjLs3RqovTFEt8VbUVPwpe5brG2kUXWLQW/jIyLUFqCe3v7NmWHEgGUiKtOD -bqtVR7MsLfzJ3CX7siHkyzV+hwWdDyEGHitmXCecDi8ybkVWvC5PO7loLBlY7Ls= -=v6wQ +iQEcBAEBCAAGBQJVsi4BAAoJEF1ww0n44d9NCeYIAJ9H8iJZKZL98LEZi5uNM3RN +RScKxvmTKvilP+sMYRzC8FtqH2zNGArmZsmRPH0IEm4pP4leFxjrV+OQdpYn2jrN +ziU29H2qI7GRC+/8vOsRJz6kzZYsq/ZEUDkTJuX57XQLt3eJZdxph3f/Ka5xjwgH +xKYECFGGrDZ84bZ8SNE3BMKLIoyncVvZZU4PQv5JhkPLaUZ6eXVmJin3HZ7fsbuT +pBCEXlNu8b4guvdZi1e+GLqXGkS9n1cq/kF9kge7lO7t20VFjJmjoMBksMVyWYZy +rWMdgSdQXI0IURYDonqW4JG70GQ7ixGEDrdNrAvTBROnOWQlcoLtc5liPw2yLJM= +=V30o -----END PGP SIGNATURE----- diff --git a/sci-physics/lammps/lammps-20150721.ebuild b/sci-physics/lammps/lammps-20150721.ebuild new file mode 100644 index 000000000000..a7d3934db913 --- /dev/null +++ b/sci-physics/lammps/lammps-20150721.ebuild @@ -0,0 +1,267 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-physics/lammps/lammps-20150721.ebuild,v 1.1 2015/07/24 12:22:22 nicolasbock Exp $ + +EAPI=5 + +PYTHON_COMPAT=( python{2_7,3_3} ) + +inherit eutils flag-o-matic fortran-2 multilib python-r1 + +convert_month() { + case $1 in + 01) echo Jan + ;; + 02) echo Feb + ;; + 03) echo Mar + ;; + 04) echo Apr + ;; + 05) echo May + ;; + 06) echo Jun + ;; + 07) echo Jul + ;; + 08) echo Aug + ;; + 09) echo Sep + ;; + 10) echo Oct + ;; + 11) echo Nov + ;; + 12) echo Dec + ;; + *) echo unknown + ;; + esac +} + +MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2} + +DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator" +HOMEPAGE="http://lammps.sandia.gov/" +SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc examples gzip lammps-memalign mpi python static-libs" + +DEPEND=" + mpi? ( + virtual/blas + virtual/lapack + virtual/mpi + ) + gzip? ( app-arch/gzip ) + sci-libs/voro++ + python? ( ${PYTHON_DEPS} ) + " +RDEPEND="${DEPEND}" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +S="${WORKDIR}/${MY_P}" + +lmp_emake() { + local LAMMPS_INCLUDEFLAGS + LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')" + LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN' '')" + + # The lammps makefile uses CC to indicate the C++ compiler. + emake \ + ARCHIVE=$(tc-getAR) \ + CC=$(usex mpi "mpic++" "$(tc-getCXX)") \ + F90=$(usex mpi "mpif90" "$(tc-getFC)") \ + LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \ + CCFLAGS="${CXXFLAGS}" \ + F90FLAGS="${FCFLAGS}" \ + LINKFLAGS="${LDFLAGS}" \ + LMP_INC="${LAMMPS_INCLUDEFLAGS}" \ + MPI_INC=$(usex mpi "" "-I../STUBS") \ + MPI_PATH=$(usex mpi "" "-L../STUBS") \ + MPI_LIB=$(usex mpi "" "-lmpi_stubs") \ + user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\ + "$@" +} + +lmp_activate_packages() { + # Build packages + lmp_emake -C src yes-asphere + lmp_emake -C src yes-body + lmp_emake -C src yes-class2 + lmp_emake -C src yes-colloid + lmp_emake -C src yes-coreshell + lmp_emake -C src yes-dipole + lmp_emake -C src yes-fld + #lmp_emake -C src yes-gpu + lmp_emake -C src yes-granular + # Need OpenKIM external dependency. + #lmp_emake -C src yes-kim + # Need Kokkos external dependency. + #lmp_emake -C src yes-kokkos + lmp_emake -C src yes-kspace + lmp_emake -C src yes-manybody + lmp_emake -C src yes-mc + lmp_emake -C src yes-meam + lmp_emake -C src yes-misc + lmp_emake -C src yes-molecule + #lmp_emake -C src yes-mpiio + lmp_emake -C src yes-opt + lmp_emake -C src yes-peri + lmp_emake -C src yes-poems + lmp_emake -C src yes-qeq + lmp_emake -C src yes-reax + lmp_emake -C src yes-replica + lmp_emake -C src yes-rigid + lmp_emake -C src yes-shock + lmp_emake -C src yes-snap + lmp_emake -C src yes-srd + lmp_emake -C src yes-voronoi + lmp_emake -C src yes-xtc + + if use mpi; then + lmp_emake -C src yes-user-atc + fi + lmp_emake -C src yes-user-eff + lmp_emake -C src yes-user-fep + use mpi && lmp_emake -C src yes-user-lb + lmp_emake -C src yes-user-phonon + lmp_emake -C src yes-user-sph +} + +lmp_build_packages() { + lmp_emake -C lib/meam -j1 -f Makefile.gfortran + lmp_emake -C lib/poems -f Makefile.g++ + lmp_emake -C lib/reax -j1 -f Makefile.gfortran + use mpi && lmp_emake -C lib/atc -f Makefile.g++ +} + +lmp_clean_packages() { + lmp_emake -C lib/meam -f Makefile.gfortran clean + lmp_emake -C lib/poems -f Makefile.g++ clean + lmp_emake -C lib/reax -f Makefile.gfortran clean + use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean +} + +src_prepare() { + # Fix inconsistent use of SHFLAGS. + sed -i \ + -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \ + -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \ + lib/voronoi/Makefile.lammps || die + + # Fix missing .so name. + sed -i \ + -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \ + src/MAKE/Makefile.serial || die + + # Fix makefile in tools. + sed -i \ + -e 's:g++:$(CXX) $(CXXFLAGS):' \ + -e 's:gcc:$(CC) $(CCFLAGS):' \ + -e 's:ifort:$(FC) $(FCFLAGS):' \ + tools/Makefile || die + + # Patch python. + epatch "${FILESDIR}/lammps-python3.patch" + epatch "${FILESDIR}/python-shebang.patch" +} + +src_compile() { + # Fix atc... + append-cxxflags -I../../src + + # Acticate packages. + elog "Activating lammps packages..." + lmp_activate_packages + + # Compile stubs for serial version. + use mpi || lmp_emake -C src mpi-stubs + + elog "Building packages..." + lmp_build_packages + + if use static-libs; then + # Build static library. + elog "Building static library..." + lmp_emake -C src mode=lib serial + fi + + # Clean out packages (that's not done by the build system with the clean + # target), so we can rebuild the packages with -fPIC. + elog "Cleaning packages..." + lmp_clean_packages + + # The build system does not rebuild the packages with -fPIC, adding flag + # manually. + append-cxxflags -fPIC + append-fflags -fPIC + + # Compile stubs for serial version. + use mpi || lmp_emake -C src mpi-stubs + + elog "Building packages..." + lmp_build_packages + + # Build shared library. + elog "Building shared library..." + lmp_emake -C src mode=shlib serial + + # Compile main executable. The shared library is always built, and + # mode=shexe is simply a way to re-use the object files built in the + # "shlib" step when linking the executable. The executable is not actually + # using the shared library. If we have built the static library, then we + # link that into the executable. + elog "Linking executable..." + if use static-libs; then + lmp_emake -C src mode=exe serial + else + lmp_emake -C src mode=shexe serial + fi + + # Compile tools. + elog "Building tools..." + lmp_emake -C tools binary2txt chain data2xmovie micelle2d +} + +src_install() { + use static-libs && newlib.a src/liblammps_serial.a liblammps.a + newlib.so src/liblammps_serial.so liblammps.so.0.0.0 + dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so + dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0 + newbin src/lmp_serial lmp + dobin tools/binary2txt + dobin tools/chain + dobin tools/data2xmovie + dobin tools/micelle2d + # Don't forget to add header files of optional packages as they are added + # to this ebuild. There may also be .mod files from Fortran based + # packages. + insinto "/usr/include/${PN}" + doins -r src/*.h lib/meam/*.mod + + local LAMMPS_POTENTIALS="usr/share/${PN}/potentials" + insinto "/${LAMMPS_POTENTIALS}" + doins potentials/* + echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps + doenvd 99lammps + + # Install python script. + use python && python_foreach_impl python_domodule python/lammps.py + + if use examples; then + local LAMMPS_EXAMPLES="/usr/share/${PN}/examples" + insinto "${LAMMPS_EXAMPLES}" + doins -r examples/* + fi + + dodoc README + if use doc; then + dodoc doc/Manual.pdf + dohtml -r doc/* + fi +} diff --git a/sci-physics/lammps/lammps-20150722.ebuild b/sci-physics/lammps/lammps-20150722.ebuild new file mode 100644 index 000000000000..d5782fb346ef --- /dev/null +++ b/sci-physics/lammps/lammps-20150722.ebuild @@ -0,0 +1,267 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-physics/lammps/lammps-20150722.ebuild,v 1.1 2015/07/24 12:22:22 nicolasbock Exp $ + +EAPI=5 + +PYTHON_COMPAT=( python{2_7,3_3} ) + +inherit eutils flag-o-matic fortran-2 multilib python-r1 + +convert_month() { + case $1 in + 01) echo Jan + ;; + 02) echo Feb + ;; + 03) echo Mar + ;; + 04) echo Apr + ;; + 05) echo May + ;; + 06) echo Jun + ;; + 07) echo Jul + ;; + 08) echo Aug + ;; + 09) echo Sep + ;; + 10) echo Oct + ;; + 11) echo Nov + ;; + 12) echo Dec + ;; + *) echo unknown + ;; + esac +} + +MY_P=${PN}-$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:2:2} + +DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator" +HOMEPAGE="http://lammps.sandia.gov/" +SRC_URI="http://lammps.sandia.gov/tars/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc examples gzip lammps-memalign mpi python static-libs" + +DEPEND=" + mpi? ( + virtual/blas + virtual/lapack + virtual/mpi + ) + gzip? ( app-arch/gzip ) + sci-libs/voro++ + python? ( ${PYTHON_DEPS} ) + " +RDEPEND="${DEPEND}" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +S="${WORKDIR}/${MY_P}" + +lmp_emake() { + local LAMMPS_INCLUDEFLAGS + LAMMPS_INCLUDEFLAGS="$(usex gzip '-DLAMMPS_GZIP' '')" + LAMMPS_INCLUDEFLAGS+="$(usex lammps-memalign ' -DLAMMPS_MEMALIGN' '')" + + # The lammps makefile uses CC to indicate the C++ compiler. + emake \ + ARCHIVE=$(tc-getAR) \ + CC=$(usex mpi "mpic++" "$(tc-getCXX)") \ + F90=$(usex mpi "mpif90" "$(tc-getFC)") \ + LINK=$(usex mpi "mpic++" "$(tc-getCXX)") \ + CCFLAGS="${CXXFLAGS}" \ + F90FLAGS="${FCFLAGS}" \ + LINKFLAGS="${LDFLAGS}" \ + LMP_INC="${LAMMPS_INCLUDEFLAGS}" \ + MPI_INC=$(usex mpi "" "-I../STUBS") \ + MPI_PATH=$(usex mpi "" "-L../STUBS") \ + MPI_LIB=$(usex mpi "" "-lmpi_stubs") \ + user-atc_SYSLIB="$(usex mpi "$($(tc-getPKG_CONFIG) --libs blas) $($(tc-getPKG_CONFIG) --libs lapack)" '')"\ + "$@" +} + +lmp_activate_packages() { + # Build packages + lmp_emake -C src yes-asphere + lmp_emake -C src yes-body + lmp_emake -C src yes-class2 + lmp_emake -C src yes-colloid + lmp_emake -C src yes-coreshell + lmp_emake -C src yes-dipole + lmp_emake -C src yes-fld + #lmp_emake -C src yes-gpu + lmp_emake -C src yes-granular + # Need OpenKIM external dependency. + #lmp_emake -C src yes-kim + # Need Kokkos external dependency. + #lmp_emake -C src yes-kokkos + lmp_emake -C src yes-kspace + lmp_emake -C src yes-manybody + lmp_emake -C src yes-mc + lmp_emake -C src yes-meam + lmp_emake -C src yes-misc + lmp_emake -C src yes-molecule + #lmp_emake -C src yes-mpiio + lmp_emake -C src yes-opt + lmp_emake -C src yes-peri + lmp_emake -C src yes-poems + lmp_emake -C src yes-qeq + lmp_emake -C src yes-reax + lmp_emake -C src yes-replica + lmp_emake -C src yes-rigid + lmp_emake -C src yes-shock + lmp_emake -C src yes-snap + lmp_emake -C src yes-srd + lmp_emake -C src yes-voronoi + lmp_emake -C src yes-xtc + + if use mpi; then + lmp_emake -C src yes-user-atc + fi + lmp_emake -C src yes-user-eff + lmp_emake -C src yes-user-fep + use mpi && lmp_emake -C src yes-user-lb + lmp_emake -C src yes-user-phonon + lmp_emake -C src yes-user-sph +} + +lmp_build_packages() { + lmp_emake -C lib/meam -j1 -f Makefile.gfortran + lmp_emake -C lib/poems -f Makefile.g++ + lmp_emake -C lib/reax -j1 -f Makefile.gfortran + use mpi && lmp_emake -C lib/atc -f Makefile.g++ +} + +lmp_clean_packages() { + lmp_emake -C lib/meam -f Makefile.gfortran clean + lmp_emake -C lib/poems -f Makefile.g++ clean + lmp_emake -C lib/reax -f Makefile.gfortran clean + use mpi && lmp_emake -C lib/atc -f Makefile.g++ clean +} + +src_prepare() { + # Fix inconsistent use of SHFLAGS. + sed -i \ + -e 's:voronoi_SYSINC\s\+=.*$:voronoi_SYSINC = -I/usr/include/voro++:' \ + -e 's:voronoi_SYSPATH\s\+=.*$:voronoi_SYSPATH =:' \ + lib/voronoi/Makefile.lammps || die + + # Fix missing .so name. + sed -i \ + -e 's:SHLIBFLAGS\s\+=\s\+:SHLIBFLAGS = -Wl,-soname,liblammps.so.0 :' \ + src/MAKE/Makefile.serial || die + + # Fix makefile in tools. + sed -i \ + -e 's:g++:$(CXX) $(CXXFLAGS):' \ + -e 's:gcc:$(CC) $(CCFLAGS):' \ + -e 's:ifort:$(FC) $(FCFLAGS):' \ + tools/Makefile || die + + # Patch python. + epatch "${FILESDIR}/lammps-python3.patch" + epatch "${FILESDIR}/python-shebang.patch" +} + +src_compile() { + # Fix atc... + append-cxxflags -I../../src + + # Acticate packages. + elog "Activating lammps packages..." + lmp_activate_packages + + # Compile stubs for serial version. + use mpi || lmp_emake -C src mpi-stubs + + elog "Building packages..." + lmp_build_packages + + if use static-libs; then + # Build static library. + elog "Building static library..." + lmp_emake -C src mode=lib serial + fi + + # Clean out packages (that's not done by the build system with the clean + # target), so we can rebuild the packages with -fPIC. + elog "Cleaning packages..." + lmp_clean_packages + + # The build system does not rebuild the packages with -fPIC, adding flag + # manually. + append-cxxflags -fPIC + append-fflags -fPIC + + # Compile stubs for serial version. + use mpi || lmp_emake -C src mpi-stubs + + elog "Building packages..." + lmp_build_packages + + # Build shared library. + elog "Building shared library..." + lmp_emake -C src mode=shlib serial + + # Compile main executable. The shared library is always built, and + # mode=shexe is simply a way to re-use the object files built in the + # "shlib" step when linking the executable. The executable is not actually + # using the shared library. If we have built the static library, then we + # link that into the executable. + elog "Linking executable..." + if use static-libs; then + lmp_emake -C src mode=exe serial + else + lmp_emake -C src mode=shexe serial + fi + + # Compile tools. + elog "Building tools..." + lmp_emake -C tools binary2txt chain data2xmovie micelle2d +} + +src_install() { + use static-libs && newlib.a src/liblammps_serial.a liblammps.a + newlib.so src/liblammps_serial.so liblammps.so.0.0.0 + dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so + dosym liblammps.so.0.0.0 /usr/$(get_libdir)/liblammps.so.0 + newbin src/lmp_serial lmp + dobin tools/binary2txt + dobin tools/chain + dobin tools/data2xmovie + dobin tools/micelle2d + # Don't forget to add header files of optional packages as they are added + # to this ebuild. There may also be .mod files from Fortran based + # packages. + insinto "/usr/include/${PN}" + doins -r src/*.h lib/meam/*.mod + + local LAMMPS_POTENTIALS="usr/share/${PN}/potentials" + insinto "/${LAMMPS_POTENTIALS}" + doins potentials/* + echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps + doenvd 99lammps + + # Install python script. + use python && python_foreach_impl python_domodule python/lammps.py + + if use examples; then + local LAMMPS_EXAMPLES="/usr/share/${PN}/examples" + insinto "${LAMMPS_EXAMPLES}" + doins -r examples/* + fi + + dodoc README + if use doc; then + dodoc doc/Manual.pdf + dohtml -r doc/* + fi +} |