diff options
author | Nicolas Bock <nicolasbock@gentoo.org> | 2015-01-07 17:34:36 +0000 |
---|---|---|
committer | Nicolas Bock <nicolasbock@gentoo.org> | 2015-01-07 17:34:36 +0000 |
commit | 0e259720a6ddbad18640cfa4bbf7eccc9d689704 (patch) | |
tree | 14b1ef3fca032e8c607a50f06f503ed3a6f70c83 /sci-physics | |
parent | amd64 stable wrt bug #534660 (diff) | |
download | historical-0e259720a6ddbad18640cfa4bbf7eccc9d689704.tar.gz historical-0e259720a6ddbad18640cfa4bbf7eccc9d689704.tar.bz2 historical-0e259720a6ddbad18640cfa4bbf7eccc9d689704.zip |
sci-physics/lammps: Adding new versions.
Package-Manager: portage-2.2.14/cvs/Linux x86_64
Manifest-Sign-Key: 0xAC91CA52
Diffstat (limited to 'sci-physics')
-rw-r--r-- | sci-physics/lammps/ChangeLog | 11 | ||||
-rw-r--r-- | sci-physics/lammps/Manifest | 16 | ||||
-rw-r--r-- | sci-physics/lammps/lammps-20150105.ebuild | 206 | ||||
-rw-r--r-- | sci-physics/lammps/lammps-20150106.ebuild | 206 |
4 files changed, 426 insertions, 13 deletions
diff --git a/sci-physics/lammps/ChangeLog b/sci-physics/lammps/ChangeLog index 93751cb4ed00..9e8f1d91c917 100644 --- a/sci-physics/lammps/ChangeLog +++ b/sci-physics/lammps/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sci-physics/lammps -# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-physics/lammps/ChangeLog,v 1.56 2014/12/30 20:47:51 nicolasbock Exp $ +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sci-physics/lammps/ChangeLog,v 1.57 2015/01/07 17:34:34 nicolasbock Exp $ + +*lammps-20150105 (07 Jan 2015) +*lammps-20150106 (07 Jan 2015) + + 07 Jan 2015; Nicolas Bock <nicolasbock@gentoo.org> +lammps-20150105.ebuild, + +lammps-20150106.ebuild: + sci-physics/lammps: Adding new versions. *lammps-20141222 (30 Dec 2014) *lammps-20141217 (30 Dec 2014) diff --git a/sci-physics/lammps/Manifest b/sci-physics/lammps/Manifest index b29a40d02aa5..8a30fd7c17fa 100644 --- a/sci-physics/lammps/Manifest +++ b/sci-physics/lammps/Manifest @@ -1,6 +1,3 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA256 - DIST lammps-11Jul14.tar.gz 64634749 SHA256 05a9af6fae3f27e41ee776fb3c306a07c2f80b953770fa1ccbd36bbbb6991283 SHA512 6951d9af5d1f77f3160ba13ed70bb1ff71d1f8da0716b784b3e3cf010eb8b9ee68ac49befe4602771bbb4a473fd531f07568d922e0bbff97d4193f9e8c0ea793 WHIRLPOOL f1b814171e81898f7138b6116d4bddedfdccc0a956d11184fb64c82722905a28a97420c19b65edef488915ce956479b0ba255767b45f2f70c53e5674ee6e3744 DIST lammps-14Jun14.tar.gz 64597109 SHA256 cf7d492862c7bbb1865631b8abce34ea8b5edac17a573c8924c4f9b885fccac3 SHA512 fb0d5d58c1abd402d0aa311156f023af9579793b6606f5c449f5bf0b298dc77a0c68198dc2898d9d8f0f84b24bd84fec3d60b1549d60446152b9e18d5f217608 WHIRLPOOL 7336cb8f57aa856ae7b8ca77bbdfb78df9c2a4fd229f58884c302e88dd75aa53c567c22fbdc8c87af032df264dbdd222d23143b23ba5a84dd8e94f5a7a260838 DIST lammps-15Aug14.tar.gz 65114807 SHA256 de4ad0c90c43c234fb5c4efa179122acdecb5dba6834ec6e42fa7a237ae767c0 SHA512 af61d517ae707ce53f670ec924bb8a55b6e1c2ed67c5343e84696116c2f9d0f716ac5841618600b466462b68fb24e0129e41febbeddd87c68d7672547de3fa9e WHIRLPOOL 0658cdcda382693278b1dc029a59e5fbdda0c4bae43183799486c8c1d85989e509ed7eee9574a862d2fbcb7f533cb718a5f08a23dd4371c41c96296dd7ecc586 @@ -15,9 +12,11 @@ DIST lammps-25Sep14.tar.gz 65394390 SHA256 bb1fecc9f66f2cd2ca235058edaff135250a5 DIST lammps-26Nov14.tar.gz 61445197 SHA256 c3d577ec0be132a0f4b3f22f51bcefe6184d42e1ad4e12983d15528fde4298f9 SHA512 78d6ae2d241931dcc8aa6f268f7fdf105361565f9d5d64234ba8505dc8a4f465ef5ba91cb5145448b1aec7820a5fc884de62145e1b2ae99caf81bd148f009902 WHIRLPOOL c9ca16efe1ad1f892e8d92cd74b51e25c666590e4f4f6d48a87a1626e8ad5f2f01a30584bff74c74e2415cd7a7fade059438319514b05f0098784d23fb362afb DIST lammps-28Jun14.tar.gz 64598325 SHA256 3dc8f415f076c5b1563e25c06ddf360a7234c0b3428c561764a13618f80fb233 SHA512 568a00249dd88d0ad94714d2b388855376d020a34b546f9f54142b761e95515c1fce44bbbc9db2538a5a9b8335b8ac9e2905b875e954da18831087a3021df0e2 WHIRLPOOL 9d283de197c6e7216c60ed3f34bcd0a55baab925ab4d025717f1bee8a7e8b668c67bf008a9a9a807361c8f5ade36e362afdf7ac9ef6c3ed6d856389591483354 DIST lammps-30Oct14.tar.gz 59386701 SHA256 b99522370cb2ea3e55c63f401b2bafb0c98f6b28b9af76fb8339e9bd4a3ae205 SHA512 9b9952ec098c17abd9af085d546869a60ba421a380abcd0be3c425e3c1495394417bfee8d8097c99f54131e286a325d736e766e1ae7239bf45ca44c737611c2c WHIRLPOOL b8ad0078b883455cd7e8f06c0ad8f43eefe7d1c158af58baa42ad179154f09f68077d8fb31c22abccedf06daa344e4abb7f3edcc16d9e69e9d2c458f4fda1085 +DIST lammps-5Jan15.tar.gz 61852386 SHA256 0283c06904cec23c1577fd28686be8c61ac7e72ea76bfb8aa7135aba98e13b51 SHA512 4c6dd1b18b25b22f943f6dc439e5cf1d7583cd044b23c423a525457ead47d0b33ab9f9f07ef7a2c1930e7677d78b8b542d47599fa2b19082dbe600188056fef1 WHIRLPOOL b55e802377e08dab8e0cd7b501be0479570b73ddb7c01206b043fd1bb3b27b9c651cfc955885ecfd66cad1881fd03ce4bae40606c09416c7f73a2ab23b05a567 DIST lammps-5Nov14.tar.gz 58736468 SHA256 18851282c8eec5e99559c4e1fa6673bc49dd8da6091ea61bfe136e1bd1369d2f SHA512 87624cb0bb44a702a416fc763d58017d1ef540d292c7d7c34dad3641950182bf6a173e5fa16d2aa3cdcc42ed34426265d243a7cf50771769fd0a1099873be69e WHIRLPOOL 5c3364017fcc3552ac58f6644bfe4a1d9a3511cbd8afceefb20838d1805f8f421495e1b35942e1055a440c74dae5eb4155e4db2eb759f0edd2af2941497ee5c7 DIST lammps-5Sep14.tar.gz 66049751 SHA256 e05d5287752a32e3e7fb34f51b080c5f72ee12bf9d453b6098d6998673483f14 SHA512 4fc33c58d7ce4c3776109ed565b5df0b1748156b0f9f1acdb66db9cf17c8fb8717c151eebd5267a0c2adb2ff648ba327c4cdec91c5ce53d361c7d7c8329db516 WHIRLPOOL b961a2d7d9c242ebf20be8a7d735a39bdc2fb5e6af18ad51da759f4bc2a9a9077ca8ed4da424ee4162a7d433eebc0564a26f186e81a96c0d4284b60c89bed965 DIST lammps-6Aug14.tar.gz 64806245 SHA256 844fa61c95b8bc5ae3bfdf225dfc3d562d8750d1c7b1f1601379e94c4176a682 SHA512 220113eea7f550c15a46f87e5aac2583477bbdb1faf535a221ef36cc0d0b159ebad23e0d9186e5bc9988ccc73c70e2e6af3ca719c982fdc58cf81e1cbf6c4f3a WHIRLPOOL 12fc8180bb16e612af2640f9c1b16911f3ca55ba233b2eec8cbae2c689d397d8ef52177a4bbc6388d0da18202c3795c9b8b3aa8dc4ac935e05204dc825f0dac4 +DIST lammps-6Jan15.tar.gz 61856773 SHA256 8a46420d189e071c0019b2f14594d32026816bd9da269c1733932b75a98a52ff SHA512 a6a54cc5f78414e92977b6cb77076ef23b31e1ca6ed4129ba286d403b41aee6217a0136ba5f35a0f20baa15976c61f75abec840179173411bf6f4f314e06d389 WHIRLPOOL 133ea1ad548a3803074248281c3dcff874f59b712fa59bf7fb92d21559608123caaef3811ce8191519ffe08dc89f5eb5dbcdd1a8341cfad1b1558e8700c6606e DIST lammps-8Aug14.tar.gz 65050504 SHA256 f7324db760b39f64ff926d1c4b034cd8d122f31e368d939ad39ccba2c33c4585 SHA512 8dc2f6adc0ff5cd7f53801728b1b078c289bb9e40a16bcd3fb0252b159c6e51705f61f264a004cebca53c57d1073e74c6fc633f3c442a12a14e4b1eb6715abea WHIRLPOOL d700b504c91c7744447a84c48abc1b4015ec67ff1c6fb5d85d6504395a1cdadc9d4dd0cd777a6b14cfc0c0c8f0685286f92e2d68b2ff2ee85a37db4626bd43f7 DIST lammps-9Dec14.tar.gz 61465046 SHA256 01724976608413e049d197a12b8608321220a9a15a7c3d7706babd1ab9e21de1 SHA512 30ae88f930bea43adbbe217cf6b4d9f257d16f707f95d60e6a07358b0633578dae767fd348f656061e10d9783fff2a59118bbf902569bd70bb77f682fd7fd666 WHIRLPOOL 5cccbe3da9e00316c660d721ece7fa0d208edbf3c94845c06d15d08f5e5852cc11919aae78fcb02f7f9109e5e478f2d52c299dc20be3877cb378e636701c0579 EBUILD lammps-20140201.ebuild 2467 SHA256 dabebb7bbd33a22023f218fea5331d68b2eba0666712dd080b13bfa630c4529c SHA512 944ce71a43d978909c5c0b129072cf7532cb10db4c5e6ac24cfbf85afcecac4ca9bbfafe4e147fc429c94aeecd7b4765a821c1a538267b75a045ffa1f41ebd39 WHIRLPOOL 113ebc1905299fdae5b6b5f4f57fd862e920ead05afd4f5850e341b6266f9a1a14a79d7f627d6915454b748960718ee08bfb84eea0ee1f03ec21fc28f8e73bd3 @@ -40,12 +39,7 @@ EBUILD lammps-20141209.ebuild 4955 SHA256 adc05bc66b73d56f83e0778c37055fce2f1eec EBUILD lammps-20141217.ebuild 4955 SHA256 a87222b95f037d57f427fdb84ed06cab1a738e10f499a5c00efb7676fca50bdd SHA512 ee02bcb295b511ccd5c35721deeb192ebc91df31f0b8ad2d2197bc7a4cf4b3ef0ab6b17c52a836597376a8b338b5c333ea3ada344172d56dd1da4c9fb9d7cc4e WHIRLPOOL da96f5c29da8ea906533dfe9e8ac34d0ae6456257a6ce81c34682a6d5a449f3571df3357fec1393761ad746e4614f057439a000a9dc3e9a4a0976cd14a1678f9 EBUILD lammps-20141219.ebuild 4955 SHA256 343767488635502402ec6f44b069e4f2b9746ff2b61bf1a6051b0e6a6999fb41 SHA512 d3942096585412b187b329e637e8c8cbcf500fb699020db08598820f23cfe2da43de699385adcf572f23d0e2deff6849c2e8e828095517d67ef01e5958805c1c WHIRLPOOL 8f294badfe45061d90f4e1223b5d04d6991092a1e55ed26e74d426488ad9dbcdd326e0758450727c534efffcfb6265c0b605abddec59a0a72df681e63d0f2911 EBUILD lammps-20141222.ebuild 4955 SHA256 785ee74c02bc925d3ec6413b1c44b9a4794ebc6c8adc8e4aa83157dec1b940ec SHA512 303427ce5bea454843e4be72db7fab7f1909e787e7e287a47d31049ed22a3119661cc1102e40bc2a0e017f920f67e828a3c8423abfb2fe4c1c16dc14931cd52c WHIRLPOOL 476ee1bb71e8dbd7692365d7789ebff9e8131cb41b47527d4b53c9ce331b3e2794d64335e5b93b861a610c3dd2c1d1cd6b595aee4bcd676187caa3d75677b2ac -MISC ChangeLog 9744 SHA256 b6b31e66c933e1c4f96eb383414ab7fa8148cea18a9766b63ded22c2e6304d47 SHA512 54b905bed63216b30d278964e16c95a9fa064910b87d214e12f6e0db03ed78af62e6bc92473cdd6a4469d9ed00cec326472bae64f93b10fb0ca703fbf877a226 WHIRLPOOL 44c993be6fdb064d6cc1f23190080d290b92c4e3ab9f644b3655290e2d01610dce06457d780b2157e570b2512843613cdc08dfe885627d00177250697a69a5d3 +EBUILD lammps-20150105.ebuild 4955 SHA256 bbe69ed6f053edb40b667afb87214ead2b3af45f2232b81eabc8ffa69a2850a2 SHA512 f6f09591353e6bda8b157a2359100a8c35a9c2407ff6e1618d760823047fb44c10d483cd2651959618f4ac865466d2b015379a76bb598a43ad2b716d47903484 WHIRLPOOL 7813c53cee4470ab1380251e3f8934d25377251d8be9beb2c4936ca8c2f222b3281b6a6a6688b83d70adcb929d4edebbfa84273515341f9ac05ee0f82fb05328 +EBUILD lammps-20150106.ebuild 4955 SHA256 81a24c50829270565506bcc75e7ba48887a70c6460766e39581f9b2b52d159f0 SHA512 2de849aefe31545324113e01fcb085188d0f13d17294136615ee814997696e8c72e63db030026cc5abedad2db11c96338fc709a5e1c10df394e0cb64ecca5f9f WHIRLPOOL 248b2773d1613e78342b4ef08224222ef0273752cd0aba90cb336fe76c65a2426709e1a32f4b21c0b5893e63a73a6d101d5f266505a67caf3d49ba07389a1a43 +MISC ChangeLog 9956 SHA256 e73c2865b02c052eadaac2f7f7660e482bed134635f5f61dd4785504609689de SHA512 390b1f59fefe283aec02f76660d1ab99dc7f0ab854d0dd0f4b0659c1513e1df72642f942471b9bee0a1565ec0b27ebe7569056d4f30109b96ec499b75a2c31ab WHIRLPOOL 74f9c0d37e989b5da43261bf223cd3e5a84174e361f7bf2609cd934f96847fe65a536bc0ef6110f8effdc9fc5e25a7311429b1b16f91c77ce56581ff7e643447 MISC metadata.xml 1271 SHA256 2de96e89797d150bffc7933de76da6d8bd24619c475e71286c5fb05637d97f0a SHA512 ce273d9f6f947f976ad008187dce9e5efe62f20a521ac7c0eb23550ef8cdcc2a1e61084e55466c84c77cd8d98eb39cac857057bd82ab9c9537d9cdb1c66d19d1 WHIRLPOOL 8177b79250dc0ad4759c0790111671457a91f9bac4bf21e0bbef3001abb558dfa70dcac45bcfef388c7377c1595854f9729d5881b64d4f699d6664407fc8696c ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2 - -iEYEAREIAAYFAlSjD3sACgkQf15tZKyRylK9NwCgjuGgFN3TQIavdtEaGQhcVZ34 -TAMAoO/NilYL9zhTijiKkQvxKyHCWNGa -=yAWU ------END PGP SIGNATURE----- diff --git a/sci-physics/lammps/lammps-20150105.ebuild b/sci-physics/lammps/lammps-20150105.ebuild new file mode 100644 index 000000000000..d164fcb95b6b --- /dev/null +++ b/sci-physics/lammps/lammps-20150105.ebuild @@ -0,0 +1,206 @@ +# 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-20150105.ebuild,v 1.1 2015/01/07 17:34:34 nicolasbock Exp $ + +EAPI=5 + +inherit eutils flag-o-matic fortran-2 multilib + +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 static-libs" + +DEPEND=" + mpi? ( + virtual/blas + virtual/lapack + virtual/mpi + ) + sci-libs/voro++ + " +RDEPEND="${DEPEND}" + +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)" '')"\ + "$@" +} + +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 =:' \ + src/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 +} + +src_compile() { + # Prepare compiler flags. + append-cxxflags -fPIC -I../../src + append-fflags -fPIC + + # Compile stubs for serial version. + use mpi || lmp_emake -C src stubs + + # Build packages + emake -C src yes-asphere + emake -C src yes-body + emake -C src yes-class2 + emake -C src yes-colloid + emake -C src yes-dipole + emake -C src yes-fld + #emake -C src yes-gpu + emake -C src yes-granular + # Need OpenKIM external dependency. + #emake -C src yes-kim + # Need Kokkos external dependency. + #emake -C src yes-kokkos + emake -C src yes-kspace + emake -C src yes-manybody + emake -C src yes-mc + lmp_emake -C src yes-meam + lmp_emake -j1 -C lib/meam -f Makefile.gfortran + emake -C src yes-misc + emake -C src yes-molecule + #emake -C src yes-mpiio + emake -C src yes-opt + emake -C src yes-peri + emake -C src yes-poems + lmp_emake -C lib/poems -f Makefile.g++ + emake -C src yes-reax + lmp_emake -j1 -C lib/reax -f Makefile.gfortran + emake -C src yes-replica + emake -C src yes-rigid + emake -C src yes-shock + emake -C src yes-snap + emake -C src yes-srd + emake -C src yes-voronoi + emake -C src yes-xtc + + emake -C src yes-user-eff + emake -C src yes-user-fep + use mpi && emake -C src yes-user-lb + emake -C src yes-user-phonon + emake -C src yes-user-sph + + if use mpi; then + emake -C src yes-user-atc + lmp_emake -C lib/atc -f Makefile.g++ + fi + + if use static-libs; then + # Build static library. + lmp_emake -C src makelib + lmp_emake -C src -f Makefile.lib serial + fi + + # Build shared library. + lmp_emake -C src makeshlib + lmp_emake -C src -f Makefile.shlib serial + + # Compile main executable. + lmp_emake -C src serial + + # Compile tools. + emake -C tools binary2txt chain micelle2d data2xmovie +} + +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 + # 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 + + 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-20150106.ebuild b/sci-physics/lammps/lammps-20150106.ebuild new file mode 100644 index 000000000000..a71330cfe2d1 --- /dev/null +++ b/sci-physics/lammps/lammps-20150106.ebuild @@ -0,0 +1,206 @@ +# 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-20150106.ebuild,v 1.1 2015/01/07 17:34:34 nicolasbock Exp $ + +EAPI=5 + +inherit eutils flag-o-matic fortran-2 multilib + +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 static-libs" + +DEPEND=" + mpi? ( + virtual/blas + virtual/lapack + virtual/mpi + ) + sci-libs/voro++ + " +RDEPEND="${DEPEND}" + +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)" '')"\ + "$@" +} + +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 =:' \ + src/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 +} + +src_compile() { + # Prepare compiler flags. + append-cxxflags -fPIC -I../../src + append-fflags -fPIC + + # Compile stubs for serial version. + use mpi || lmp_emake -C src stubs + + # Build packages + emake -C src yes-asphere + emake -C src yes-body + emake -C src yes-class2 + emake -C src yes-colloid + emake -C src yes-dipole + emake -C src yes-fld + #emake -C src yes-gpu + emake -C src yes-granular + # Need OpenKIM external dependency. + #emake -C src yes-kim + # Need Kokkos external dependency. + #emake -C src yes-kokkos + emake -C src yes-kspace + emake -C src yes-manybody + emake -C src yes-mc + lmp_emake -C src yes-meam + lmp_emake -j1 -C lib/meam -f Makefile.gfortran + emake -C src yes-misc + emake -C src yes-molecule + #emake -C src yes-mpiio + emake -C src yes-opt + emake -C src yes-peri + emake -C src yes-poems + lmp_emake -C lib/poems -f Makefile.g++ + emake -C src yes-reax + lmp_emake -j1 -C lib/reax -f Makefile.gfortran + emake -C src yes-replica + emake -C src yes-rigid + emake -C src yes-shock + emake -C src yes-snap + emake -C src yes-srd + emake -C src yes-voronoi + emake -C src yes-xtc + + emake -C src yes-user-eff + emake -C src yes-user-fep + use mpi && emake -C src yes-user-lb + emake -C src yes-user-phonon + emake -C src yes-user-sph + + if use mpi; then + emake -C src yes-user-atc + lmp_emake -C lib/atc -f Makefile.g++ + fi + + if use static-libs; then + # Build static library. + lmp_emake -C src makelib + lmp_emake -C src -f Makefile.lib serial + fi + + # Build shared library. + lmp_emake -C src makeshlib + lmp_emake -C src -f Makefile.shlib serial + + # Compile main executable. + lmp_emake -C src serial + + # Compile tools. + emake -C tools binary2txt chain micelle2d data2xmovie +} + +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 + # 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 + + 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 +} |