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 resides in its own subdirectory. 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 <SDKHOME> by directory name 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 | Compiler, Debugger and IDE Visit Download page |
CMake 2.6.4 (2009-05-05) | Generator of solution and project files for MSVC 2008 Visit Download page or download cmake-2.6.4-win32-x86.exe |
TortoiseSVN 1.6.1.16129 (2009-04-10) | Tool to handle source codes in Subversion repositories Visit Download page or download TortoiseSVN-1.6.1.16129-win32-svn-1.6.1.msi |
7-Zip 4.65 (2009-02-03) | Tool to decompress the source packages Visit Download page or download 7z465.exe |
Java SE Development Kit 6 Update 13 | Java Development Kit (JDK) Visit Download page |
Contents of the Hugin SDK
For those who want to avoid to build the whole SDK from scratch a precompiled SDK is available.
Precompiled Hugin SDK |
---|
Hugin-SDK-20090509-win32.exe (76 MiB, 2009-05-09) |
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_39_0 | Boost C++ libraries 1.39.0 (http://www.boost.org/) boost_1_39_0.7z (2009-05-02) 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.74 (http://www.sno.phy.queensu.ca/~phil/exiftool) exiftool-7.74.zip (2009-04-10) |
exiv2-0.18.1 | Exiv2 C++ library 0.18.1 (http://www.exiv2.org/) exiv2-0.18.1.tar.gz (2009-04-06) |
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-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 | Panorama Tools and pano13 library (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.10 | wxWidgets cross-platform GUI C++ framework 2.8.10 (http://www.wxwidgets.org/) wxMSW-2.8.10.zip (2009-03-17) |
In the following subsections each component is discussed in detail. The order of the subsections seems random, but I applied the approach 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 some 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 reside in <SDKHOME>\enblend-enfuse-3.2
ExifTool
- Create the directory <SDKHOME>\exiftool
- Decompress the file exiftool-7.74.zip to <SDKHOME>\exiftool
- Rename the file exiftool(-k).exe to exiftool.exe
Result
The application resides 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 reside in <SDKHOME>\gettext\bin
The include files reside in <SDKHOME>\gettext\include
The libraries reside in <SDKHOME>\gettext\lib
UnxUtils
- Create the directory <SDKHOME>\UnxUtils
- Decompress the file UnxUtils.zip to created directory <SDKHOME>\UnxUtils
Result
The applications reside in <SDKHOME>\UnxUtils\bin and <SDKHOME>\UnxUtils\usr\local\wbin
wxWidgets
- Decompress the file wxMSW-2.8.10.zip to directory <SDKHOME>
- Rename the directory <SDKHOME>\wxMSW-2.8.10 to <SDKHOME>\wxWidgets-2.8.10
- Open the file <SDKHOME>\wxWidgets-2.8.10\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.10\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.10\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.10\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.10\build\msw D:\usr\src\SDK\wxWidgets-2.8.10\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 reside in <SDKHOME>\wxWidgets-2.8.10\include and its subdirectories
Additional Hugin depends on following files
- <SDKHOME>\wxWidgets-2.8.10\src\jpg\*.h
- <SDKHOME>\wxWidgets-2.8.10\src\jpg\jconfig.vc
- <SDKHOME>\wxWidgets-2.8.10\src\png\*.h
- <SDKHOME>\wxWidgets-2.8.10\src\tiff\*.h
- <SDKHOME>\wxWidgets-2.8.10\src\zlib\*.h
The libraries reside in <SDKHOME>\wxWidgets-2.8.10\lib\vc_lib
Note |
---|
During build process temporary object files are stored in following directories
Both directories may be deleted to save disc space. |
Boost
- Decompress the file boost_1_39_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_39_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_39_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_39_0 D:\usr\src\SDK\boost_1_39_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_39_0>
- Close the Windows command prompt window
Result
The include files reside in <SDKHOME>\boost_1_39_0 and its subdirectory boost
The libraries reside in <SDKHOME>\boost_1_39_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.10\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 reside in <SDKHOME>\Deploy\include
The libraries reside 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 reside in <SDKHOME>\expat-2.0.1\lib
The libraries reside 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.1.tar.gz to directory <SDKHOME>
- Open solution file <SDKHOME>\exiv2-0.18.1\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.10/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.1\msvc\lib
- Copy the following files to this directory and rename them as specified in Destination column.
Source Destination <SDKHOME>\exiv2-0.18.1\msvc\bin\Debug\exiv2.lib <SDKHOME>\exiv2-0.18.1\msvc\lib\exiv2d.lib <SDKHOME>\exiv2-0.18.1\msvc\bin\Release\exiv2.lib <SDKHOME>\exiv2-0.18.1\msvc\lib\exiv2.lib <SDKHOME>\expat-2.0.1\win32\bin\Debug\libexpatMT.lib <SDKHOME>\exiv2-0.18.1\msvc\lib\libexpatd.lib <SDKHOME>\expat-2.0.1\win32\bin\Release\libexpatMT.lib <SDKHOME>\exiv2-0.18.1\msvc\lib\libexpat.lib
Result
The include files reside in <SDKHOME>\exiv2-0.18.1\msvc\include
The libraries reside in <SDKHOME>\exiv2-0.18.1\msvc\lib
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 reside in <SDKHOME>\glew\include
The libraries reside in <SDKHOME>\glew\lib
Note |
---|
The GLEW include files are typically included by a statement like #include "GL/glew.h" Therefore the base directory of the GLEW include files is <SDKHOME>\glew\include |
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.10
- 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_13
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 created directory <SDKHOME>\libpano\pano13 , and then choose SVN Checkout from the shortcut menu. The Checkout dialog appears.
- In "URL of repository" field 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 reside in <SDKHOME>\libpano\pano13\tools\Release
The include files reside in <SDKHOME>\libpano\pano13
The libraries reside in "<SDKHOME>\libpano\pano13\Debug LIB CMD" and "<SDKHOME>\libpano\pano13\Release LIB CMD"
Note |
---|
The applications have to be built in release version only. Therefore only pano13 library has to be built in Debug configuration. |
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 reside in <SDKHOME>\libxml2-2.7.3\include
The libraries reside in <SDKHOME>\libxml2-2.7.3\win32\bin.msvc
Notes |
---|
|
autopano-sift-C
Autopano-SIFT-C depends on following SDK components:
- libxml2
- Panorama Tool's pano13 library
- wxWidgets
Prepare these components before Autopano-SIFT-C.
- Create the directory <SDKHOME>\autopano-sift-C-trunk
- In explorer right-click on created directory <SDKHOME>\autopano-sift-C-trunk, and then choose SVN Checkout from the shortcut menu. The Checkout dialog appears.
- In "URL of repository" field 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 "Where is the source code" field enter
<SDKHOME>\autopano-sift-C-trunk
Alternatively click Browse Source to point to this directory - In "Where to build the binaries" field 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 reside in <SDKHOME>\autopano-sift-C\bin
The manual pages reside in <SDKHOME>\autopano-sift-C\shared
Note |
---|
To save disc space you may delete all files and directories in <SDKHOME>\autopano-sift-C, except the subdirectories bin and shared. |
Guido 23:27, 8 May 2009 (UTC)