[mlpack] installing mlpack 1.0.10 on Windows with MinGW/MSYS

Gilles Barges gbarges at free.fr
Sun Aug 31 13:12:31 EDT 2014


hello,

This is how I (almost) installed mlpack 1.0.10 on Windows7-64 bits.

- The compiler toolchain is MinGW+MSYS. MSVC++ is not installed. Using TDM-GCC-64 compiler, installed in C:\TDM-GCC-64\ 
- BLAS/LAPACK : using /usr/local/bin/libopenblas.dll (no separate LAPACK lib)
- Armadillo is installed in /usr/include. WRAPPER is off.

Between each 'cmake' or 'make' command, all files are removed in the build directory.

$ cmake -G "MSYS Makefiles" ..

  cannot find Armadillo

$ cmake -G "MSYS Makefiles" -DARMADILLO_INCLUDE_DIR=/usr/include ..

  -- Using OpenBLAS for BLAS: C:/Users/gbg/Desktop/msys/1.0/local/bin/libopenblas.dll
  FATALCannot find LAPACK library, but ARMA_USE_LAPACK is set …

$ cmake -G "MSYS Makefiles" -DARMADILLO_INCLUDE_DIR=/usr/include -DLAPACK_LIBRARY=/usr/local/bin/libopenblas.dll ..

  -- Using standard LAPACK: C:/Users/gbg/Desktop/msys/1.0/local/bin/libopenblas.dll
  FATALCannot find BLAS library, but ARMA_USE_BLAS is set.  Try specifying BLAS libraries manually by setting the BLAS_LIBRARY variable.

$ cmake -G "MSYS Makefiles" -DARMADILLO_INCLUDE_DIR=/usr/include -DBLAS_LIBRARY=/usr/local/bin/libopenblas.dll -DLAPACK_LIBRARY=/usr/local/bin/libopenblas.dll ..

  Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
  (Required is at least version "2.6.0")

$ cmake -G "MSYS Makefiles" -DARMADILLO_INCLUDE_DIR=/usr/include -DBLAS_LIBRARY=/usr/local/bin/libopenblas.dll -DLAPACK_LIBRARY=/usr/local/bin/libopenblas.dll -DLIBXML2_INCLUDE_DIR=/usr/local/include/libxml2 ..

  Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES) (found suitable version  "2.9.1", minimum required is "2.6.0")

$ cmake -G "MSYS Makefiles" -DARMADILLO_INCLUDE_DIR=/usr/include -DBLAS_LIBRARY=/usr/local/bin/libopenblas.dll -DLAPACK_LIBRARY=/usr/local/bin/libopenblas.dll -DLIBXML2_INCLUDE_DIR=/usr/local/include/libxml2 -DLIBXML2_LIBRARIES=/usr/local/bin/libxml2-2.dll ..

  CMake Warning at CMakeLists.txt:140 (message): zlib1.dll not found! libxml2.dll may depend on this, and if it is not present MLPACK may not work.
  CMake Warning at CMakeLists.txt:146 (message): iconv.dll not found! libxml2.dll may depend on this, and if it is not present MLPACK may not work.
  CMake Error at CMakeLists.txt:154 (message):   iconv.h not found! It can be placed in a standard include directory or the LibXml2 include directory.

On my system, iconv.h is in C:\TMD-GCC-64\include , which is also /mingw/include under MSYS environment.
As suggested, I copy iconv.h to /usr/include -> KO, still not found
Copy it to /usr/local/include/libxml2 -> OK, found.

$ cmake …the same…

  Unable to find the requested Boost libraries.
  Unable to find the Boost header files.

$ cmake -G "MSYS Makefiles" -Wno-dev -DARMADILLO_INCLUDE_DIR=/usr/include -DBLAS_LIBRARY=/usr/local/bin/libopenblas.dll -DLAPACK_LIBRARY=/usr/local/bin/libopenblas.dll -DLIBXML2_INCLUDE_DIR=/usr/local/include/libxml2 -DLIBXML2_LIBRARIES=/usr/local/bin/libxml2-2.dll -DBOOST_INCLUDEDIR=/usr/local/include/boost-1_55 -DBOOST_LIBRARYDIR=/usr/local/lib ..

OK

$ make

  tons of warnings in boost code [-Wunused-local-typedefs], ruining the nice colored progress presentation :-)
  mlpack.a linked
  CMakeFiles/cf.dir/objects.a(cf_main.cpp.obj):cf_main.cpp: undefined reference to `boost::program_options::validate(boost::any&, ...
  SOLUTION: in CMakeLists.txt, comment set(Boost_LIBRARIES "") at line 189

$ rm -fr * ; cmake same_options_as_previous
$ make

mlpack.a and all exe are generared, except the last one (mlpack_test.exe) that fails with 4 errors, the same I reported in mlpack Digest, Vol 18, Issue 5 and led to http://www.mlpack.org/trac/ticket/360

As 'make' fails, 'make install' fails. Had to install by hand.



So, I have suggestions to improve the mlpack installer:

- detect MinGW/MSYS environment. Maybe by testing the $MSYSTEM env. var., which is set to MINGW32 ?
- add /mingw/include in the include search path
- in CMakeLists.txt at line 189, do not clear Boost_LIBRARIES if Windows + MingW
- let 'make install' install the lib and the headers, even if not all exes are build ? 

Hope this can help.

--
Gilles Barges.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20140831/f3061cee/attachment.html>


More information about the mlpack mailing list