Skip to content

mlpack::kmeans won't compile and build on windows  #22

@tds151

Description

@tds151

The following basic KMeans implementation using RcppMLPACK (v. 1 on CRAN) fails to compile and build with RcppAttributes under Windows R 3.4.1 using the gcc 4.9.3 RTools chain .

// [[Rcpp::depends(RcppMLPACK)]]
// [[Rcpp::plugins(cpp11)]]
#include "RcppMLPACK.h"
using namespace Rcpp;
using namespace arma;
using namespace mlpack::kmeans;

// [[Rcpp::export]]
List cppKmeans(const mat& data, const int& clusters) {
// data is R x N matrix where the columns index multivariate observations
Col<size_t> assignments;
KMeans<> k; // Initialize with the default arguments.
k.Cluster(data, clusters, assignments);
return List::create(Named(”clusters”) = clusters,
Named(”s”) = assignments

);
} /* end function cppKmeans() */

with lots of error messages like this (relating to mp_thread_limit not declared):

C:/R/R-devel/library/RcppArmadillo/include/armadillo_bits/fn_accu.hpp:180:7: error: invalid controlling predicate
for(uword thread_id=0; thread_id < n_threads_use; ++thread_id)
^
C:/R/R-devel/library/RcppArmadillo/include/armadillo_bits/fn_accu.hpp:205:7: error: invalid controlling predicate
for(uword thread_id=0; thread_id < n_threads_use; ++thread_id)
^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions