# IT4Innovations
# LK 2021
easyblock = 'CMakeMake'

name = 'Salmon'
version = '2.1.0'

homepage = 'https://github.com/COMBINE-lab/salmon'
description = """Salmon is a wicked-fast program to produce a highly-accurate,
 transcript-level quantification estimates from RNA-seq data."""

toolchain = {'name': 'intel', 'version': '2020b'}
toolchainopts = {'pic': True, 'openmp': True}

source_urls = ['http://salmon-tddft.jp/download/']
sources = ['SALMON-v.%(version)s.tar.gz']
checksums = ['95e1fabbbf161359ce6ec563cace99f4']

builddependencies = [
    ('CMake', '3.18.4'),
    ('pkg-config', '0.29.2'),
    ('jemalloc', '5.2.1'),
]

dependencies = [
    ('Boost', '1.74.0'),
    ('tbb', '2020.3'),
]

# Disable link-time optimizations (-flto) because it triggers a segfault/internal compiler error (ICE) with GCC 9.3.0
# This problem might be solved with a newer version of either GCC or Salmon.
configopts = '-DJEMALLOC_ROOT=$EBROOTJEMALLOC -DNO_IPO=1'

# need to unset the $LD_PRELOAD set be jemalloc to avoid hanging 'make test'
# since jemalloc is statically linked in Salmon (and hence only a build dep),
# this only affects the tests
pretestopts = "unset LD_PRELOAD && "
runtest = 'test'

sanity_check_paths = {
    'files': ['bin/%(namelower)s'],
    'dirs': [],
}

sanity_check_commands = ["salmon --help"]

moduleclass = 'bio'
