[mlpack] compiling mlpack with MinGW/MSYS

Ryan Curtin gth671b at mail.gatech.edu
Fri Aug 8 11:32:17 EDT 2014


On Fri, Aug 08, 2014 at 05:19:31PM +0200, Gilles Barges wrote:
> 
> 
> >> 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]'
> > 
> 
> This is solved by uncommenting ARMA_64BIT_WORD in Armadillo's config.h

Yeah -- I was about to say that.  Sorry that I did not manage to respond
sooner.

Defining ARMA_64BIT_WORD causes the index types of all Armadillo objects
to be 64-bit; this allows very large matrices, but it can also cause
minor slowdown (I don't have actual performance numbers for this, and it
would vary heavily based on system anyway).

The actual relevant variable is whether or not ARMA_USE_U64S64 is
defined.  That variable should also be available in config.hpp for
uncommenting.

Another option is to use C++11, which implicitly sets ARMA_USE_U64S64
(see compiler_setup.hpp).  That can be done by setting ARMA_USE_CXX11 in
config.hpp (or I think that CMake will do that automatically when
configuring Armadillo... I am not sure).

The reason this is all necessary is because mlpack makes heavy use of
size_t for index types.  On some systems, this is a 64-bit type.  So it
must be ensured, in those cases, that Armadillo can handle 64-bit types.

I think that it would be worthwhile to implicitly set ARMA_USE_U64S64 in
mlpack/core.hpp, so that whenever mlpack is included, 64-bit Armadillo
types will be available.  I've made that change in r16989, so future
releases should be able to handle these situations better.

-- 
Ryan Curtin    | "So, it's just you 57 punks against KUNG FU JOE?"
ryan at ratml.org |   - Kung Fu Joe


More information about the mlpack mailing list