Skip to content

Build Vaa3D on Windows (VS2010 and QMake)

Mars Kuo edited this page Jan 21, 2019 · 35 revisions

This is an instruction to build a 64-bit Vaa3D and its plugins on Windows, using QMake and MS Visual Studio 2010.

Open a 64-bit command prompt

Open "Visual Studio 2010 x64 Win64 Command Prompt" (for 64bit building) window.

Note: All commands throughout the instruction are meant to be executed in this command prompt.

Download Vaa3D Source Code

Check out source code from github code repositories, one for main Vaa3D code and one for released plugins. You can follow the instructions for both Vaa3D program and its default plugins. Choose one of the below approaches at your convenience.

First, enter the directory where you want Vaa3D to be installed.

Approach 1 – via git commands

Make sure you have GIT installed. If not, it can be downloaded here: https://git-scm.com/downloads.

git clone --recursive https://github.com/Vaa3D/v3d_external.git
git clone https://github.com/Vaa3D/vaa3d_tools.git

Approach 2 – via GitHub Desktop GUI

Alternatively, you can clone both "v3d_external" and "vaa3d_tools" via GitHub Desktop, which can be obtained at: https://desktop.github.com/ .

Setup Symbolic Directory links for Building Plugins

The majority of the plug-ins are contained in the vaa3d_tools folder that you previously downloaded. They are separated from the rest of the Vaa3D code. Thus it is necessary to link QMake to these program. To do this, the following links need to be set up.

Note: these links are not necessary if you plan to use CMake. However, many of the plug-ins require QMake to build, hence using QMake is recommended.

Here we use 'PATH' to indicate the path to where the Vaa3D code is stored. Make sure you have this variable set up accordingly to your local machine. Then run the following lines of code in the command prompt window:

cd PATH\vaa3d_tools
mklink /j  v3d_main ..\v3d_external\v3d_main
mklink /j  bin ..\v3d_external\bin
cd ..\v3d_external
mklink /j  released_plugins_more  ..\vaa3d_tools\released_plugins

Prepare the pre-requisites

Microsoft Visual Studio 2010

Note: If there exists a newer version of Visual Studio in your system, you must have VS2010 SP1 installed in order to properly build Qt from VS2010 command prompt.

1. Qt

QTDIR=C:\Qt\4.7.2
QMAKESPEC=win32-msvc2010
  • Update PATH variable to include %QTDIR%\bin.
  • Download the latest version of jom at: http://download.qt.io/official_releases/jom/jom.zip.
  • Extract jom files to "C:\Qt\jom" folder
  • Run following commands in it (every line is a different command: type it then press Enter):
cd c:\Qt\4.7.2
configure -debug-and-release -opensource -platform win32-msvc2010
..\jom\jom.exe -j N

Where N is number of CPU cores you want to utilize for Qt compilation. Larger is better. (If not using jom, just input nmake to proceed.) For more information on building Qt, please refer to http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/.

2. Boost library

Download Boost C++ Libraries. After download, double click on the executable to install the libraries. By default, it will install boost libraries in the directory of C:\local\boost_1_61_0. Create another environment variable for your system:

BOOST_PATH=C:\local\boost_1_61_0

If you chose elsewhere when installing, BOOST_PATH would have to be specified accordingly.

3. TIFF library

A zipped version of the TIFF library should exist in the following place: PATH\vaa3d_tools\v3d_main\common_lib\src_packages\tiff-4.0.2.tar.gz. If the tiff library is not present, you can download it from http://download.osgeo.org/libtiff/ Note: You can choose newer version of TIFF library. Our test is up to 4.0.6 at the moment.

After decompressing the package to PATH\vaa3d_tools\v3d_main\common_lib\src_packages\ navigate to your tiff folder in VS command prompt, then execute the following lines to build the library:

nmake /f makefile.vc clean
nmake /f makefile.vc

Copy all the tiff header (.h) files from tiff-4.0.2\libtiff directly to v3d_main\common_lib\include.

4. Miscellaneous

  • Go to PATH\v3d_external\v3d_main\common_lib\include\hdf5, rename inttypes_VS.h to inttypes.h.

Build Vaa3D

  • Enter "PATH\v3d_external\v3d_main\v3d" folder.
  • Run qmake -tp vc vaa3d_msvc.pro. This command creates a MS Visual Studio 2010 project file " vaa3d_msvc.vcxproj" in "v3d_main\v3d" folder.
  • Use MS Visual Studio 2010 to open vaa3d_msvc.vcxproj.
  • Under Build -> Configuration Manager:
    • Choose building in "Release" mode in MS Visual Studio 2010.

    • Choose building in "x64" (for 64bit building) mode in vaa3d_msvc Property Pages, or just select from the building platform located in the toolbar. If “x64” mode does not exist, create one by choosing 'New' and then copying the previous configuration settings.

    • Now hit build button to start building process.

Build plugins

Execute the following commands in the Visual Studio Command Tool:
cd PATH\v3d_external\released_plugins_more
build_plugindemo_msvc.bat
cd PATH\vaa3d_tools\released_plugins
build_plugindemo_msvc.bat

Run Vaa3D

  • Now Vaa3D has been built. You can find the executable from the location v3d_main\v3d\release\vaa3d_msvc.exe. Copy it to \v3d_external\bin. You also need to copy three DLL files glew32.dll,openvr_api.dll,SDL2.dll from v3d_main\v3d\release to \v3d_external\bin.

  • To run the executable, you will have to make the dependency Qt library files etc available to it. Copy QtCore4.dll, QtGui4.dll, QtNetwork4.dll, QtOpenGL4.dll, QtXml4.dll from C:\Qt\4.7.2\bin to \v3d_external\bin.

  • Happy Vaa3Ding!

Clone this wiki locally