Menu

BuildWindowsVS2010

vISTe

Build vIST/e from source: Visual Studio 2010 64-Bit

Install Visual Studio 2010

  • It is important that you are able to download Visual Studio 2010 not Visual C++ 2010. If it is not possible move to the Visual Studio 2012 64-bit installation [Wiki:BuildWindowsVS2012].

  • Go to http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express.

  • Click on Visual C++ 2010 Express Edition.
  • Download 30-day evaluation version.
  • Install and register Visual Studio 2010. If you encounter problems while registering Visual Studio 2010, you can follow the instructions at the bottom of this WIKI page to circumvent this issue.

Configure CMake for 64-bit

  • Assuming you have CMake installed, add its bin directory to the system PATH so you can run it from the command-line. This is necessary because running the regular GUI version automatically defaults to the 32-bit Visual C++ compiler. You need to be able to run CMake from the 'Visual Studio x64 Win64 Command Prompt (2010)'. Also, running the CMake GUI for the first time does not work. For some reason, it keeping referring to the 32-bit Microsoft compiler. You have to start with a command-line run of CMake (from the Visual Studio x64 Win64 Command Prompt (2010)). Once you have done this, a CMakeCache.txt has been generated containing all the right settings. Then you can run the Cmake GUI for any additional configuration steps.

Build Qt for 64-bit

The Qt binaries that can be downloaded from the Qt website are 32-bit by default. This means for 64-bit you have to build Qt yourself from source code. The following steps will explain how.

  • Download Qt source code at http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-4.8.2.zip and unpack it to directory C:\QtLibs and rename the directory 'qt-everywhere-opensource-src-4.8.2' to '4.8.2-x64'.
  • Go to Start > All Programs > Microsoft Visual Studio 2010 > Visual Studio Tools > Visual Studio x64 Win64 Command Prompt (2010). All build operations will now be done in 64-bit mode.
  • In the DOS window type 'cd C:\QtLibs\4.8.2-x64'.
  • Type 'configure.exe -debug-and-release'. This will prepare the Qt build for 64-bit platforms, generating both debug and release libraries. This may take a while.
  • When the preparation is finished, type 'nmake' to start the 64-bit build of Qt. This may take a very long time, i.e., several hours. It's best to start this process at the end of the day. When you come back the next day everything should be ready.
  • When the build has finished add the directory C:\QtLibs\4.8.2-x64\bin to the system PATH and the directory C:\QtLibs\4.8.2-x64 as the QTDIR system variable (create it if it does not exist).

Build VTK for 64-bit

  • Download the latest release of the VTK source code at http://www.vtk.org/VTK/resources/software.html. Unpack it to a directory, e.g., C:\VTK. At the time of writing the latest release is 5.8.0.
  • Create a build directory C:\VTKLibs\5.8.0-x64.
  • Go to Start > All Programs > Microsoft Visual Studio 2010 > Visual Studio Tools > Visual Studio x64 Win64 Command Prompt (2010).
  • In the command line, go to C:\VTKLibs\5.8.0-x64 and run 'cmake -G "Visual Studio 10 Win64" ..\..\VTK' (without quotes). This will generate a Visual C++ project based on the 64-bit compiler.
  • When CMake finishes, run it again but now as GUI, that is, type 'cmake-gui'. It will automatically open the VTK project settings. Set the VTK_USE_QT and BUILD_SHARED_LIBS options to TRUE and press 'Configure'.
    If items are still red, press Configure again until no red items remain. Then press 'Generate' to generate (or update) the Visual C++ project.
  • Open the VTK.sln file. Check that the solution configuration is set to 'Debug' and the platform is set to 'x64'. Then press F7 to build the source. This may take a while (around 30 minutes). You should not use the 'Release' configuration. Everything will build fine and vIST/e can also be built in release mode without problems. However, when you try to run vIST/e it produces all kinds of errors that, so far, have not been looked into. For this reason, we stick to debug mode.
  • When the build has finished add the directory C:\VTKLibs\5.8.0-x64\bin\Debug to the system PATH.

Checkout vIST/e source code

The main source code tree of vIST/e is publicly accessible. For specific branches you need a valid username and password combination. Contact the developers at Eindhoven University of Technology if you need this (viste.tue at gmail.com).

  • (Optional) Install the Tortoise SVN client from http://tortoisesvn.net/downloads.html. You need this tool to access the SVN repository where the vIST/e source code is hosted. Installing Tortoise SVN will add SVN-specific menu items to every right-click operation you perform in Windows Explorer.

  • Go to a folder where you wish to check out the vIST/e project, e.g., C:\vISTe\subversion.

  • Right-click in this folder, and select SVN Checkout....
  • In the URL of Repository text field, type https://svn.berlios.de/svnroot/repos/viste-tool/trunk.
  • In the Checkout Directory text field a C:\vISTe\subversion\viste is suggested. You can use this one or remove the 'viste' part to put everything directly in the 'subversion' directory.
  • Press Ok to check out.

Configure and build vIST/e

  • We will assume the vIST/e source code is located in C:\vISTe\subversion.
  • Start CMake from the 64-bit command line as explained for the Qt and VTK builds.
  • Create a directory for the vIST/e binaries, e.g., C:\vISTe\builds\x64 (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.Please be sure that your build directory has no "-" character in it, because build directory name will be used in a preprocessor directive created during the cmake run.
  • Go to the build directory, i.e., C:\vISTe\builds\x64, and run cmake as follows 'cmake -G "Visual Studio 10 Win64" ..\..\subversion' (without quotes).
  • When this first step is finished, run the CMake GUI by typing 'cmake-gui'. Click configure until no more red colored items are visible. vIST/e by default enables 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.
  • When no more red colored items are visible, press Generate to generate the 64-bit Visual Studio solution.
  • Open the solution file Project.sln and make sure the configuration is set to 'Debug' and the platform 'x64'. Then press F7 to build all project modules. Note, again, that 'Release' mode will build fine (if you have also built VTK in release mode) but gives problems when starting vIST/e.
  • To launch vIST/e from Visual Studio, right-click the vIST/e project and select Set as Startup Project. Then press F10 to start vIST/e (in Debug mode).
  • At first startup, vIST/e may produce some messages, e.g., about a missing settings.xml (which it will create), but also about certain files being invalid Qt plugins. This is caused by the fact that the build directory where vISTe.exe is located also contains non-DLL files which the plugin loader tries to load. This fails of course and vIST/e shows an error. The best thing to do is to hold down the 'Enter' button to quickly run through all error messages until the tool itself starts. The next you start vIST/e this will not happen anymore.

Related

Wiki: BuildFromSource

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.