[148154] trunk/dports/math

takeshi at macports.org takeshi at macports.org
Thu Apr 28 02:27:17 PDT 2016


Revision: 148154
          https://trac.macports.org/changeset/148154
Author:   takeshi at macports.org
Date:     2016-04-28 02:27:17 -0700 (Thu, 28 Apr 2016)
Log Message:
-----------
mlpack: add to MacPorts

Added Paths:
-----------
    trunk/dports/math/mlpack/
    trunk/dports/math/mlpack/Portfile
    trunk/dports/math/mlpack/files/
    trunk/dports/math/mlpack/files/patch-src-mlpack-methods-kmeans-kmeans_impl.hpp.diff
    trunk/dports/math/mlpack/files/patch-src-mlpack-prereqs.hpp.diff

Added: trunk/dports/math/mlpack/Portfile
===================================================================
--- trunk/dports/math/mlpack/Portfile	                        (rev 0)
+++ trunk/dports/math/mlpack/Portfile	2016-04-28 09:27:17 UTC (rev 148154)
@@ -0,0 +1,49 @@
+# -*- 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        ""


Property changes on: trunk/dports/math/mlpack/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: trunk/dports/math/mlpack/files/patch-src-mlpack-methods-kmeans-kmeans_impl.hpp.diff
===================================================================
--- trunk/dports/math/mlpack/files/patch-src-mlpack-methods-kmeans-kmeans_impl.hpp.diff	                        (rev 0)
+++ trunk/dports/math/mlpack/files/patch-src-mlpack-methods-kmeans-kmeans_impl.hpp.diff	2016-04-28 09:27:17 UTC (rev 148154)
@@ -0,0 +1,11 @@
+--- src/mlpack/methods/kmeans/kmeans_impl.hpp.orig	2016-02-05 07:40:47.000000000 +0900
++++ src/mlpack/methods/kmeans/kmeans_impl.hpp	2016-04-28 10:06:29.000000000 +0900
+@@ -175,7 +175,7 @@
+     iteration++;
+     Log::Info << "KMeans::Cluster(): iteration " << iteration << ", residual "
+         << cNorm << ".\n";
+-    if (isnan(cNorm) || isinf(cNorm))
++    if (std::isnan(cNorm) || std::isinf(cNorm))
+       cNorm = 1e-4; // Keep iterating.
+ 
+   } while (cNorm > 1e-5 && iteration != maxIterations);

Added: trunk/dports/math/mlpack/files/patch-src-mlpack-prereqs.hpp.diff
===================================================================
--- trunk/dports/math/mlpack/files/patch-src-mlpack-prereqs.hpp.diff	                        (rev 0)
+++ trunk/dports/math/mlpack/files/patch-src-mlpack-prereqs.hpp.diff	2016-04-28 09:27:17 UTC (rev 148154)
@@ -0,0 +1,30 @@
+--- src/mlpack/prereqs.hpp.orig	2016-02-05 07:40:47.000000000 +0900
++++ src/mlpack/prereqs.hpp	2016-04-28 10:15:00.000000000 +0900
+@@ -21,19 +21,19 @@
+ #endif
+ 
+ // Next, standard includes.
+-#include <stdlib.h>
+-#include <stdio.h>
+-#include <string.h>
+-#include <ctype.h>
+-#include <limits.h>
+-#include <float.h>
+-#include <stdint.h>
++#include <cstdlib>
++#include <cstdio>
++#include <cstring>
++#include <cctype>
++#include <climits>
++#include <cfloat>
++#include <cstdint>
+ #include <iostream>
+ #include <stdexcept>
+ 
+ // Defining _USE_MATH_DEFINES should set M_PI.
+ #define _USE_MATH_DEFINES
+-#include <math.h>
++#include <cmath>
+ 
+ // For tgamma().
+ #include <boost/math/special_functions/gamma.hpp>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160428/99cbba67/attachment.html>


More information about the macports-changes mailing list