#-*- 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           mpi 1.0
PortGroup           muniversal 1.0

name                lis
version             2.1.8
revision            0
master_sites        https://www.ssisc.org/lis/dl
homepage            https://www.ssisc.org/lis/index.en.html
categories          math science
license             BSD
maintainers         {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
description         Parallel software library for solving linear equations and eigenvalue problems
long_description    \
    Lis (Library of Iterative Solvers for linear systems, pronounced \[lis\]) is \
    a parallel software library for solving linear equations and eigenvalue problems \
    that arise in the numerical solution of partial differential equations using iterative methods.
use_zip       	    yes
checksums           rmd160  9af934a2ec5bcd72216e70cc4288ed07ce7b3980 \
                    sha256  d486b65b822d2e1ebd10853afc2cb076a4a11831f1c8fa060bbbb1d9472a025a \
                    size    3966950

mpi.setup           require_fortran -g95
compilers.allow_arguments_mismatch \
                    yes

# respect MacPorts compiler
patchfiles-append   patch-compiler.diff \
                    patch-src-Makefile.in.diff

# configure script sets optimization flag
configure.optflags-delete -Os

configure.args-append \
                    --enable-shared \
                    --enable-f90 \
                    --enable-complex \
                    --enable-saamg

if {[mpi_variant_isset]} {
    configure.args-append \
                    --enable-mpi
}

post-destroot {
    foreach f [glob -directory ${worksrcpath}/test *.{c,F,F90}] {
        file copy ${f} ${destroot}${prefix}/share/examples/${name}/
    }
}
