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.

+

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 Development 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.

+

+

While this article is designed for developing a native 32-bit version, additional instructions are provided so that a 64-bit version of the Hugin SDK can be compiled. When appropriate, steps that only apply to the 32-bit or 64-bit versions will be noted as (32-bit) or (64-bit), and you can safely ignore them if you are not targeting that particular version. In order to compile a 64-bit version of the Hugin SDK, one does not need a 64-bit computer. However, if they wish to test or debug the binaries, or for some projects (such as OpenEXR) which execute compiled binaries as part of their build step, this will not necessarily be possible on Win32.

First of all an overview is given over the contents of the SDK and the tools that are necessary to build the SDK.

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.

+

The build steps for each component are written like a walk-through 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.

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.

| style="padding:5px; text-align:left" | x64 Compiler, Libraries, and Headers<br/>Visit [http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF]<br> When installing, make sure to include the Visual C++ compilers for x64 (under Developer Tools) and the Header Files and x64 libraries (under Windows Headers and Libraries). Optionally consider installing all of the SDK, as it makes compiling generally easier.

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.

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 ===

+

The SDK is currently outdated. The following changes are necessary to build Hugin:

In order to make compilation simple, a series of patch files are included below that contain all the necessary changes, not only to compile the SDK, but to optionally compile an x64 version of the SDK. When directed, you will need to apply the patch file specified. If you are compiling for x64, there may be additional patches you need to apply.

+

+

