mlpack  3.0.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Building mlpack From Source on Windows

Introduction

This document discusses how to build mlpack for Windows from source, so you can later create your own C++ applications. There are a couple of other tutorials for Windows, but they may be out of date:

Github wiki Windows Build page Keon's tutorial for mlpack 2.0.3 Kirizaki's tutorial for mlpack 2

Those guides could be used in addition to this tutorial.

Environment

This tutorial has been designed and tested using:

The directories and paths used in this tutorial are just for reference purposes.

Pre-requisites

Windows build instructions

Dependencies

OpenBLAS Dependency

Boost Dependency

You can either get Boost via NuGet or you can download the prebuilt Windows binaries separately. This tutorial follows the second approach for simplicity.

Note
Make sure you download the MSVC version that matches your Visual Studio

Armadillo Dependency

cmake -G "Visual Studio 15 2017 Win64" -DBLAS_LIBRARY:FILEPATH="C:/mlpack/mlpack-3.0.4/packages/OpenBLAS.0.2.14.1/lib/native/lib/x64/libopenblas.dll.a" -DLAPACK_LIBRARY:FILEPATH="C:/mlpack/mlpack-3.0.4/packages/OpenBLAS.0.2.14.1/lib/native/lib/x64/libopenblas.dll.a" -DCMAKE_PREFIX:FILEPATH="C:/mlpack/armadillo" -DBUILD_SHARED_LIBS=OFF ..
Note
If you are using different directory paths, a different configuration (e.g. Release) or a different VS version, update the cmake command accordingly.

Building mlpack

cmake -G "Visual Studio 15 2017 Win64" -DBLAS_LIBRARY:FILEPATH="C:/mlpack/mlpack-3.0.4/packages/OpenBLAS.0.2.14.1/lib/native/lib/x64/libopenblas.dll.a" -DLAPACK_LIBRARY:FILEPATH="C:/mlpack/mlpack-3.0.4/packages/OpenBLAS.0.2.14.1/lib/native/lib/x64/libopenblas.dll.a" -DARMADILLO_INCLUDE_DIR="C:/mlpack/armadillo-8.500.1/include" -DARMADILLO_LIBRARY:FILEPATH="C:/mlpack/armadillo-8.500.1/build/Debug/armadillo.lib" -DBOOST_INCLUDEDIR:PATH="C:/boost/boost_1_66_0/" -DBOOST_LIBRARYDIR:PATH="C:/boost/boost_1_66_0/lib64-msvc-14.1" -DDEBUG=OFF -DPROFILE=OFF ..

You are ready to create your first application, take a look at the Sample C++ ML App