# IT4Innovations
# LK 2023

name = 'LAMMPS'
version = '2Aug2023'
versionsuffix = '-kokkos'

homepage = 'https://www.lammps.org'
description = """LAMMPS is a classical molecular dynamics code, and an acronym
for Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS has
potentials for solid-state materials (metals, semiconductors) and soft matter
(biomolecules, polymers) and coarse-grained or mesoscopic systems. It can be
used to model atoms or, more generically, as a parallel particle simulator at
the atomic, meso, or continuum scale. LAMMPS runs on single processors or in
parallel using message-passing techniques and a spatial-decomposition of the
simulation domain. The code is designed to be easy to modify or extend with new
functionality.
"""

toolchain = {'name': 'foss', 'version': '2022a'}
import os
if os.environ.get("CLUSTERNAME") in ["KAROLINA"]:
   toolchainopts = {'openmp': True, 'usempi': True, 'optarch': 'march=core-avx2'}
else:
   toolchainopts = {'openmp': True, 'usempi': True}

# 'https://github.com/lammps/lammps/archive/'
source_urls = [GITHUB_LOWER_SOURCE]
sources = ['stable_%(version)s_update1.tar.gz']
checksums = ['0e5568485e5ee080412dba44a1b7a93f864f1b5c75121f11d528854269953ed0']

builddependencies = [
    ('CMake', '3.23.1'),
    ('pkgconf', '1.8.0'),
    ('archspec', '0.1.4'),
]
dependencies = [
    ('Python', '3.10.4'),
    ('libpng', '1.6.37'),
    ('libjpeg-turbo', '2.1.3'),
    ('netCDF', '4.9.0'),
    ('GSL', '2.7'),
    ('zlib', '1.2.12'),
    ('gzip', '1.12'),
    ('cURL', '7.83.0'),
    ('HDF5', '1.12.2'),
    ('tbb', '2021.5.0'),
    ('PCRE', '8.45'),
    ('libxml2', '2.9.13'),
    ('FFmpeg', '4.4.2'),
    ('Voro++', '0.4.6'),
    ('kim-api', '2.3.0'),
    ('Eigen', '3.4.0'),
    ('PLUMED', '2.8.1'),
    ('ScaFaCoS', '1.0.4'),
    ('SciPy-bundle', '2022.05'),
    # VTK package is auto-disabled if this dep is not available
    ('VTK', '9.2.2'),
]

# To use additional custom configuration options, use the 'configopts' easyconfig parameter
# See docs and lammps easyblock for more information.
# https://github.com/lammps/lammps/blob/master/cmake/README.md#lammps-configuration-options

# OpenMP-Kokkos build is default in the current easyblock. One can switch to serial backend of Kokkos,
# which is claimed to be faster in pure MPI calculations
# configopts  = "-DKokkos_ENABLE_SERIAL=yes "


# packages auto-enabled by easyblock
# 'GPU'    - if cuda package is present and kokkos is disabled
# 'KOKKOS' - if kokkos is enabled (by default)
# 'INTEL'  - if builing on Intel CPU
# 'OPENMP' - if OpenMP swithed on in 'toolchainopts'

# include the following extra packages into the build
general_packages = [
    'AMOEBA',
    'ASPHERE',
    'ATC',
    'AWPMD',
    'BOCS',
    'BODY',
    'BPM',
    'BROWNIAN',
    'CG-DNA',
    'CG-SPICA',
    'CLASS2',
    'COLLOID',
    'COLVARS',
    'COMPRESS',
    'CORESHELL',
    'DIELECTRIC',
    'DIFFRACTION',
    'DIPOLE',
    'DPD-BASIC',
    'DPD-MESO',
    'DPD-REACT',
    'DPD-SMOOTH',
    'DRUDE',
    'EFF',
    'ELECTRODE',
    'EXTRA-COMPUTE',
    'EXTRA-DUMP',
    'EXTRA-FIX',
    'EXTRA-MOLECULE',
    'EXTRA-PAIR',
    'FEP',
    'GRANULAR',
    'H5MD',
    'INTERLAYER',
    'KIM',
    'KSPACE',
    'LATBOLTZ',
    'LEPTON',
    'MACHDYN',
    'MANIFOLD',
    'MANYBODY',
    'MC',
    'MDI',
    'MEAM',
    'MGPT',
    'MISC',
    'ML-IAP',
    'ML-PACE',
    'ML-POD',
    'ML-RANN',
    'ML-SNAP',
    'MOFFF',
    'MOLECULE',
    'MOLFILE',
    'MPIIO',
    'NETCDF',
    'OPT',
    'ORIENT',
    'PERI',
    'PHONON',
    'PLUGIN',
    'PLUMED',
    'POEMS',
    'PTM',
    'PYTHON',
    'QEQ',
    'QTB',
    'REACTION',
    'REAXFF',
    'REPLICA',
    'RIGID',
    'SCAFACOS',
    'SHOCK',
    'SMTBQ',
    'SPH',
    'SPIN',
    'SRD',
    'TALLY',
    'UEF',
    'VORONOI',
    'VTK',
    'YAFF',
]

# Excluded packages due to requiring additional (non-trivial) deps
# - ADIOS
# - LATTE
# - MESONT (requires very large files downloaded during build)
# - ML-HDNNP (requires N2P2)
# - ML-QUIP
# - MSCG
# - QMMM (setup seems complex)


moduleclass = 'chem'
