1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_5,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 SRC_URI="https://github.com/lammps/lammps/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
24 KEYWORDS="~amd64 ~x86"
25 IUSE="cuda examples gzip lammps-memalign mpi netcdf python test"
35 python? ( ${PYTHON_DEPS} )
40 netcdf? ( sci-libs/netcdf )
41 cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2.9-r1 )
46 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
48 S="${WORKDIR}/${MY_P}/cmake"
52 -DBUILD_SHARED_LIBS=ON
53 -DENABLE_MPI=$(usex mpi)
54 -DENABLE_GPU=$(usex cuda)
55 -DENABLE_TESTING=$(usex test)
70 -DLAMMPS_XDR=ON #630444
81 -DENABLE_MPIIO=$(usex mpi)
84 -DENABLE_USER-AWPMD=ON
85 -DENABLE_USER-CGDNA=ON
86 -DENABLE_USER-CGSDK=ON
87 -DENABLE_USER-COLVARS=ON
88 -DENABLE_USER-DIFFRACTION=ON
90 -DENABLE_USER-DRUDE=ON
93 -DENABLE_USER-H5MD=$(usex mpi)
94 -DENABLE_USER-LB=$(usex mpi)
95 -DENABLE_USER-MANIFOLD=ON
96 -DENABLE_USER-MEAMC=ON
99 -DENABLE_USER-MOLFILE=ON
100 -DENABLE_USER-NETCDF=$(usex netcdf)
101 -DENABLE_USER-PHONON=ON
103 -DENABLE_USER-REAXC=ON
105 -DENABLE_USER-SMTBQ=ON
107 -DENABLE_USER-TALLY=ON
109 cmake-utils_src_configure
113 cmake-utils_src_install
115 local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
116 insinto "/${LAMMPS_POTENTIALS}"
117 doins "${S}"/../potentials/*
118 echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
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}/*