# -*- 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           compilers 1.0
PortGroup           github 1.0
PortGroup           legacysupport 1.1
PortGroup           linear_algebra 1.0

# clock_gettime
legacysupport.newest_darwin_requires_legacy 15

# StarPU maintains both the latest 1.4 branch and 1.3, and some ports want the latter.
# For the time-being, have both in Macports as well. They do not conflict, see below.
github.setup        starpu-runtime starpu 1.3.11 starpu-
name                starpu13
revision            3
categories          devel
license             LGPL-2.1
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
description         Unified runtime system for heterogeneous multicore architectures
long_description    StarPU is a runtime system that offers support for heterogeneous multicore machines. \
                    While many efforts are devoted to design efficient computation kernels \
                    for those architectures (e.g. to implement BLAS kernels on GPUs), StarPU \
                    not only takes care of offloading such kernels (and implementing data coherency \
                    across the machine), but it also makes sure the kernels are executed as efficiently as possible.
homepage            https://starpu.gitlabpages.inria.fr
checksums           rmd160  b2ea9730cbd2ef0c736558d5f7f96bd52cd14cc4 \
                    sha256  43b27c48a37722ba0e596684ba2e723d72b0f6b020a12c25843f8306049a5af0 \
                    size    7300244
github.tarball_from archive

patchfiles          autogen.sh.patch

compiler.blacklist-append \
                    *gcc-4.* {clang < 400}
compilers.choose    fc f90 f77 cc
compilers.setup     require_fortran

use_autoreconf      yes
autoreconf.cmd      ./autogen.sh

configure.args-append \
                    --disable-silent-rules \
                    --prefix=${prefix}/libexec/${name}

# The following option allows for non-conflicting installation of binaries into ${prefix}/bin;
# However it does not work neatly, and multiple files will need to be patched in that case.
# Furthermore, given the number of components that get installed, having multiple versions of StarPU
# directly in ${prefix} quickly becomes a mess, even though headers and dylibs are versioned (but pkgconfig files are not).
# It appears to make a better sense, and far less painful to maintain, just to set a custom prefix.
#                   --program-suffix="-1.3"

depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    port:pkgconfig
depends_lib-append  port:hdf5 \
                    port:hwloc

test.run            yes
test.target         check
