Build Instructions

The first step is to get the source code. The recommended way is to use our public Subversion repository. Furthermore the Qt libraries are needed (version 4.5 or newer is recommended).

The Voreen project consists of several parts. The core library and the Qt add-on library are located in the src directory. Several applications can be found in the apps directory. The VoreenVE application is located in apps/voreenve. This is the main application for developing and testing new features and many features of the Voreen library are supported within this application.


Configuration 

To use Voreen you have to build the core library and usually also the Qt add-on library. The configuration of Voreen is done in the configuration file config.txt in the main directory. Usually it is a good idea to use the template file config-default.txt, rename it to config.txt and adapt it to your specific needs. Especially the use of external libraries and thus the functionality of Voreen can be changed here, e.g., the DICOM and Python support by enabling the respective modules.


Building on Windows using Microsoft Visual Studio

Starting with Qt 4.6 there are prebuilt binaries available for Visual Studio. Alternatively, you can compile it yourself. For integration into the Visual Studio IDE, the Qt Visual Studio Add-in can be used.

Summary

  1. Copy config-default.txt to config.txt and adapt it, if necessary.
  2. Rename qmake-default.bat to qmake.bat and adapt it to your Visual Studio version (line 6/7).
  3. Execute qmake.bat either by double-clicking on its icon or in a console window.
  4. Open voreen.sln in Visual Studio using File->Open->Project/solution. 
  5. Set voreenve as startup project and set the dependencies (all projects depends on tgt; voreenve depends on voreen_core and voreen_qt; voreen_qt depends on voreen_core).
  6. If you have enabled modules with external dependencies, copy the dlls stored in the respective modules' ext directories src/modules/<module>/ext to apps/voreenve.
  7. Compile and run.

Details 

Two steps are needed to build a Voreen application. The first step is to create the Visual Studio project files and the second to build the library and application.

A batch file qmake-default.bat is provided to create the project files, which should be renamed to qmake.bat and adapted accordingly. The path to the Qt libraries has to be adapted if it is not already in your system's path variable. Then the used version of the Developer Studio has to be selected (remove the rem in the line containing win32-msvc2005 for VS 2005 or win32-msvc2008 for VS 2008, respectively). Then execute the batch file by either double-clicking on its icon or calling the file name from a command line prompt. Now the project files will be created. This has only to be done once (and every time you changed the project settings).

Now you can open Visual Studio and via selecting File->Open->Project/solution and then choosing src/core/voreen_core.vcproj open the core library project. Now the Qt add-on library should be added by choosing File->Add->Existing project and selecting the file src/qt/voreen_qt.vcproj. Finally, the VoreenVE application can be added: apps/voreenve/voreenve.vcproj
It is recommended to set the project dependencies in the following way: the applications depend on the core library and the Qt add-on library, and the Qt add-on library depends on the core library (the project dependencies can be found in the menu Project->Project Dependencies). Now the project can be built. Before executing the application, some missing DLLs from the ext directory as well as the src/modules/<module>/ext directories have to be copied to the application directory. Which DLLs are needed, depends on your specific configuration.

Build Issues

If you get unresolved references when compiling with Qt SDK 2010.01 and Visual Studio 2008 you might try to delete mocinclude.tmp files in the build directory as described in this post.


Building on Windows using MinGW / Qt Creator

Voreen can be build directly using the MinGW compiler included in the Qt SDK. The libraries for the configuration options VRN_WITH_DEVIL and VRN_WITH_FONTRENDERING are included in the ext/ directory, so these can be activated in config.txt.

In the Qt Creator IDE just open the project file voreen.pro, build, and run.

To build on the command line, open the "Qt Command Prompt", change to the directory containing the Voreen source code, run qmake voreen.pro, and then mingw32-make.


Building on Linux

Voreen needs Qt version 4.4 or newer. By using qmake -v, you should verify that you have called the correct version of qmake (do not use a previously installed Qt 3 version). Otherwise $PATH must be adapted or the correct qmake must be called with its full path (often something like qmake-qt4 is available).

Voreen needs GLEW 1.4, and optionally DevIL (for saving screenshots) and DCMTK (for reading DICOM files). You can either use the packages coming with your Linux distribution or you can compile and install them yourself. As you can see from below, we have exemplarily choosen the target directory /usr/local for installing.

It is possible that include paths and libary directories have to be adapted in config.txt:

	INCLUDEPATH += /usr/local/include
	LIBDIR += -L/usr/local/lib

The remaining defines should be revised with focus on support for different functionalities like Python or Freetype.

Now you should be able to build the Voreen library and the voreenve application by using qmake voreen.pro and make.


Building on Mac OS X

This section describes how to build and run Voreen on Mac OS X. In principle, it is possible to build Voreen on both PowerPC and Intel Macs. However, we did not manage to successfully run a Voreen application on a PowerPC Mac.

Libraries

If not already installed, you have to download and install the Qt library for Mac OS X (version 4.4 or newer is required). For convenience, we recommend the binary distribution provided as DMG.
You’ll need also GLEW 1.5 to be installed. Simply download it at http://glew.sourceforge.net/ and type sudo make install -e SYSTEM=darwin. Alternatively you can fetch it from MacPorts.

Configuration

The first step is to set up the configuration file. Copy over config-default.txt to config.txt and adapt it to your needs. It is reasonable to disable the use of any optional external library at first in order to be able to localize build problems more easily. If you activate the use of further external libraries in the configuration file, you have to place the respective libraries in your library search path.

Compiling using make

You can build Voreen with make or Xcode. This builds the Voreen library and the VoreenVE application with make:

cd voreen
qmake -spec macx-g++ voreen.pro
make

The VoreenVE application is then located at apps/voreenve/.

Compiling with Xcode

For building Voreen with Xcode we let qmake create the Xcode project files for the core library, the Qt add-on library, and the VoreenVE application from the Qt .pro files using the script: voreen/qmake-xcode.sh.

The next step is to open the generated project files (in src/core/, src/qt/ and apps/voreenve/) with Xcode and actually build the projects. The core library and the Qt add-on library need to be built first since VoreenVE depends on them. Before building the core library make sure you have disabled the option “Always Search User Path” in the Xcode project settings. If this option is enabled, user header search paths and system header search paths are not treated separately by the compiler, leading to name clashes.