Building vIST/e from source: Mac OSX
Installing XCode
You need XCode to get the necessary GNU build tools. It may be included in your Mac OSX installation. Otherwise you can get it here.
Building Qt
- Go to http://qt-project.org/downloads and download the source code of the Qt libraries, e.g., http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.6.4.tar.gz. Unpack the source in a directory of your choice, e.g., /Users/Username/QtLibs/4.8.2.
- Open a terminal window and go to the directory /Users/Username/QtLibs/4.8.2. Here, type './configure --debug-and-release' (without quotes). This will build the qmake executable and may take some time.
- When the configuration finishes, type 'make' to build the Qt sources. This may take a very long time (like several hours).
- When the build finishes, type 'sudo make -j1 install' to install the Qt framework on your system. This requires administrator rights. The '-j1' option ensures only a single thread is used, this in order to avoid some racing conditions.
Installing Qt
Component |
Installation Folder |
Qt Designer, Qt Linguist |
/Developer/Applications/Qt |
Qt Documentation |
/Developer/Documentation/Qt |
Qt Examples |
/Developer/Examples/Qt |
Qt Plugins |
/Developer/Applications/Qt/Plugins |
Qt Frameworks |
/Library/Frameworks |
Qt Libraries |
/usr/lib |
Qt Debug Libraries |
/usr/lib |
Qt Tools |
/Developer/Tools/Qt (symbolic links to /usr/bin) |
Qt Uninstall Script |
/Developer/Tools/uninstall-qt.py |
Note: Qt is installed as a Mac OSX framework. This means there are no explicit dynamic link libraries to be found, such as MyLib.dylib.
Installing CMake
Checkout vIST/e source code
This step assumes you have a valid username and password combination for accessing the SVN repository of vIST/e. If you do not have this, contact the developers at Eindhoven University of Technology (viste.tue at gmail.com). In the following we assume the username is USERNAME.
- Go to a folder where you wish to check out the vIST/e project, e.g., /Users/YourName
- Right-click in this folder, and select SVN Checkout....
- In the URL of Repository text field, type https://USERNAME@svn.berlios.de/svnroot/repos/viste/trunk
- In the Checkout Directory text field a /Users/YourName/viste is already suggested. You can use it or suggest a different directory (e.g. a subfolder trunk).
- Press Ok to check out.
- In the viste/trunk folder you will find a script 'FixQtDBusProblem.sh' that you need in the next steps (building VTK and configuring/installing vIST/e)
Building VTK
vIST/e relies heavily on VTK. Unfortunately, VTK does not come with a ready-made Mac installer so we have to build VTK from source. Fortunately, this is relatively easy.
- Go to http://www.vtk.org/VTK/resources/software.html and download version 5.8 of VTK. Select either the ZIP or TAR.GZ file. Note that the (current) latest version 5.10 does not completely work. They removed many Qt-related files which vIST/e depends on.
- Unpack the source code in a folder of your choice, e.g., /Users/YourName/VTK.
- Start CMake and specify the source folder you chose in the previous step
- As target folder, specify another folder, e.g., /Users/YourName/VTK_build. Do not use the same folder as the source folder, because it will get cluttered with build files. Always try to keep source folders and build (target) folders separate.
- Check the 'Grouped' and 'Advanced' checkboxes.
- Press 'Configure' button and choose 'Yes' when CMake asks to create the VTK_build directory.
- CMake asks what type of project you want to generate. Choose 'Unix Makefiles' and press 'Ok'.
- When the configure finished, a list of red-colored items is displayed. The following items should be set to the following values:
Configure Item |
Value |
CMAKE/CMAKE_INSTALL_PREFIX |
/usr |
BUILD/BUILD_SHARED_LIBS |
TRUE |
VTK/VTK_USE_QT |
TRUE |
- The CMake install prefix should be changed from /usr/local to /usr
- Then press 'Configure' again. A few red-colored items remain. However, press 'Configure' again.
- Finally, press 'Generate' to create a Unix make file.
Bugfix: missing QtDBus framework
For some reason the latest Qt library installation does not correctly copy the QtDBus framework. If you look in /Library/Frameworks/QtDBus.framework you will see that it misses most of the usual directory contents. If you build VTK without fixing this problem, you will get errors such as this:
Link CXX executable ../../../../bin/QVTKCxxTests
ld: framework not found QtDBus
collect2: ld returned 1 exit status
make[2]: *** [bin/QVTKCxxTests] Error 1
make[1]: *** [GUISupport/Qt/Testing/Cxx/CMakeFiles/QVTKCxxTests.dir/all] Error 2
make: *** [all] Error 2
To solve this problem, you need the 'FixQtDBusProblem.sh' script from the vIST/e trunk directory. Copy this script to your /Users/YourName/VTK_build directory and execute it. It removes all linker references to the QtDBus framework in the VTK build files.
Now you can continue with the remainder of the VTK build procedure:
- Open a terminal window and go to the folder /Users/YourName/VTK_build.
- Type 'make' and the VTK library will be built.
- Type 'sudo make install'. This will copy the VTK libary to the /usr/lib folder and make it globally accessible on your system.
-
Finally, open the .profile file in your /Users/YourName directory and add the following lines:
export VTK_DIR=/usr/lib/vtk-5.8
export PATH=$VTK_DIR:$PATH
export DYLD_LIBRARY_PATH=$VTK_DIR:$DYLD_LIBRARY_PATH
This will ensure that the VTK libraries can be found on your system.
- Start CMake.
- Set the source directory to /Users/YourName/viste.
- Set the binary directory to /Users/YourName/viste_build (or some other folder you prefer). Do not use the same binary folder as your source folder because this will become confusing when you commit your changes to SVN (if you have permission to do that of course). Even so, it is always a good idea to keep source code and binaries separated.
- Press Configure and select the desired generator (the same one you used for VTK, so that should be "Unix Makefiles".
- After the first configure step is finished, you see a list of red colored options. vIST/e by default enabeld all plugins except those that require special libaries. For example, the IllustrativeClusters plugin requires GLEW and is disabled. Also, the FiberTrackingCUDA plugin requires CUDA and is also disabled.
- For the rest you can keep everything as is, and press Configure again until everything is no longer red colored.
- Then press Generate to generate the Makefiles.
- Open a terminal window and go to the 'viste_build' directory. Type 'make' to build vIST/e.
- When the build finishes you should be able to start vIST/e by typing './tool/bin/vISTe' (without quotes)