I’ve used the Shogun Machine Learning Toolbox under Win32, compiled in the Cygwin environment, as described in the documentation. However, for processing a large data set, I needed a 64bit build. As there is currently no 64bit version of Cygwin, I followed the approach described here, using MinGW-w64.
The current version of Cygwin includes MinGW-w64, as well as an appropriate build of pthreads (if needed: compile pthreads as described here).
To configure, pass the MinGW-w64 to the script:
--cc=/usr/bin/x86_64-w64-mingw32-gcc --cflags=-m64 --cxx=/usr/bin/x86_64-w64-mingw32-gcc --cxxflags=-m64
Note: the path needs to be included due to a bug in MinGW-w64, as described on the MinGW-w64 site:
The mingw-w64 toolchain has been officially added to Cygwin mirrors, you can find the basic C toolchain as mingw64-x86_64-gcc-core. The languages enabled are C, Ada, C++, Fortran, Object C and Objective C++. There is a known caveat where calling the compiler directly as “/bin/x86_64-w64-mingw32-gcc” will fail, use “/usr/bin/x86_64-w64-mingw32-gcc” instead and make sure that your PATH variable has “/usr/bin” before “/bin”.
In addition, we add the following libraries to the linker:
-lstdc++ -lmsvcrt -lpthread
As MinGW-w64 has WIN32 defined (in contrast to GCC under Cygwin), there are a number of issues in the Shogun code that need to be fixed (see patch).
Currently, the following issues in the code are still unresolved:
- only command line static interface is supported
- MemoryMappedFile is not implemented (needs reimplementation based on Win API
After the Shogun library is built, ranlib needs to be run before building the command line interface:
/usr/bin/x86_64-w64-mingw32-ranlib shogun/libshogun.a
The resulting command line application needs the MinGW DLLs in the path. It also has the following limitations:
- some strange characters in console (instead of colors)
- issues with locale setting in when serialising/parsing files
- applications exists on exceptions from SG_ERROR

