# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           cmake 1.1
PortGroup           github 1.0
PortGroup           linear_algebra 1.1
PortGroup           mpi 1.0

github.setup        william-dawson NTPoly 3.1.1 ntpoly-v
revision            0
categories          math
license             MIT
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
description         Library for computing the functions of sparse matrices
long_description    NTPoly is a massively parallel library for computing the functions of sparse, \
                    Hermitian matrices based on polynomial expansions. For sufficiently sparse matrices, \
                    most of the matrix functions in NTPoly can be computed in linear time.
homepage            https://william-dawson.github.io/NTPoly
checksums           rmd160  b45fa01345feed52d4b6461bc2bd113992cef1b3 \
                    sha256  1a7cadba2f8c9de7aebecfd7997848f1f5f0f8526100446a5ef7bd0997b8ea66 \
                    size    310316
github.tarball_from archive

if {![variant_isset accelerate] && ![variant_isset atlas] && ![variant_isset blis] \
    && ![variant_isset flexiblas] && ![variant_isset openblas]} {
        default_variants-append +openblas
}

mpi.setup           require require_fortran \
                    -gcc44 -gcc45 -gcc46 -gcc47 -gcc48 -gcc49 -gcc5 -gcc6

# https://github.com/william-dawson/NTPoly/issues/192
compiler.blacklist-append \
                    {clang < 500}

pre-configure {
    # Otherwise configure may pick a random BLAS implementation, like FlexiBLAS.
    # Notice that +blis does not build atm: https://github.com/william-dawson/NTPoly/issues/228
    configure.args-append  \
                    ${cmake_linalglib}
}

configure.args-append \
                    -DBUILD_SHARED_LIBS=on \
                    -DNOSWIG=yes

# Error: Type mismatch between actual argument at (1) and actual argument at (2)
compilers.allow_arguments_mismatch yes
