Hugin SDK (MSVC 2008)
Hugin depends on different components like libraries and tools, which are not available on a common Windows system. All these components can be combined to a Hugin Software Developmant Kit (SDK). This article gives step-by-step instructions to build such SDK for Hugin using Microsoft Visual C++ 2008 (MSVC 2008) Express Edition and precompiled dependencies.
First of all an overview is given over the contents of the SDK and the tools that are necessary to build the SDK.
The build steps for each component are written like a walkthrough and annotated on the end of each section.
Maybe some of the described tools and packages, especially those fetched from Subversion (SVN) repository, will change over time and/or become obsolete. Hence it is likely that some steps will become invalid or won't work any more.
The SDK is structured, that each component is located in its own sub-directory. This approach is different to other platforms like Linux, where some common directories are available to store include files, libraries and applications. The files of a component are spread over all these directories. Both approaches to structure the files in a file system have its assets and drawbacks.
The base directory of the SDK is denoted as <SDKHOME> in this article. Replace this by the directory where you store the SDK on your system. In the examples <SDKHOME> is replaced by the directory name D:\usr\src\SDK.
Prerequisites
To build the SDK some tools are required that are listed in the table below. Download the tools and install them. The destination directory of each tool is arbitrary. If you are uncertain, choose the default given in the setup dialog of each tool.
Tool | Description |
---|---|
Microsoft Visual C++ 2008 Express Edition Visit Download page |
Compiler, Debugger and IDE |
CMake 2.6.3 (2009-02-23) Visit Download page or download cmake-2.6.3-win32-x86.exe |
Generator of solution and project files for MSVC 2008 |
TortoiseSVN 1.5.8.15348 (2009-02-13) Visit Download page or download TortoiseSVN-1.5.8.15348-win32-svn-1.5.5.msi |
Tool to handle source codes in Subversion repositories |
7-Zip 4.65 (2009-02-03) Visit Download page or download 7z465.exe |
Tool to decompress the source packages |
Java SE Development Kit 6 Update 12 Visit Download page |
Java Development Kit (JDK) |
Contents of the Hugin SDK
For those who want to avoid to build the whole SDK from scratch a precompiled SDK is available: Download Hugin SDK (75 MiB, 2009-02-26)
The contents of the Hugin SDK is shown in the following table. Download the packages, except the packages fetched from Subversion repository.
Directory | Description (Website) Download package (Date of the package) |
---|---|
autopano-sift-C | Autopano-SIFT-C (http://hugin.sourceforge.net/) Subversion repository https://hugin.svn.sourceforge.net/svnroot/hugin/autopano-sift-C/trunk |
boost_1_38_0 | Boost C++ libraries 1.38.0 (http://www.boost.org/) boost_1_38_0.7z (2009-02-09) boost-jam-3.1.17-1-ntx86.zip (2008-11-29) |
Deploy OpenEXR |
OpenEXR library 1.6.1 and IlmBase libraries 1.0.1 (http://www.openexr.com/) ilmbase-1.0.1.tar.gz (2007-10-22) openexr-1.6.1.tar.gz (2007-10-22) |
enblend-enfuse-3.2 | Enblend 3.2 and Enfuse 3.2 (http://enblend.sourceforge.net/) enblend-enfuse-3.2.zip (2008-09-09) |
exiftool | ExifTool 7.69 (http://www.sno.phy.queensu.ca/~phil/exiftool) exiftool-7.69.zip (2009-02-17) |
exiv2-0.18 | Exiv2 C++ library 0.18 (http://www.exiv2.org/) exiv2-0.18.tar.gz (2008-12-18) |
expat-2.0.1 | Expat XML Parser library 2.0.1 (http://sourceforge.net/projects/expat/) expat-2.0.1.tar.gz (2007-06-05) |
gettext | GNU gettext 0.13.1 and iconv library 1.9.1 (http://www.gnu.org/) gettext-runtime-0.13.1.bin.woe32.zip (2004-01-20) gettext-tools-0.13.1.bin.woe32.zip (2004-01-20) libiconv/libiconv-1.9.1.bin.woe32.zip (2004-01-20) |
glew | OpenGL Extension Wrangler Library (GLEW) 1.5.1 (http://glew.sourceforge.net/) glew-1.5.1-src.zip (2008-11-03) |
libpano\pano13 | pano13 library and applications of Panorama Tools (http://panotools.sourceforge.net/) Subversion repository https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano |
libxml2-2.7.3 | XML C parser and toolkit (http://www.xmlsoft.org/) libxml2-sources-2.7.3.tar.gz (2009-01-18) |
UnxUtils | GNU utilities ported to win32 platform (http://sourceforge.net/projects/unxutils/) UnxUtils.zip (2007-03-01) |
wxWidgets-2.8.9 | wxWidgets cross-platform GUI C++ framework 2.8.9 (http://www.wxwidgets.org/) wxMSW-2.8.9.zip (2008-09-22) |
In the following subsections each component is discussed in detail. The order of the subsections seems random, but I applied the appraoch to describe the precompiled packages first, followed by the big packages, where some of the small packages depend on.
The decompress step of each component contains seemingly inconsistent namings of destination directories, because in components a subdirectory is specified as destination directory and in some steps only the base directory. This is due to the fact that some package archives contain a base directory and some not. To check the right locations each result section of every component's description contains a summary of the expected files.
Enblend and Enfuse
- Decompress the file enblend-enfuse-3.2.zip to directory <SDKHOME>
Result
The applications are stored in <SDKHOME>\enblend-enfuse-3.2
ExifTool
- Create the directory <SDKHOME>\exiftool
- Decompress the file exiftool-7.69.zip to <SDKHOME>\exiftool
- Rename the file exiftool(-k).exe to exiftool.exe
Result
The application is stored in <SDKHOME>\exiftool
GetText
- Create the directory <SDKHOME>\gettext
- Decompress the following files to created directory <SDKHOME>\gettext
- gettext-runtime-0.13.1.bin.woe32.zip
- gettext-tools-0.13.1.bin.woe32.zip
- libiconv-1.9.1.bin.woe32.zip
Result
The applications are stored in <SDKHOME>\gettext\bin
The include files are stored in <SDKHOME>\gettext\include
The libraries are stored in <SDKHOME>\gettext\lib
UnxUtils
- Create the directory <SDKHOME>\UnxUtils
- Decompress the file UnxUtils.zip to created directory <SDKHOME>\UnxUtils
Result
The applications are stored in <SDKHOME>\UnxUtils\bin and <SDKHOME>\UnxUtils\usr\local\wbin
wxWidgets
- Decompress the file wxMSW-2.8.9.zip to directory <SDKHOME>
- Rename the directory <SDKHOME>\wxMSW-2.8.9 to <SDKHOME>\wxWidgets-2.8.9
- Open the file <SDKHOME>\wxWidgets-2.8.9\include\wx\msw\setup.h
- Search for following line
#define wxUSE_GLCANVAS 0
and replace it by
#define wxUSE_GLCANVAS 1
- Save the file
- Open the file <SDKHOME>\wxWidgets-2.8.9\src\jpeg\jpeglib.h
- Search for following line
#include "../src/jpeg/jconfig.h"
and replace it by
#include "jconfig.h"
- Save the file
- Open the file <SDKHOME>\wxWidgets-2.8.9\src\tiff\tiffconf.h
- Search for following line
#ifndef COMPRESSION_SUPPORT
and extend it to
#define TIF_PLATFORM_CONSOLE 1 #ifndef COMPRESSION_SUPPORT #define ZIP_SUPPORT
- Save the file
- To open a Visual Studio command prompt choose Start > Programs > Microsoft Visual C++ 2008 Express Edition > Visual Studio Tools > Visual Studio 2008 Command Prompt
- On command prompt change directory to <SDKHOME>\wxWidgets-2.8.9\build\msw
ExampleSetting environment for using Microsoft Visual Studio 2008 x86 tools. C:\Program Files\Microsoft Visual Studio 9.0\VC>d: D:\>cd \usr\src\SDK\wxWidgets-2.8.9\build\msw D:\usr\src\SDK\wxWidgets-2.8.9\build\msw>
- Enter each of the following two commands without any line break and press the Return key
nmake -f makefile.vc BUILD=debug UNICODE=1 SHARED=0 USE_OPENGL=1 RUNTIME_LIBS=static nmake -f makefile.vc BUILD=release UNICODE=1 SHARED=0 USE_OPENGL=1 RUNTIME_LIBS=static
- Close the Visual Studio command prompt window
Result
The include files are stored in <SDKHOME>\wxWidgets-2.8.9\include and its sub-directories
Additional Hugin depends on following files
- <SDKHOME>\wxWidgets-2.8.9\src\jpg\*.h
- <SDKHOME>\wxWidgets-2.8.9\src\jpg\jconfig.vc
- <SDKHOME>\wxWidgets-2.8.9\src\png\*.h
- <SDKHOME>\wxWidgets-2.8.9\src\tiff\*.h
- <SDKHOME>\wxWidgets-2.8.9\src\zlib\*.h
The libraries are stored in <SDKHOME>\wxWidgets-2.8.9\lib\vc_lib
Note |
---|
|
Boost
- Decompress the file boost_1_38_0.7z to directory <SDKHOME>
- Decompress the file boost-jam-3.1.17-1-ntx86.zip to an arbitrary directory and copy the application bjam.exe to <SDKHOME>\boost_1_38_0
- To open a Windows command prompt choose Start > Run, then enter cmd.exe and click OK.
- On command prompt change directory to <SDKHOME>\boost_1_38_0
ExampleMicrosoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Dokuments and Settings\Guido>d: D:\>cd \usr\src\SDK\boost_1_38_0 D:\usr\src\SDK\boost_1_38_0>
- Enter the following command without line breaks and press Return key
bjam --with-date_time --with-thread toolset=msvc variant=debug variant=release link=static threading=multi runtime-link=static stage
After bjam.exe finished a statement like the following should be printed in the command prompt window
...updated 56 targets... d:\usr\src\SDK\boost_1_38_0>
- Close the Windows command prompt window
Result
The include files are stored in <SDKHOME>\boost_1_38_0 and its sub-directory boost
The libraries are stored in <SDKHOME>\boost_1_38_0\stage\lib
Notes |
---|
|
OpenEXR
OpenEXR depends on following SDK component:
- wxWidgets
Prepare this component before OpenEXR.
- Create the directory <SDKHOME>\OpenEXR
- Decompress the file ilmbase-1.0.1.tar.gz to created directory <SDKHOME>\OpenEXR
- Decompress the file openexr-1.6.1.tar.gz to the same directory <SDKHOME>\OpenEXR
After decompress there should only exist the two directories ilmbase-1.0.1 and openexr-1.6.1 in <SDKHOME>\OpenEXR - Open solution file <SDKHOME>\OpenEXR\ilmbase-1.0.1\vc\vc8\IlmBase\IlmBase.sln
The Visual Studio Conversion Wizard dialog appears. Click Next, select option No, click Next and Finish. Unselect the option "Show the conversion log when the wizard is closed" and click Close - Due to the fact that the Visual Studio solutions of OpenEXR are configured to build dynamic libraries, some modifications are necessary to build the required static libraries:
For each project in Solution Explorer open the Property Pages dialog by choosing Project > Properties. Process the following steps for Debug and Release configuration. Some of the properties are not avaliable in every project, thus continue with next step.- Choose Configuration Properties > General. For Configuration Type property choose Static Library (.lib) if Dynamic Library (.dll) was selected.
- Choose Configuration Properties > C/C++ > Preprocessor. In the Preprocessor Definitions entry remove defines OPENEXR_DLL, _USRDLL and *_EXPORTS (all with suffix _EXPORTS).
- Choose Configuration Properties > C/C++ > Code Generation. For Runtime Library property choose Multithreaded-Debug (/MTd) in Debug configuration and Multithreaded (/MT) in Release configuration.
- Choose Configuration Properties > C/C++ > Code Generation. For Enable Enhanced Instruction Set property choose Not Set.
- Choose Configuration Properties > Build Events > Post-Build Event. In Command Line entry remove the createDLL command, but keep the install*.cmd command. For example in createDLL project only the statement "..\..\..\installCreateDLL.cmd $(IntDir)" should remain, in Half project only "..\..\..\installHalf.cmd $(IntDir)" etc.
- Close Property Pages dialog
- Select Debug in Solutions Configuration pull-down menu, and then choose Build > Build Solution
- Select Release in Solutions Configuration pull-down menu, and then choose Build > Build Solution
- Open solution file <SDKHOME>\OpenEXR\openexr-1.6.1\vc\vc8\OpenEXR\OpenEXR.sln
The Visual Studio Conversion Wizard dialog appears. Click Next, select option No, click Next and Finish. Unselect the option "Show the conversion log when the wizard is closed" and click Close - For project IlmImf do the same configuration property changes as in IlmBase solution described above
- Right-click IlmImf in Solution Explorer, and then choose Properties from shortcut menu
- In the Property Pages dialog do the following for Debug and Release configuration:
-
Choose Configuration Properties > C/C++ > General. In Additional Include Directory entry enter following additional include directory:
..\..\..\..\..\..\wxWidgets-2.8.9\src\zlib
-
Choose Configuration Properties > C/C++ > General. In Additional Include Directory entry enter following additional include directory:
- Choose Build > Batch Build
- Select Build for Project IlmImf with Solution Config "Debug|Win32" and "Release|Win32"
- Click Build
- Close Visual C++ 2008 Express Edition
Result
The include files are stored in <SDKHOME>\Deploy\include
The libraries are stored in <SDKHOME>\Deploy\lib\Debug and <SDKHOME>\Deploy\lib\Release
Expat
- Decompress the file expat-2.0.1.tar.gz to directory <SDKHOME>
- Open the file <SDKHOME>\expat-2.0.1\Source\expat.dsw
A Visual C++ Project conversion dialog appears. Click "Yes To All". - Choose Build > Batch Build
- Select Build for Project expat_static with Solution Config "Debug|Win32" and "Release|Win32"
- Click Build
- Close Visual C++ 2008 Express Edition
Result
The include files are stored in <SDKHOME>\expat-2.0.1\lib
The libraries are stored in <SDKHOME>\expat-2.0.1\win32\bin\Debug and <SDKHOME>\expat-2.0.1\win32\bin\Release
Exiv2
Exiv2 depends on following SDK components:
- wxWidgets
- GetText
- Expat
Prepare these components before Exiv2.
- Decompress the file exiv2-0.18.tar.gz to directory <SDKHOME>
- Open the file <SDKHOME>\exiv2-0.18\src\exv_msvc.h
- Delete the following lines
#if HAVE_LIBZ #define EXV_HAVE_LIBZ #if EXV_HAVE_DLL #ifdef _DEBUG #pragma comment(lib,"../../../zlib-1.2.3/projects/visualc6/Win32_DLL_Debug/zlib1d.lib") #else #pragma comment(lib,"../../../zlib-1.2.3/projects/visualc6/Win32_DLL_Release/zlib1.lib") #endif #else #ifdef _DEBUG #pragma comment(lib,"../../../zlib-1.2.3/projects/visualc6/Win32_LIB_Debug/zlibd.lib") #else #pragma comment(lib,"../../../zlib-1.2.3/projects/visualc6/Win32_LIB_Release/zlib.lib") #endif #endif #define EXV_HAVE_LIBZ // assist VC7.1 to compile vsnprintf #if (_MSC_VER < 1400) && !defined(vsnprintf) #define vsnprintf _vsnprintf #endif #endif
- Save the file
- Open solution file <SDKHOME>\exiv2-0.18\msvc\exiv2.sln
The Visual Studio Conversion Wizard dialog appears. Click Next, select option No, click Next and Finish. Unselect the option "Show the conversion log when the wizard is closed" and click Close - Right-click exiv2lib in Solution Explorer, and then choose Properties from the shortcut menu
- In the Property Pages dialog do the following for Debug and Release configuration:
- Choose Configuration Properties > C/C++ > General. In Additional Include Directories entry replace
../../../zlib-1.2.3
by
../../../wxWidgets-2.8.9/src/zlib
- Choose Configuration Properties > C/C++ > General. In Additional Include Directories entry replace
- Close Property Pages dialog
- Choose Build > Batch Build
- Select Build for Project exiv2lib with Solution Config "Debug|Win32" and "Release|Win32"
- Click Build
- Close Visual C++ 2008 Express Edition
- Create the directory <SDKHOME>\exiv2-0.18\msvc\lib
- Copy the following files to this directory and rename them as specified in Destination column.
Source Destination <SDKHOME>\exiv2-0.18\msvc\bin\Debug\exiv2.lib <SDKHOME>\exiv2-0.18\msvc\lib\exiv2d.lib <SDKHOME>\exiv2-0.18\msvc\bin\Release\exiv2.lib <SDKHOME>\exiv2-0.18\msvc\lib\exiv2.lib <SDKHOME>\expat-2.0.1\win32\bin\Debug\libexpatMT.lib <SDKHOME>\exiv2-0.18\msvc\lib\libexpatd.lib <SDKHOME>\expat-2.0.1\win32\bin\Release\libexpatMT.lib <SDKHOME>\exiv2-0.18\msvc\lib\libexpat.lib
Result
The include files are stored in <SDKHOME>\exiv2-0.18\msvc\include
The libraries are stored in <SDKHOME>\exiv2-0.18\msvc\lib
Note |
---|
|
GLEW
- Decompress the file glew-1.5.1-src.zip to directory <SDKHOME>
- Open the file <SDKHOME>\glew\build\vc6\glew.dsw
A Visual C++ Project conversion dialog appears. Click "Yes To All". - Choose Build > Batch Build
- Select Build for Project glew_static with Solution Config "Debug|Win32" and "Release|Win32"
- Click Build
- Close Visual C++ 2008 Express Edition
Result
The include files are stored in <SDKHOME>\glew\include
The libraries are stored in <SDKHOME>\glew\lib
Note |
---|
|
Panorama Tools
Panorama Tools depends on following SDK component:
- wxWidgets
Prepare this component before Panoroma Tools.
- Set two windows environment variables:
- Set variable WXWIDGETS_HOME to wxWidgets base folder <SDKHOME>\wxWindgets-2.8.9
- Set variable JDK_HOME to Java SE Development Kit's destination directory name. This directory name was shown during the setup, e.g. C:\Program Files\Java\jdk1.6.0_12
To take effect on changes of environment variables you may have to logout and login.
- Create the directory <SDKHOME>\libpano\pano13
- In explorer right-click on the created directory, and then choose SVN Checkout from the shortcut menu. The Checkout dialog appears.
- In text feld "URL of repository" enter following address:
https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano
- Click OK
- After checkout has finished click OK
- Open solution file <SDKHOME>\libpano\pano13\libpano.sln
The Visual Studio Conversion Wizard dialog appears. Click Next, select option No, click Next and Finish. Unselect the option "Show the conversion log when the wizard is closed." and click Close - Select "Debug LIB CMD" in Solution Configuration pull-down menu
- Select project pano13 in Solution Explorer, and then choose Build > Project Only > Build Only pano13
- Select "Release LIB CMD" in Solution Configuration pull-down menu, and then choose Build > Build Solution
- Close Visual C++ 2008 Express Edition
Result
The applications are stored in <SDKHOME>\libpano\pano13\tools\Release
The include files are stored in <SDKHOME>\libpano\pano13
The libraries are stored in "<SDKHOME>\libpano\pano13\Debug LIB CMD" and "<SDKHOME>\libpano\pano13\Release LIB CMD"
Note |
---|
|
libxml2
- Decompress the file libxml2-sources-2.7.3.tar.gz to directory <SDKHOME>
- To open a Visual Studio command prompt choose Start > Programs > Microsoft Visual C++ 2008 Express Edition > Visual Studio Tools > Visual Studio 2008 Command Prompt
- On command prompt change directory to <SDKHOME>\libxml2-2.7.3\win32
ExampleSetting environment for using Microsoft Visual Studio 2008 x86 tools. C:\Program Files\Microsoft Visual Studio 9.0\VC>d: D:\>cd \usr\src\SDK\libxml2-2.7.3\win32 D:\usr\src\SDK\libxml2-2.7.3\win32>
Enter each of the following two commands without any line break and press the Return key.
cscript configure.js ftp=no http=no iconv=no cruntime=/MT nmake -f makefile.msvc libxmla
Result
The include files are stored in <SDKHOME>\SDK\libxml2-2.7.3\include
The libraries are stored in <SDKHOME>\libxml2-2.7.3\win32\bin.msvc
Note |
---|
|
autopano-sift-C
Autopano-SIFT-C depends on following SDK components:
- libxml2
- Panoramo Tools pano13 library
- wxWidgets
Prepare these components before Autopano-SIFT-C.
- Create the directory <SDKHOME>\autopano-sift-C-trunk
- In explorer right-click on the created directory, and then choose SVN Checkout from the shortcut menu. The Checkout dialog appears.
- In text field "URL of repository" enter following address:
https://hugin.svn.sourceforge.net/svnroot/hugin/autopano-sift-C/trunk
- Click OK
- After checkout has finished click OK
- Start CMake (cmake-gui). The CMake dialog appears.
- In text field "Where is the source code" enter
<SDKHOME>\autopano-sift-C-trunk
Alternatively click Browse Source to point to this directory - In text field "Where to build the binaries" enter
<SDKHOME>\autopano-sift-C
- Click Configure
If a dialog appears, which asks to create the build directoy, click Yes.
A dialog appears, where you can specify the generator for the project. - Select "Visual Studio 9 2008" and select option "Use default native compilers"
- Click Finish
In the Name and Value list the entries are shown with red background. - Click Configure
- Click Generate
- Close CMake
- Open solution file <SDKHOME>\autopano-sift-C\autopano-sift-C.sln
- Select Release in Solution Configuration pull-down menu, and then choose Build > Build Solution
- Select project INSTALL in Solution Explorer, and then choose Build > Project Only > Build Only INSTALL
- Close Visual C++ 2008 Express Edition
- Copy the directories bin and shared from <SDKHOME>\autopano-sift-C\INSTALL\FILES to <SDKHOME>\autopano-sift-C
Result
The applications are stored in <SDKHOME>\autopano-sift-C\bin
The manual pages are stored in <SDKHOME>\autopano-sift-C\shared
Note |
---|
|
Guido 01:31, 28 February 2009 (CET)