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 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"
26 RESTRICT="!test? ( test )"
36 python? ( ${PYTHON_DEPS} )
41 netcdf? ( sci-libs/netcdf )
42 cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2.9-r1 )
47 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
49 S="${WORKDIR}/${MY_P}/cmake"
53 -DBUILD_SHARED_LIBS=ON
54 -DENABLE_MPI=$(usex mpi)
55 -DENABLE_GPU=$(usex cuda)
56 -DENABLE_TESTING=$(usex test)
71 -DLAMMPS_XDR=ON #630444
82 -DENABLE_MPIIO=$(usex mpi)
85 -DENABLE_USER-AWPMD=ON
86 -DENABLE_USER-CGDNA=ON
87 -DENABLE_USER-CGSDK=ON
88 -DENABLE_USER-COLVARS=ON
89 -DENABLE_USER-DIFFRACTION=ON
91 -DENABLE_USER-DRUDE=ON
94 -DENABLE_USER-H5MD=$(usex mpi)
95 -DENABLE_USER-LB=$(usex mpi)
96 -DENABLE_USER-MANIFOLD=ON
97 -DENABLE_USER-MEAMC=ON
100 -DENABLE_USER-MOLFILE=ON
101 -DENABLE_USER-NETCDF=$(usex netcdf)
102 -DENABLE_USER-PHONON=ON
104 -DENABLE_USER-REAXC=ON
106 -DENABLE_USER-SMTBQ=ON
108 -DENABLE_USER-TALLY=ON
110 cmake-utils_src_configure
114 cmake-utils_src_install
116 local LAMMPS_POTENTIALS="usr/share/${PN}/potentials"
117 insinto "/${LAMMPS_POTENTIALS}"
118 doins "${S}"/../potentials/*
119 echo "LAMMPS_POTENTIALS=${EROOT}${LAMMPS_POTENTIALS}" > 99lammps
122 # Install python script.
123 use python && python_foreach_impl python_domodule "${S}"/../python/lammps.py
125 if use examples; then
126 local LAMMPS_EXAMPLES="/usr/share/${PN}/examples"
127 insinto "${LAMMPS_EXAMPLES}"
128 doins -r "${S}"/../examples/*