The download link for the patches is [https://bugs.launchpad.net/hugin/+bug/679695/+attachment/1741338/+files/hugin_patches.zip https://bugs.launchpad.net/hugin/+bug/679695/+attachment/1741338/+files/hugin_patches.zip]

+

In order to apply a patch, you will first have needed to follow directions for the [[#UnxUtils|UnxUtils]] step. You cannot apply any patches before that step. To apply a patch, follow these directions:

<li>On the command prompt, enter the following commands without any line breaks and press the Return/Enter key, substituting <SDKHOME> where appropriate:<br/>

+

<pre>

+

set PATH=%PATH%;<SDKHOME>\UnxUtils\usr\local\wbin

+

</pre>

+

</li>

+

<li>On the command prompt, enter the following commands without any line breaks and press the Return/Enter key, substituting <PATCHFILE> with the name of the patch file to apply:<br/>

+

<pre>

+

patch -p 0 -i <PATCHFILE>

+

</pre>

+

'''NOTE:''' On Vista and later systems, the filename "patch.exe" is a protected file name which will always result in a UAC prompt if the file does not include a manifest (which UnxUtils version does not). This can be worked around by copying the file <tt><SDKHOME>\UnxUtils\usr\local\wbin\patch.exe</tt> to another file not containing the name, such as <tt><SDKHOME>\UnxUtils\usr\local\wbin\apply_diff.exe</tt>. Then substitute the command <tt>'patch'</tt> in the above command with <tt>'apply_diff'</tt>

+

</li>

+

</ol>

+

+

'''Result'''

+

+

If everything worked, you should see a list of filenames that were patched.

+

'''Example'''

+

<pre>

+

D:\usr\src\SDK>patch -p 0 -i libiconv-1.9.1.diff

+

patching file 'libiconv-1.9.1/srclib/error.c'

+

+

D:\usr\src\SDK>

+

</pre>

+

+

If there was an error, you may wish to consult the [[Hugin SDK (MSVC 2008) Patches]] page for instructions on what changes were contained in the patch.

+

+

=== UnxUtils ===

+

+

<ol>

+

<li>Create the directory <tt><SDKHOME>\UnxUtils</tt></li>

+

<li>Decompress the file <tt>UnxUtils.zip</tt> to created directory <tt><SDKHOME>\UnxUtils</tt></li>

</ol>

</ol>

Line 107:

Line 213:

The applications reside in

The applications reside in

−

<tt><SDKHOME>\enblend-enfuse-3.2</tt>

+

<tt><SDKHOME>\UnxUtils\bin</tt> and

+

<tt><SDKHOME>\UnxUtils\usr\local\wbin</tt>

=== ExifTool ===

=== ExifTool ===

Line 123:

Line 230:

=== GetText ===

=== GetText ===

−

+

{| class="wikitable"

−

<ol>

+

|- valign="top"

+

! style="padding:5px; text-align:left" | 32-Bit Directions

+

! style="padding:5px; text-align:left" | 64-Bit Directions

+

|- valign="top"

+

| style="padding:5px; text-align:left" | <ol>

<li>Create the directory <tt><SDKHOME>\gettext</tt></li>

<li>Create the directory <tt><SDKHOME>\gettext</tt></li>

<li>Decompress the following files to created directory <tt><SDKHOME>\gettext</tt>

<li>Decompress the following files to created directory <tt><SDKHOME>\gettext</tt>

Line 134:

Line 245:

</li>

</li>

</ol>

</ol>

+

| style="padding:5px; text-align:left" | <ol>

+

<li>Create the directory <tt><SDKHOME>\gettext</tt></li>

+

<li>Decompress the following files into the directory <tt><SDKHOME></tt>

+

<ul>

+

<li><tt>gettext-0.13.1.tar.gz</tt></li>

+

<li><tt>libiconv-1.9.1.tar.gz</tt></li>

+

</ul>

+

After decompress, there should be two new folders in <tt><SDKHOME></tt>: <tt><SDKHOME>\gettext-0.13.1</tt> and <tt><SDKHOME>\libiconv-1.9.1</tt>

Since September 2010 Hugin requieres also the boost libraries regex, filesystem, iostream and system, since November 2010 also the boost library signals. If you want to compile this version you need to compile Boost lib with

<li>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:<br/>

+

−

+

−

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.

Latest revision as of 23:30, 16 July 2011

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 Development 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.

While this article is designed for developing a native 32-bit version, additional instructions are provided so that a 64-bit version of the Hugin SDK can be compiled. When appropriate, steps that only apply to the 32-bit or 64-bit versions will be noted as (32-bit) or (64-bit), and you can safely ignore them if you are not targeting that particular version. In order to compile a 64-bit version of the Hugin SDK, one does not need a 64-bit computer. However, if they wish to test or debug the binaries, or for some projects (such as OpenEXR) which execute compiled binaries as part of their build step, this will not necessarily be possible on Win32.

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 walk-through 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.

x64 Compiler, Libraries, and HeadersVisit [1] When installing, make sure to include the Visual C++ compilers for x64 (under Developer Tools) and the Header Files and x64 libraries (under Windows Headers and Libraries). Optionally consider installing all of the SDK, as it makes compiling generally easier.

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.

The SDK is currently outdated. The following changes are necessary to build Hugin:

Diff Files

In order to make compilation simple, a series of patch files are included below that contain all the necessary changes, not only to compile the SDK, but to optionally compile an x64 version of the SDK. When directed, you will need to apply the patch file specified. If you are compiling for x64, there may be additional patches you need to apply.

On the command prompt, enter the following commands without any line breaks and press the Return/Enter key, substituting <SDKHOME> where appropriate:

set PATH=%PATH%;<SDKHOME>\UnxUtils\usr\local\wbin

On the command prompt, enter the following commands without any line breaks and press the Return/Enter key, substituting <PATCHFILE> with the name of the patch file to apply:

patch -p 0 -i <PATCHFILE>

NOTE: On Vista and later systems, the filename "patch.exe" is a protected file name which will always result in a UAC prompt if the file does not include a manifest (which UnxUtils version does not). This can be worked around by copying the file <SDKHOME>\UnxUtils\usr\local\wbin\patch.exe to another file not containing the name, such as <SDKHOME>\UnxUtils\usr\local\wbin\apply_diff.exe. Then substitute the command 'patch' in the above command with 'apply_diff'

Result

If everything worked, you should see a list of filenames that were patched.
Example

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>

Since September 2010 Hugin requieres also the boost libraries regex, filesystem, iostream and system, since November 2010 also the boost library signals. If you want to compile this version you need to compile Boost lib with

After bjam.exe finished a statement like the following should be printed in the command prompt window

...updated 26 targets...

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

During build process temporary files are generated in <SDKHOME>\boost_1_39_0\bin.v2. This directory may be deleted to save disk space.

Hugin needs only the two Boost libraries date_time and thread, thus only these two libraries have to be built.
If you want to build all Boost libraries enter following command on the Windows command prompt instead of the command described above and press Return key.

bjam -–build-type=complete toolset=msvc stage

There are about 7GB disc space needed during build of all libraries (3.5GB for libraries and the same amount for the temporary files).

The Boost include files are typically included by a statement like#include "boost/whatever.hpp"
Therefore the base directory of the Boost include files is <SDKHOME>\boost_1_39_0

Only the following libraries are needed to build a release version of Hugin:

libboost_date_time-vc90-mt-s-1_39.lib

libboost_thread-vc90-mt-s-1_39.lib

The files with "gd" in the filename, e.g. libboost_thread-vc90-mt-sgd-1_39.lib, are the debug libraries.
The library files without "-1_39" suffix are automatically generated copies of the libraries with version suffix. They are used by CMake to detect the library directory.

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