VL_COMPILENN - Compile the MatConvNet toolbox.

The vl_compilenn() function compiles the MEX files in the MatConvNet toolbox. See below for the requirements for compiling CPU and GPU code, respectively.

vl_compilenn('OPTION', ARG, ...) accepts the following options:

Compiling the CPU code

By default, the EnableGpu option is switched to off, such that the GPU code support is not compiled in.

Generally, you only need a 64bit C/C++ compiler (usually Xcode, GCC or Visual Studio for Mac, Linux, and Windows respectively). The compiler can be setup in MATLAB using the

   mex -setup

command.

Compiling the GPU code

In order to compile the GPU code, set the EnableGpu option to true. For this to work you will need:

The following configurations or anything more recent (subject to versionconstraints between MATLAB, CUDA, and the compiler) should work:

Many older versions of these components are also likely to work.

Compilation on Windows with MinGW compiler (the default mex compiler in Matlab) is not supported. For Windows, please reconfigure mex to use Visual Studio C/C++ compiler. Furthermore your GPU card must have ComputeCapability >= 2.0 (see output of gpuDevice()) in order to be able to run the GPU code. To change the compute capabilities, for mex CudaMethod edit the particular config file. For the 'nvcc' method, compute capability is guessed based on the GPUDEVICE output. You can override it by setting the 'CudaArch' parameter (e.g. in case of multiple GPUs with various architectures).

See also: Compliling MatConvNet, Compiling MEX files containing CUDA code, vl_setup(), vl_imreadjpeg().