[mlpack-git] [mlpack] Problem Linking MLPACK on Mac (#441)
Emmanuel John
notifications at github.com
Thu Jun 4 23:05:39 EDT 2015
I'm trying to use the kmeans module. Below is the example source and the error I get:
using namespace mlpack::kmeans;
using namespace mlpack::metric;
// The dataset we are clustering.
arma::mat data(1, edges.size());
int col =0;
for(Edge& e: edges){
//std::cout<<e<<std::endl;
data(0,col) = e.weight;
col++;
}
// The number of clusters we are getting.
size_t clusters = 5;
// The centroids will be stored in this matrix.
// The assignments will be stored in this vector.
arma::Col<size_t> assignments;
// Initialize with the default arguments.
//KMeans<SquaredEuclideanDistance,RefinedStart, MaxVarianceNewCluster> k;
KMeans<> k;
//RefinedStart k;
k.Cluster(data, clusters, assignments);
for(int i =0;i<edges.size();i++){
std::cout<<edges[i].weight<<" "<<assignments(i)<<std::endl;
}
And I get the following linker error:
Undefined symbols for architecture x86_64:
"mlpack::util::PrefixedOutStream::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*) (std::basic_ostream<char, std::char_traits<char> >&))", referenced from:
Graph::sparsifyGraph() in graph.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [run] Error 1
I get the same error whether I install mlpack with homebrew or from source. I'm using a Macbook pro with OSX 10.10 Yosemite.
Any help would be appreciated.
---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/441
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150604/0f777163/attachment.html>
More information about the mlpack-git
mailing list