# -*- 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
# $Id: Portfile 120117 2014-05-16 06:48:27Z stromnov@macports.org $

PortSystem          1.0
PortGroup           cmake 1.0

name                viennacl
version             1.5.2
set branch          [join [lrange [split ${version} .] 0 1] .]
revision            0
categories          math devel
platforms           darwin
license             MIT

maintainers         stromnov openmaintainer

description         ViennaCL is a free open-source linear algebra library

long_description    ViennaCL is a free open-source linear algebra library \
                    for computations on many-core architectures (GPUs, MIC) \
                    and multi-core CPUs. The library is written in C++ \
                    and supports CUDA, OpenCL, and OpenMP. In addition \
                    to core functionality and many other features including \
                    BLAS level 1-3 support and iterative solvers.

homepage            http://viennacl.sourceforge.net
master_sites        sourceforge:project/viennacl/${branch}.x

checksums           rmd160  fdbc5b9bfb6e387fa94b2d33862f9a7458ef8cf1 \
                    sha256  e443c7b589d083ccb64064feaac37fa663ef1a12aad10b305e047ec16c4002ba

distname            ViennaCL-${version}

worksrcdir          ${workpath}/build
patch.dir           ${workpath}/${distname}

post-extract {
    file mkdir ${worksrcpath}
}

patchfiles-append   patch-CMakeLists.txt.diff

post-patch {
    reinplace "s|@@PREFIX@@|${prefix}|" "${workpath}/${distname}/CMakeLists.txt"
}

depends_lib-append  port:boost

configure.args-append \
                    ../${distname} \
                    -DBUILD_EXAMPLES=OFF \
                    -DBUILD_TESTING=OFF

livecheck.type      sourceforge
livecheck.name      viennacl
livecheck.regex     {/ViennaCL-(\d+(?:\.\d+)*)\.[tz]}
