[mlpack] compiling mlpack with MinGW/MSYS

Gilles Barges gbarges at free.fr
Fri Aug 8 06:10:33 EDT 2014


> make fails on a crytic error in compiling dt_utils.cpp:
> 
> C:/Users/gbg/Desktop/msys/1.0/include/armadillo_bits/arma_static_check.hpp: In instantiation of 'static void arma::arma_type_check_cxx1998<ERROR___INCORRECT_OR_UNSUPPORTED_TYPE>::apply() [with bool ERROR___INCORRECT_OR_UNSUPPORTED_TYPE = true]':
> 
> C:/Users/gbg/Desktop/msys/1.0/include/armadillo_bits/Mat_meat.hpp:34:3:   required from 'arma::Mat<eT>::~Mat() [with eT = long long unsigned int]'

Compilation fails when instanciating an object arma::Mat<size_t>.
size_t is 8 bytes large here, it's an unsigned long long.

Looking at Armadillo docs, I can see that this case is not supported
"The root matrix class is Mat<type>, where type is one of:
float, double, std::complex<float>, std::complex<double>, char, short, int, long and unsigned versions of char, short, int, long"

I wrote these lines :
#include <armadillo>
int main ( ) {
  printf ( "sizeof ( size_t )    = %ld\n", sizeof ( size_t ));
  printf ( "sizeof ( long long ) = %ld\n", sizeof ( long long ));
  arma::Mat<size_t>  mat(3,3);
  mat.ones();
  mat.print();
  return 0;
}

This does not compile, with the same error …_UNSUPPORTED_TYPE  (of course it work when changing size_t by any supported type)

This was on Window7-64.
On MacOSX, size_t is also 8 bytes long, and long long too,
BUT
1 - this program DOES compile and run with Mat<size_t>
2- it DOES NOT compile with Mat<unsigned long long> 

which is very strange

--
Gilles Barges.





More information about the mlpack mailing list