XuvTools is developed in a cooperative effort from:
  • Chair of Pattern Recognition and Image Processing [www]
  • Friedrich Miescher Institute for Biomedical Research [www]
  • Center for Biological Systems Analysis [www]
 

Compiling on Windows

The instructions given on this page are outdated, and remain here merely for documentation. Please use the up-to-date version that is linked from the navigation menu!

Prerequisites: currently this is Visual Studio 2008 and Qt (see below for Qt build-instructions). In addition, it is heavily recommended to use Intel's C++ Compiler for Windows to build XuvTools, and for a more comfortable way a cygwin-installation is heavily recommended.

Building XuvTools

set environment variables

Open a Visual Studio command prompt, and set up the environment for your windows compilation:

set LMBSOFTSRC=C:\Data\emmenlau\src\XuvTools
set LMBSOFTDEST=C:\Data\emmenlau\lmbsoft-win32
set LMBSOFTTEMP=%LMBSOFTDEST%
set QTDIR=%LMBSOFTDEST%\Qt-<VERSION>
set PATH=%QTDIR%\bin;%PATH%

These variables should not contain spaces, or qmake will fail. Instead of setting the environment variables every time you qmake XuvTools, you can set them static for your Windows environment like described here by Microsoft.

qmake project

After you have set the environment, call qmake to generate Visual Studio project files:

cd %LMBSOFTSRC%\project\qt
qmake -r -tp vc -spec win32-msvc2008 XuvTools.pro
additional configuration flags

If you want to build the command line tools as well, you can add “tools” to the qmake CONFIG variable. To build and execute the tests, you can add “test” to the qmake CONFIG variable.

qmake CONFIG+="tools" -r -tp vc -spec win32-msvc2008 XuvTools.pro
qmake CONFIG+="test"  -r -tp vc -spec win32-msvc2008 XuvTools.pro
qmake CONFIG+="tools test" -r -tp vc -spec win32-msvc2008 XuvTools.pro
Windows x64 adjustments

If you want to compile for Win64, you need to add the “x64” target to the solution. This can be done in Visual Studio, or manually by search-and-replace. When using Visual Studio, note that Visual Studio will set back the values of some settings to their default (mainly the IntDir variable) when converting projects, so double-check your settings! The preferred way is therefore to use a text editor, or Cygwin with perl:

cd $LMBSOFTSRC
PROJECTFILES=$(find . -name \*cproj -o -name \*sln)
perl -pi -e 's/Name="Win32"/Name="x64"/g;s/\|Win32/\|x64/g' ${PROJECTFILES}
build

Open the Visual Studio solution file “XuvTools.sln”. If you want to build for x64, make sure the Target is set to “x64” (see previous section). Select your target platform and configuration, and start the compilation. It is recommended to check the optimization settings beforehand, and/or use the Intel compiler. It is also recommended to build all projects whose name starts with “gen…” (Note: lowercase) before all other projects. This is because these are generators for header files. Building these projects first can reduce the overall building time.

Problems and Fixes

For Windows (32 /and/ 64 bit), Intel C++ Compiler (11.0.072 up to at least 11.1.038), Qt-4.5.2, xuvtools_gui has to be qmaked separately. This is due to a bug in all recent qmake-versions (currently 4.5.2), see the corresponding Qt task-tracker entry QTBUG-2839 (formerly this was 228286) and discussion 55670 in the Intel Developers Forum. The following workarounds have been reported to succeed most of the time:

  • Workaround (A):
    • qmake XuvTools.pro as described above in the qmake section
    • start the Intel 64 console, change to %LMBSOFTSRC%/xuvtools_gui/project/qt and qmake -tp vc -r -platform win32-icc qt.pro
    • open the generated workspace in Visual Studio, create the x64 platform, choose “Use Intel C++”, save the solution and close it
    • open %LMBSOFTSRC%/project/qt/XuvTools.sln in Visual Studio, remove the existing xuvtools_guid and import the newly created one.
    • check that in the properties of all projects for the release configuration the C/C++ > Optimization > (Intel specific) Interprocedural optimization entry is set to Multi-file (/Qipo)
    • build as described in the build section
  • Workaround (B):
    • qmake XuvTools.pro as described above in the qmake section
    • change to %LMBSOFTSRC%/xuvtools_gui/project/qt/
    • qmake -r -tp vc -spec win32-msvc2008 qt.pro
    • open XuvTools.sln in Visual Studio, convert to Intel compiler project.
    • check that in the properties of the xuvtools_guid project the C/C++ > Optimization > (Intel specific) Interprocedural optimization entry is set to Multi-file (/Qipo)
    • continue as described above.
  • Workaround (C), tested with XP x64 and x86, ICC 11.1.038 and VS2008:
    • start the appropriate (64 or 32 bit) Intel C++ console
    • qmake XuvTools.pro as described above in the qmake section
    • change to %LMBSOFTSRC%/xuvtools_gui/project/qt
    • qmake -r -tp vc -spec win32-msvc2008 qt.pro
    • change to %LMBSOFTSRC%/project/qt
    • switch to the Intel compiler by running the appropriate Intel Project Converter:
      • 64 bit XP (en): “C:\Program Files (x86)\Common Files\Intel\shared files\ia32\Bin\ICProjConvert110.exe” /IC /nologo XuvTools.sln
      • 32 bit XP (de): “C:\Programme\Gemeinsame Dateien\Intel\shared files\ia32\Bin\ICProjConvert110.exe” /IC /nologo XuvTools.sln
    • if 64 bit: switch to x64 target (see win x64 adjustments above)
    • open XuvTools.sln in Visual Studio
    • check that in the properties of all projects for the release configuration the C/C++ > Optimization > (Intel specific) Interprocedural optimization entry is set to Multi-file (/Qipo)
    • IMPORTANT: do not enable this optimization if you're trying to compile on a system with only 4GB RAM since this currently breaks the compilation in the linker-step (xilink eats up the available memory and then quits with “error #10014”, if we decide to investigate this problem any further have a look at posting 63600 in Intel's developer forum).
    • build gen*, then build the whole solution

