# IT4Innovations 2022
# JK

name = 'GROMACS'
version = '2020.3'
local_plum_ver = '2.7.2'
versionsuffix = '-PLUMED-%s' % local_plum_ver

homepage = 'http://www.gromacs.org'
description = """
GROMACS is a versatile package to perform molecular dynamics,
 i.e. simulate the Newtonian equations of motion for systems with hundreds to millions of particles.

This is a CPU-only build, containing both MPI and threadMPI binaries.
"""

toolchain = {'name': 'foss', 'version': '2021a'}
toolchainopts = {'openmp': True, 'usempi': True}

source_urls = [
    'https://ftp.gromacs.org/pub/gromacs/',
    'ftp://ftp.gromacs.org/pub/gromacs/',
]
sources = [SOURCELOWER_TAR_GZ]
patches = [
    'GROMACS-2019_fix_omp_num_threads_and_google_test_death_style_in_tests.patch',
    'GROMACS-2019_increase_test_timeout_for_GPU.patch',
#    'GROMACS-2021_fix_gmxapi_gmx_allowed_cmd_name.patch',
    'GROMACS-2020.5_fix_threads_gpu_Gmxapitests.patch',
#    'GROMACS-2021.3_skip_test_for_plumed.patch',
]
checksums = [
    {'gromacs-2020.3.tar.gz': '903183691132db14e55b011305db4b6f4901cc4912d2c56c131edfef18cc92a9'},
    {'GROMACS-2019_fix_omp_num_threads_and_google_test_death_style_in_tests.patch':
     '406f5edd204be812f095a6f07ebc2673c5f6ddf1b1c1428fd336a80b9c629275'},
    {'GROMACS-2019_increase_test_timeout_for_GPU.patch':
     '0d16f53d428155197a0ed0b0974ce03422f199d7c463c4a9156a3b99e3c86234'},
    {'GROMACS-2020.5_fix_threads_gpu_Gmxapitests.patch':
     '89fbb7e2754de45573632c74f53563bb979df9758c949238a35865391d6b53fb'},
]

builddependencies = [
    ('CMake', '3.20.1'),
    ('scikit-build', '0.11.1'),
]

dependencies = [
    ('Python', '3.9.5'),
    ('SciPy-bundle', '2021.05'),
    ('networkx', '2.5.1'),
    ('PLUMED', local_plum_ver),
]


ignore_plumed_version_check = True
configopts = '-DGMX_GPU_NB_CLUSTER_SIZE=4 '

#exts_defaultclass = 'PythonPackage'
#
#exts_default_options = {
#    'source_urls': [PYPI_SOURCE],
#    'use_pip': True,
#    'download_dep_fail': True,
#    'sanity_pip_check': True,
#}
#
#exts_list = [
#    ('gmxapi', '0.2.0', {
#        'preinstallopts': "export GMXTOOLCHAINDIR=%(installdir)s/share/cmake/gromacs_mpi && ",
#        'checksums': ['3954bf123da12fc60bcfaeed8263f5e2d3e16e5136c2bb5c8207b20fa7406788'],
#    }),
#]

modextrapaths = {
    'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages',
}

moduleclass = 'bio'
