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

compilers.choose    cc cxx
compilers.setup     -dragonegg -llvm -gcc

name                mlpack
version             2.0.1
categories          math devel science
platforms           darwin
license             BSD
maintainers         takeshi openmaintainer
description         a scalable C++ machine learning library
long_description \
    mlpack is an intuitive, fast, scalable C++ machine learning library, \
    meant to be a machine learning analog to LAPACK. \
    It aims to implement a wide array of machine learning methods and \
    functions as a \"swiss army knife\" for machine learning researchers.
homepage            http://mlpack.org/index.html
master_sites        https://github.com/${name}/${name}/archive/
worksrcdir          ${name}-${name}-${version}

checksums           rmd160  b35b73f401be4c1a4b42afb166c310d3756ded21 \
                    sha256  40fa7c967e5999b4b41f9ad92d0b30c3819749bcd35df7b925eb7488f9bac67e

depends_build       port:cmake
depends_lib         port:armadillo \
                    port:boost \
                    port:libxml2

# https://github.com/mlpack/mlpack/issues/522
patchfiles-append   patch-src-mlpack-prereqs.hpp.diff \
                    patch-src-mlpack-methods-kmeans-kmeans_impl.hpp.diff

cmake.out_of_source yes

configure.args-append \
                    -DDEBUG=OFF \
                    -DPROFILE=OFF \
                    -DARMA_EXTRA_DEBUG=OFF \
                    -DBOOST_ROOT=${prefix} \
                    -DARMADILLO_INCLUDE_DIR=${prefix}/include \
                    -DARMADILLO_LIBRARY=${prefix}/lib/libarmadillo.dylib

build.target        ""