1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_6} )
8 inherit cmake-utils fortran-2 python-r1
11 local months=( "" Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec )
12 echo ${months[${1#0}]}
15 MY_PV="patch_$((10#${PV:6:2}))$(convert_month ${PV:4:2})${PV:0:4}"
18 DESCRIPTION="Large-scale Atomic/Molecular Massively Parallel Simulator"
19 HOMEPAGE="https://lammps.sandia.gov/"
20 TCOMMIT=d0394a77fa2b4b2d545a73ea092cf6de7616aac8
21 SRC_URI="https://github.com/lammps/lammps/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz
22 test? ( https://github.com/lammps/lammps-testing/archive/${TCOMMIT}.tar.gz -> ${PN}-testing-${TCOMMIT}.tar.gz )"
26 KEYWORDS="~amd64 ~x86"
27 IUSE="cuda examples gzip lammps-memalign mpi netcdf python test"
28 RESTRICT="!test? ( test )"
38 python? ( ${PYTHON_DEPS} )
43 netcdf? ( sci-libs/netcdf )
44 cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2.9-r1 )
49 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
51 S="${WORKDIR}/${MY_P}/cmake"
55 -DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}/etc"
56 -DBUILD_SHARED_LIBS=ON
57 -DBUILD_MPI=$(usex mpi)
59 -DPKG_GPU=$(usex cuda)
61 -DENABLE_TESTING=$(usex test)
62 -DLAMMPS_TESTING_SOURCE_DIR=$(echo "${WORKDIR}"/lammps-testing-*)
87 -DPKG_MPIIO=$(usex mpi)
94 -DPKG_USER-DIFFRACTION=ON
99 -DPKG_USER-H5MD=$(usex mpi)
100 -DPKG_USER-LB=$(usex mpi)
101 -DPKG_USER-MANIFOLD=ON
105 -DPKG_USER-MOLFILE=ON
106 -DPKG_USER-NETCDF=$(usex netcdf)
115 cmake-utils_src_configure
119 cmake-utils_src_install
121 # Install python script.
122 use python && python_foreach_impl python_domodule "${S}"/../python/lammps.py
124 if use examples; then
125 for d in examples bench; do
126 local LAMMPS_EXAMPLES="/usr/share/${PN}/${d}"
127 insinto "${LAMMPS_EXAMPLES}"
128 doins -r "${S}"/../${d}/*