##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
# Copyright:: Copyright 2012-2014 Uni.Lu/LCSB, NTUA
# Authors::   Fotis Georgatos <fotis@cern.ch>
# License::   MIT/GPL
# $Id$
#
# This work implements a part of the HPCBIOS project and is a local_component of the policy:
# http://hpcbios.readthedocs.org/en/latest/HPCBIOS_07-02.html
##

easyblock = 'ConfigureMake'

name = 'PAPI'
version = '5.4.3'
versionsuffix = '-pic'

homepage = 'http://icl.cs.utk.edu/projects/papi/'
description = """PAPI provides the tool designer and application engineer with a consistent interface and
 methodology for use of the performance counter hardware found in most major microprocessors. PAPI enables
 software engineers to see, in near real time, the relation between software performance and processor events.
 In addition Component PAPI provides access to a collection of local_components
 that expose performance measurement opportunites across the hardware and software stack."""

toolchain = SYSTEM
toolchainopts = {'pic': True}

source_urls = ['http://icl.cs.utk.edu/projects/papi/downloads/']
sources = [SOURCELOWER_TAR_GZ]

checksums = [
    '3211b5a5bb389fe692370f5cf4cc2412',     # papi-5.4.3.tar.gz
]

configopts = '--with-shared-lib=yes'

start_dir = 'src'

# parallel build doesn't always work
parallel = 1

runtest = 'fulltest'

sanity_check_paths = {
    'files': [
        "bin/papi_%s" %
        x for x in [
            "avail",
            "clockres",
            "command_line",
            "local_component_avail",
            "cost",
            "decode",
            "error_codes",
            "event_chooser",
            "mem_info",
            "multiplex_cost",
            "native_avail",
            "version",
            "xml_event_info"]],
    'dirs': [],
}

moduleclass = 'perf'
