# IT4Innovations
# JK 2022

easyblock = 'PackedBinary'

name = 'PhaseLink'
version = '20210503'

local_pytorch_ver = '-PyTorch-1.10.0'

homepage = 'https://github.com/interseismic/PhaseLink'
description = """
PhaseLink applies a deep learning approach to seismic phase association.
"""

toolchain = {'name': 'fosscuda', 'version': '2020b'}

# clone from github and create an archive
sources = ['%(name)s-%(version)s.tar.gz']
extract_sources = True

dependencies = [
    ('Python', '3.8.6'),
    ('apex', '20210420'),
    ('CuPy', '8.5.0'),
    ('Cython', '0.29.22'),
    ('geopy', '2.1.0'),
    ('h5py', '3.1.0'),
    ('matplotlib', '3.3.3'),
    ('mpi4py', '3.1.3', '', ('foss', '2020b')),
    ('MPICH', '3.3.2'),
    ('numba', '0.52.0'),
    ('obspy', '1.3.0'),
    ('pyproj', '3.0.1'),
    ('PyTorch', '1.10.0'),
    ('scikit-learn', '0.23.2'),
    ('torchaudio', '0.10.0', local_pytorch_ver),
    ('torchvision', '0.11.3', local_pytorch_ver),
]

postinstallcmds = ['find %(installdir)s -type f -name "*.py" -print0 | xargs -0 chmod +x']

skipsteps = ['sanitycheck']
modextrapaths = {'PYTHONPATH': ''}

moduleclass = 'geo'
