mtoc++  1.5
mtoc++: Doxygen filter for MatLab .m files
 All Classes Namespaces Variables Pages
mtoc++ installation instructions

Make sure you have the latest version of mtoc++, see Downloading mtoc++ 1.5. Next step after installation is Configuration and use of mtoc++

Software requirements and recommendations

The following programs need to be available on your machine in order to use mtoc++:

The following programs will highly improve your documentation creation experience if available:

If you want to build mtoc++ from source, you will also need:

Using precompiled binaries

Windows users

If you are a windows user you can directly download the binaries at Downloading mtoc++ 1.5. Then simply place the binaries in a folder of your choice and add the folder to the PATH environment variable. If you intend to use the MatlabDocMaker, you can also copy the mtoc++ binaries into the "documentation configuration files" folder for your/each project, this path will be added to PATH by MatLab locally.

Depending on your system setup, you might need to install the Microsoft Visual C++ 2010 redistributables, which can be found here.
mtoc++ as well as doxygen expect all required programs (see Software requirements and recommendations) to be available via the PATH environment variable, e.g. latex.exe or gswin32c.exe must be present in order for doxygen to work with LaTeX output. Make sure that you have all requirements available, otherwise doxygen or the MatlabDocMaker will complain soon enough. You can check/change your Windows PATH environment variable via the sequence
Computer \ Properties \ Advanced system settings \ Environment Variables \ Edit Path

We are trying to always compile current Windows binaries for mtocpp and mtocpp_post and include them for direct download.

Unix binaries

For unix users we recommend to compile the sources following Compiling mtoc++ from source.

However, we also plan to provide some precompiled linux binaries/packages soon. If you find a matching choice you can use it and all you have to do is to ensure that the binaries can be found on the environment PATH.

Compiling mtoc++ from source

Please check the Software requirements and recommendations when you intend to build mtoc++ yourself.

mtoc++ is built using the cmake (cross-platform make) tool. This tool is available for both unix and Windows, however, we only tested compiling our sources on linux and MS Visual Studio 2010.

Windows platforms

For Windows compilation, you need a Windows C++ compiler (e.g. MinGW or Visual Studio). Then running the CMake GUI allows you to choose a compiler, specify any CMake configuration settings and create the makefiles/Visual Studio projects needed for compilation.

Furthermore, we're using the dirent.h library for file access. As this is a linux library we've included a file dirent_msvc.h in our source, which implements the dirent api for Microsoft Visual Studio and was written by Tony Ronkko. More information and downloads can be found at

On Windows, you can build both 32bit and 64bit versions. If you build with Visual Studio, in recent CMake versions you need to specify the target architecture already when choosing the generator ("Visual Studio 10 / Visual Studio 10 Win64"). This sets up the VS2010 project with the correct platforms. In general, you can of course also use 64bit binaries from ragel and doxygen, but this is not required for successful 64bit-compilation of mtoc++ .

Unix platforms

The following procedure is an example of how to compile mtoc++ on a linux machine:

tar -xcvf mtocpp.tar.gz
* cd mtocpp
* # Create build folder (optional, but more clean)
* mkdir build
* cd build
* # Run cmake
* cmake ..
* make install
Please be aware that, depending on your installation location, you might need different access/write permissions. For most cases, a
sudo make install
will do the job if the above snippet fails.

Apple hints

For installation under recent Apple OS like 10.8.2, the MacPorts project is a very useful tool to obtain prerequisites for mtoc++ compilation. Once installed, get ragel and doxygen via

* sudo port
* > install ragel
* > install doxygen

CMake options: Installation folders and customization

These options are explained for the linux case, for windows the CMake GUI allows to set the relevant options.

The default value for the install prefix is /usr/local, so the mtocpp binaries mtocpp and mtocpp_post go to /usr/local/bin and the documentation is created inside /usr/local/share/doc/mtocpp.

If you want the "make install" command to copy the binaries and documentation to different locations, you can choose them by setting the following variables:

So typing

cmake -DCMAKE_INSTALL_PREFIX="/my/root/dir" -DCUSTOM_DOC_DIR="/my/docs"

will copy the binaries to /my/root/dir/bin and the documentation to /my/docs.

If you left the CUSTOM_DOC_DIR flag empty the documentation would have gone to /my/root/dir/share/doc/mtocpp


mtoc++ comes with some unit tests to check for e.g. successful compilation. Run the tests by typing

make test

in the same folder where you called cmake.

On Windows, dedendent on your compiler, you will either have makefiles for the test cases or a separate Visual Studio project to run the tests.

Have fun!