# -*- 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$

PortSystem          1.0
PortGroup           cmake 1.0

name                viennacl
version             1.7.1
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

distname            ViennaCL-${version}

checksums           rmd160  74d4a46427367321ff110286cb76f61886867f7d \
                    sha256  a596b77972ad3d2bab9d4e63200b171cd0e709fb3f0ceabcaf3668c87d3a238b

cmake.out_of_source yes

patchfiles-append   patch-CMakeLists.txt.diff \
                    patch-cmake_ViennaCLCommon.cmake.diff \
                    patch-libviennacl_CMakeLists.txt.diff

post-patch {
    reinplace "s|@prefix@|${prefix}|" "${patch.dir}/CMakeLists.txt"
    reinplace "s|@prefix@|${prefix}|" "${patch.dir}/cmake/ViennaCLCommon.cmake"
}

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]}