# IT4Innovations 2019

easyblock = 'ConfigureMake'

name = 'hwloc'
version = '1.11.12'

homepage = 'https://www.open-mpi.org/projects/hwloc/'

description = """
 The Portable Hardware Locality (hwloc) software package provides a portable
 abstraction (across OS, versions, architectures, ...) of the hierarchical
 topology of modern architectures, including NUMA memory nodes, sockets, shared
 caches, cores and simultaneous multithreading. It also gathers various system
 attributes such as cache and memory information as well as the locality of I/O
 devices such as network interfaces, InfiniBand HCAs or GPUs. It primarily
 aims at helping applications with gathering information about modern local_computing
 hardware so as to exploit it accordingly and efficiently.
"""

toolchain = {'name': 'GCCcore', 'version': '8.2.0'}
# need to build with -fno-tree-vectorize to avoid segfaulting lstopo on Intel Skylake
# cfr. https://github.com/open-mpi/hwloc/issues/315
toolchainopts = {'vectorize': False}

source_urls = ['https://www.open-mpi.org/software/hwloc/v%(version_major_minor)s/downloads/']
sources = [SOURCE_TAR_GZ]
checksums = ['f1d49433e605dd653a77e1478a78cee095787d554a94afe40d1376bca6708ca5']

builddependencies = [
    ('binutils', '2.31.1'),
]

dependencies = [
    ('numactl', '2.0.12'),
    ('libxml2', '2.9.9', '', True),
    ('libpciaccess', '0.14'),
]

configopts = "--enable-libnuma=$EBROOTNUMACTL "
configopts += "--disable-cairo --disable-opencl --disable-cuda --disable-nvml --disable-gl --disable-libudev "

sanity_check_paths = {
    'files': ['bin/lstopo', 'include/hwloc/linux.h',
              'lib/libhwloc.%s' % SHLIB_EXT],
    'dirs': ['share/man/man3'],
}
sanity_check_commands = ['lstopo']

moduleclass = 'system'
