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

compilers.choose    fc f77 f90
compilers.setup     require_fortran

name                fortrancl
version             0.1alpha4
revision            2
categories          devel parallel science
platforms           darwin
license             LGPL
maintainers         {takeshi @tenomoto} openmaintainer
description         OpenCL Fortran 90 interface
long_description    \
   FortranCL is an OpenCL interface for Fortran 90. \
   It allows programmers to call the OpenCL parallel programming framework \
   directly from Fortran, so developers can accelerate their Fortran code \
   using graphical processing units (GPU) and other accelerators.
homepage            https://code.google.com/p/fortrancl/
master_sites        googlecode

checksums           rmd160  a709df9ffb914e9e37605dd5a800a58d1567f800 \
                    sha256  55d604a8659edbb0bc6fe9318c1bf04898c93fefcd0bbd03c62ddb778e167581

pre-fetch {
    if {${os.major} < 10} {
        return -code error "OpenCL is not available. Snow Leopard or newer is required."
    }
}

configure.cppflags-append   -framework OpenCL
configure.args              --enable-shared

use_parallel_build  no

post-destroot {
    xinstall -d -m 755 ${destroot}${prefix}/share/${name}/examples
    xinstall -m 644 -W ${worksrcpath}/examples \
        devices.f90 sum.cl sum.f90 \
        ${destroot}${prefix}/share/${name}/examples/
}

# They differ when universal due to gcc multilib being messy non-universal
destroot.delete_la_files yes
