17.3. Linux Guide

17.3.1. MeVisLab on Linux

This section shows how to handle MeVisLab on Linux: Installing MeVisLab

Installation is quite easy. Get MeVisLab from http://www.mevislab.de/download/. Only a 64-bit version is available, so you must have a 64bit version of Linux installed. After the download you must make the installer executable. Run the command 'chmod u+x' and execute it. Select an installation directory. We will refer to it as InstallDirectory from now.


Users who want to run MeVisLab must have read and write permissions to all files in the MeVisLab installation directory. Keep this in mind when installing MeVisLab as the root user. Running MeVisLab

You can start MeVisLab from the applications menu entry. Alternatively, you can run InstallDirectory/bin/MeVisLab. InstallDirectory/bin/MeVisLab_d will start the debug version of MeVisLab. Module Development on Linux

MeVisLab offers "Module Wizards", which are accessible via the file menu. They create the skeleton of ML and Inventor modules. The sources are created in a folder named by your module in the "Source" subdirectory of a MeVisLab package.

Some environment variables are required to build C++ modules, for example MLAB_ROOT and LD_LIBRARY_PATH.

  • MLAB_ROOT must point to InstallDirectory/Packages.

  • LD_LIBRARY_PATH must contain the lib-paths of packages that are not located in MLAB_ROOT.

You should not have to bother with these variables, because a script exists that opens a bash context with the correct values of these variables: InstallDirectory/bin/mlshell. Run it in a terminal to set up development environment.

The next step is to create the makefiles. Therefore simply execute the bash script inside your modules source directory (it is named just like your module).Now you can type make -f Makefile."modulename" (or use mlmake) to compile and link your module. If everything works fine, the library will be copied to the lib directory of the package. If MeVisLab is running, then it will be copied to lib/updated instead. It will be moved to lib during the next MeVisLab restart.


To avoid problems you should use the same compiler version that MeVisLab was built with. The required version is mentioned in the Linux readme file: InstallDirectory/Packages/MeVisLab/Resources/Documentation/Publish/SDK/LinuxReadme.txt. You can check your compiler version by running gcc -dumpversion.


If you have multiple CPUs, then you can pass -j n to make for parallel execution, where n must be replaced by the number of parallel processes.


MeVisLab supports the Code::Blocks IDE (http://www.codeblocks.org/). A Code::Blocks project is created next to the makefiles. It is called "modulename".cbp.


You can use InstallDirectory/bin/mlmake and InstallDirectory/bin/mlcodeblocks to run make and Code::Blocks from outside the bash context created with InstallDirectory/bin/mlshell. Debugging on Linux

Use the gdb from the bash context created with InstallDirectory/bin/mlshell. The MeVisLab executable for debugging is InstallDirectory/Packages/MeVisLab/IDE/bin. You can also use the script InstallDirectory/bin/mlgdb from outside the bash context. If it is started without arguments, then it uses MeVisLab as debug target, otherwise all arguments are passed to the gdb.