.TH "build" 3 "Tue Sep 9 2014" "Version 1.0.10" "MLPACK" \" -*- nroff -*- .ad l .nh .SH NAME build \- Building MLPACK .SH "Introduction" .PP MLPACK uses CMake as a build system and allows several flexible build configuration options\&. One can consult any of numerous CMake tutorials for further documentation, but this tutorial should be enough to get MLPACK built and installed\&. .SH "latest mlpack build" .PP Download latest mlpack build from here : \fCmlpack-1\&.0\&.10\fP .SH "Creating Build Directory" .PP Once the MLPACK source is unpacked, you should create a build directory\&. .PP .PP .nf $ cd mlpack-1\&.0\&.10 $ mkdir build .fi .PP .PP The directory can have any name, not just 'build', but 'build' is sufficient enough\&. .SH "Dependencies of MLPACK" .PP MLPACK depends on the following libraries, which need to be installed on the system and have headers present: .PP .IP "\(bu" 2 Armadillo >= 3\&.6\&.0 (with LAPACK support) .IP "\(bu" 2 LibXML2 >= 2\&.6\&.0 .IP "\(bu" 2 Boost (math_c99, program_options, unit_test_framework, random, heap) >= 1\&.49 .PP .PP In Ubuntu and Debian, you can get all of these dependencies through apt: .PP .PP .nf # apt-get install libboost-math-dev libboost-program-options-dev libboost-random-dev libboost-test-dev libxml2-dev libarmadillo-dev .fi .PP .PP If you are using an Ubuntu version older than 13\&.10 ('Saucy Salamander') or Debian older than Jessie, you will have to compile Armadillo from source\&. See the README\&.txt distributed with Armadillo for more information\&. .PP On Fedora, Red Hat, or CentOS, these same dependencies can be obtained via yum: .PP .PP .nf # yum install boost-devel boost-random boost-test boost-program-options boost-math libxml2-devel armadillo-devel .fi .PP .PP On Red Hat Enterprise Linux 5 and older (as well as CentOS 5), the Armadillo version available is too old and must be compiled by hand\&. The same applies for Fedora 16 and older\&. .SH "Configuring CMake" .PP Running CMake is the equivalent to running \fC\&./configure\fP with autotools\&. If you run CMake with no options, it will configure the project to build with debugging symbols and profiling information: .PP .PP .nf $ cd build $ cmake \&.\&./ .fi .PP .PP You can specify options to compile without debugging information and profiling information (i\&.e\&. as fast as possible): .PP .PP .nf $ cd build $ cmake -D DEBUG=OFF -D PROFILE=OFF \&.\&./ .fi .PP .PP The full list of options MLPACK allows: .PP .IP "\(bu" 2 DEBUG=(ON/OFF): compile with debugging symbols (default ON) .IP "\(bu" 2 PROFILE=(ON/OFF): compile with profiling symbols (default ON) .IP "\(bu" 2 ARMA_EXTRA_DEBUG=(ON/OFF): compile with extra Armadillo debugging symbols (default OFF) .PP .PP Each option can be specified to CMake with the '-D' flag\&. Other tools can also be used to configure CMake, but those are not documented here\&. .SH "Building MLPACK" .PP Once CMake is configured, building the library is as simple as typing 'make'\&. This will build all library components as well as 'mlpack_test'\&. .PP .PP .nf $ make Scanning dependencies of target mlpack [ 1%] Building CXX object src/mlpack/CMakeFiles/mlpack\&.dir/core/optimizers/aug_lagrangian/aug_lagrangian_test_functions\&.cpp\&.o <\&.\&.\&.> .fi .PP .PP You can specify individual components which you want to build, if you do not want to build everything in the library: .PP .PP .nf $ make pca allknn allkfn .fi .PP .PP If the build fails and you cannot figure out why, register an account on Trac and submit a ticket and the MLPACK developers will quickly help you figure it out: .PP http://mlpack.org/ .PP Alternately, MLPACK help can be found in IRC at #mlpack on irc\&.freenode\&.net\&. .SH "Installing MLPACK" .PP If you wish to install MLPACK to /usr/include/mlpack/ and /usr/lib/ and /usr/bin/, once it has built, make sure you have root privileges (or write permissions to those two directories), and simply type .PP .PP .nf # make install .fi .PP .PP You can now run the executables by name; you can link against MLPACK with -lmlpack, and the MLPACK headers are found in /usr/include/mlpack/\&.