For Windows x64, Intel 11.0.072, Visual Studio 2008, compilation of XuvImgProcd requires that the macro __INTEL_COMPILER be defined. This should be automatically the case when compiling with the Intel Compiler.

Qt Build Instructions

If you do not have Qt Software's Qt framework already installed, it is recommended to compile Qt from source using Visual Studio. If you want to use the Intel Compiler for compiling XuvTools, you don't have to use it for Qt as well (this was supposed to cause problems on earlier versions, but http://doc.trolltech.com/4.5/known-issues.html doesn't list anything about this any more so this should be fine). Now here is how to build Qt:

To use Microsofts Compiler, open the Visual Studio command prompt for your target architecture, i.e.: Start → Programs → Microsoft Visual Studio 2008 → Visual Studio Tools → Command Prompt. To use the Intel Compiler, open the Intel Compiler command prompt for your target architecture, i.e.: Start → Programs → Intel Software Development Tools → Intel C++ Compiler → C++ Build Environment for Applications running on IA-32 (or Intel 64).

set QTDIR=%LMBSOFTDEST%\Qt-<VERSION>
set PATH=%QTDIR%\bin;%PATH%

Set the QTDIR environment variable to point to a directory where Qt should be installed on Windows. Recommended is %LMBSOFTDEST%\Qt-<VERSION>. Instead of setting the environment variables every time you qmake XuvTools, you can set them static for your Windows environment like described here by Microsoft.

Go to http://get.qt.nokia.com/qt/source/ and download Qt for Windows (qt-win-opensource-src-<VERSION>.zip). Extract Qt, and move the folder contents to QTDIR (so that configure.exe is at %QTDIR%\configure.exe)

Now change the current directory to QTDIR, and configure Qt. The options are the same for win32 and x64. If you want to use the intel compiler, you should in the future be able to select “-platform win32-icc”, but this has to be tested more. Currently it is recommended to convert the project in Visual Studio to Intel Compiler. Among the useful but not required flags are “-static” to build a static Qt library and “-no-phonon” to leave out the fancy phonon style support:

cd /D %QTDIR%
# To use Microsofts compiler, set the "win32-msvc2008" platform:
configure -platform win32-msvc2008 -no-incredibuild-xge \
          -no-phonon -no-phonon-backend -no-webkit \
          -debug-and-release -static
# To use the Intel compiler, set the "win32-icc" platform:
configure -platform win32-icc -no-incredibuild-xge \
          -no-phonon -no-phonon-backend -no-webkit \
          -debug-and-release -static

Next step is to build Qt, so call nmake:

nmake sub-src

If you specify the sub-src target, nmake will build no demos and examples. This is required when building static. Its always recommended, because building examples and demos takes very long. If you are not building static and want the demos and examples, just call “nmake” without “sub-src”.

Get four to six cups of coffee, come back half a day later, finished. You should have Qt libs in %QTDIR%\lib and includes in %QTDIR%\include. To save space, you can (but don't have to) remove all folders except bin\, include\, lib\, and mkspecs\.

devel/compile-win.txt · Last modified: 2010/03/12 11:35 by mario
Contact: admin(a)xuvtools.org