easyblock = 'ConfigureMake'

name = 'jemalloc'
version = '4.5.0'

homepage = 'http://www.canonware.com/jemalloc'
description = """jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and
 scalable concurrency support."""

toolchain = {'name': 'intel', 'version': '2017a'}

source_urls = ['https://github.com/jemalloc/jemalloc/archive']
sources = ['%(version)s.tar.gz']

builddependencies = [('Autotools', '20150215')]

preconfigopts = "./autogen.sh && "
prebuildopts = "make dist && "

sanity_check_paths = {
    'files': ['bin/jeprof', 'lib/libjemalloc.a', 'lib/libjemalloc_pic.a', 'lib/libjemalloc.%s' % SHLIB_EXT,
              'include/jemalloc/jemalloc.h'],
    'dirs': ['share'],
}

modextrapaths = {'LD_PRELOAD': ['lib/libjemalloc.%s' % SHLIB_EXT]}

moduleclass = 'lib'
