Difference between revisions of "Hugin Compiling Windows"

From PanoTools.org Wiki
Jump to navigation Jump to search
(Change compiling category)
 
(22 intermediate revisions by 5 users not shown)
Line 1: Line 1:
NOTE: this is work in progress and not finished yet. Please add clarifications or comments for the individual steps.
+
{| style="margin: 1em auto 1em 1em;background:#FFFF99;color:#FF0000;text-align:left;border: solid #FF3300;"
 +
|-valign="top"
 +
! '''NOTE:'''
 +
! This is work in progress and not finished yet. And as hugin progresses with the introduction of new dependencies this page becomes more outdated than ever. If you are new to building hugin, try first with [[Build_Hugin_for_Windows_with_SDK|this]] method. If you know what you are doing, keep reading / following this instructions and feel free to update them.
 +
|}
 +
 
 +
Since mid January 2008, building hugin for Windows has been easier than this page might lead you to expect.  The cmake build configuration and control system has become fully functional, and a complete set of precompiled dependencies (the ''Hugin SDK'') is available.  There are step-by-step instructions here: [[Build Hugin for Windows with SDK]].
  
 
= Why do I want to compile hugin? =
 
= Why do I want to compile hugin? =
  
If you want to fiddle with the hugin code, test new features or help squashing bugs, and do all that on Windows, this is the guide for you. Be warned that building hugin on Windows is not a piece of cake, so only try if you know the dark sides with all the development tools involved.
+
If you want to fiddle with the hugin code, add new features or help squashing bugs, and do all that on Windows, this is the guide for you. Be warned that building hugin on Windows is not a piece of cake, so only try if you know the dark sides with all the development tools involved.
  
For normal testers it is better to use the binary snapshots we will offer during the preparation period for hugin 0.7. This guide is designed to be a help for people who have expressed interest in build Windows version of the current hugin code on a regular basis.
+
For normal testing purpose it is better to use the occasional binary snapshot. For first-time builders it is better to use the SDK-based [[Build Hugin for Windows with SDK|instructions]].
 +
 
 +
This guide is designed to be a help for people who have expressed interest in understanding the depth of building Windows version of the current hugin code on a regular basis.
  
 
This guide will describe two ways of building the latest trunk. It does not apply to the hugin code prior to 2007/10/27.
 
This guide will describe two ways of building the latest trunk. It does not apply to the hugin code prior to 2007/10/27.
Line 13: Line 21:
 
Currently, there are two methods for building hugin. Both are based on the CMake build system.
 
Currently, there are two methods for building hugin. Both are based on the CMake build system.
  
1. Compilation with Microsoft Visual Studio .NET. MSVC 2003 or later is required. The free express edition will probably also work, but is probably even harder to setup.
+
# Compilation with Microsoft Visual Studio .NET. MSVC 2003 or 2008 is required. The recommended method is to download [http://www.microsoft.com/express/vc/ Microsoft Visual C++ 2008 Express Edition], and install it. For convenience a ''Hugin SDK'' with precompiled libraries for MSVC 2008 is provided. It is recommended to use these initially, rather than to compile your own libraries.  There are detailed instructions at [[Build Hugin for Windows with SDK]].  Once you are familiar and comfortable with the process described there, you can move in to replace the precompiled libraries with your own self-built ones, step by step.
 +
# Compilation with MinGW32. This does not require the Microsoft compiler and even allows cross compilation of binaries for windows on a linux machine. Until now, only the cross compilation approach has been tried, but a building on a native system should also be possible.
  
2. Compilation with MinGW32. This does not require the Microsoft compiler and even allows cross compilation of binaries for windows on a linux machine. Until now, only the cross compilation approach has been tried, but a building on a native system should also be possible.
+
The following additional programs are also required for building a hugin installer package:
  
For both approaches, the hardest task is the compilation of the libraries required by hugin. This mainly includes wxWidgets, boost, libpano13 and OpenEXR.
+
# [http://www.cmake.org CMake] Note that Microsoft Visual C++ 2008 Express Edition is not supported by CMake 2.4. [http://www.cmake.org/HTML/Download.html Download] a recent Windows binary of CMake. These instructions were written at a time that only a recent CVS snapshot of CMake worked with this method. It is likely that CMake 2.6.x works as well, but it has not been tested.
 +
# [http://enblend.sf.net enblend 3.2]
 +
# [http://sf.net/projects/unxutils GNU make], required by hugin, not for building hugin. (included in ''Hugin SDK'')
 +
# GNU gettext. (included in ''Hugin SDK'')
 +
# Moreover, for packgaging the installer you will need [http://www.jrsoftware.org/isinfo.php Innosetup]. Instructions for this are in the Hugin repository.
  
= Building with Microsoft Visual Studio .Net 2003 (or later) =
 
  
For simpler installation I have build everything against the older, multithreaded runtime libraries (\MT option).
+
For both MSVC and MinGW32 approaches, the hardest task is the compilation of the libraries required by hugin. This mainly includes wxWidgets, boost, libpano13 and OpenEXR.
 +
 
 +
= Building with Microsoft Visual C++ 2008 Express Edition =
 +
 
 +
This also works with earlier version from 2003 onwards. However, you will need to compile the dependencies from scratch. For simpler installation (and less headaches during building) everything is built against the older, multithreaded runtime libraries (\MT option), and linked all executables statically.
  
 
== Getting the dependencies ==
 
== Getting the dependencies ==
  
It is tempting to download precompiled libraries from the different projects, and use those. Be prepared that they might have been created with different compiler setting (Especially with a different runtime libraries). This can lead to hard to find and nasty problems and amount to days of depressing work (I speak from experience).
+
It is tempting to download precompiled libraries from the different projects, and use those. Be prepared that they might have been created with different compiler setting (Especially with a different runtime libraries). This can lead to hard to find and nasty problems and amount to days of depressing work.
  
 
=== Downloading precompiled dependencies ===
 
=== Downloading precompiled dependencies ===
  
Easy way, download the libraries I (Pablo d'Angelo) have used. They have been used for the creation of most hugin releases and should work reliably, even if they are not the latest versions. They can soon be downloaded from  hugin.panotools.org/sdk/msvc I'm currently cleaning up the packages, please be patient. I have uses MSVC 2003 to create these, the might not work on other compilers. I'm sure at least boost will only work with the compiler it has been build with.
+
This is the recommended approach.
 +
 
 +
Download the [http://hugin.panotools.org/sdk/MSVC/hugin_enblend_sdk_msvc2008_v2.7z ''Hugin SDK'']. and unzip it into a directory of your choice. '''src''' is used in this document. Continue with [[#Building Hugin]].
  
 
=== Build all required dependencies from scratch ===
 
=== Build all required dependencies from scratch ===
Line 35: Line 53:
 
Download the source packages. Newer versions might work, too.
 
Download the source packages. Newer versions might work, too.
  
1. Download wxWidgets from http://www.wxwidgets.org, I used 2.6.1, but later version should work, too
+
# Download wxWidgets from http://www.wxwidgets.org, 2.8.4 were used to write this guide and it has been last tested to work with 2.8.9, but later version should work, too
 
+
# Download boost from http://www.boost.org, I used 1.34_1
2. Download boost from http://www.boost.org, I used 1.33
+
# Download OpenEXR source (IlmBase and OpenEXR) from http://www.openexr.com/
 
+
# Download panorama tools source (pano13), from http://panotools.sf.net. Use version 2.9.12 or later. Latest SVN is even better.
3. Download OpenEXR source (IlmBase and OpenEXR) from http://www.openexr.com/
+
# Download and install gettext installer package from http://gnuwin32.sf.net
 
 
4. Download panorama tools source (pano13), from http://panotools.sf.net. Use version 2.9.12 or later. Latest SVN is even better.
 
 
 
5. Download and install gettext installer package from http://gnuwin32.sf.net
 
  
 
Unpack the source packages.
 
Unpack the source packages.
  
 
==== Building wxWidgets ====
 
==== Building wxWidgets ====
 +
 +
NOTE: this will only work for hugin SVN revisions prior to 8-Oct-2008. TODO: describe how to activate the OpenGL canvas.
  
 
1. Open libs/wxWidgets/src/tiff/tiffconf.h in your favorite editor, and add
 
1. Open libs/wxWidgets/src/tiff/tiffconf.h in your favorite editor, and add
Line 53: Line 69:
 
   #define ZIP_SUPPORT
 
   #define ZIP_SUPPORT
  
near line 90 to support ZIP compressed tiff files. This might not be needed in
+
near line 90 to support ZIP compressed tiff files (update: wxWidgets ships with an ancient version of libtiff, so LZW will still be disabled. The ''Hugin SDK'' additionally contains libtiff 3.8.2). To avoid nasty popup messages with the
newer version of wxWidgets.
+
command line tools we are going to build, additionally add:
 +
 
 +
  #define TIF_PLATFORM_CONSOLE
  
 
2. build wxWidgets: start the MSVC command line shell (from the startmenu) and cd to the wxWidgets/build/msw. To build Unicode debug release libraries, execute the following commands:
 
2. build wxWidgets: start the MSVC command line shell (from the startmenu) and cd to the wxWidgets/build/msw. To build Unicode debug release libraries, execute the following commands:
Line 61: Line 79:
 
   nmake -f makefile.vc BUILD=debug UNICODE=1 SHARED=0 RUNTIME_LIBS=static
 
   nmake -f makefile.vc BUILD=debug UNICODE=1 SHARED=0 RUNTIME_LIBS=static
 
   nmake -f makefile.vc BUILD=release UNICODE=1 SHARED=0 RUNTIME_LIBS=static
 
   nmake -f makefile.vc BUILD=release UNICODE=1 SHARED=0 RUNTIME_LIBS=static
 +
 +
It may be more reliable to build the wxWidgets libraries with the distributed MSVC projects, as described [http://www.wxwidgets.org/wiki/index.php/MSVC_.NET_Setup_Guide here].  When I used the commandline method several libraries were built wrong, or not at all.  -- TKSharpless
 +
 +
I never had trouble using the makefiles, maybe thats a MSVC 2005 issue? -- Pablo d'Angelo
  
 
==== Building boost ====
 
==== Building boost ====
  
Refer to the boost documentation for details. Here is a short overview:
+
Refer to the boost documentation for details, especially [http://www.boost.org/more/getting_started/windows.html#or-build-binaries-from-source Build binaries from source]. Download bjam exectable and place it in the boost directory. Open the MSVC Command line prompt located in Start Menu -> Programs  Microsoft Visual Studio -> Utilities, change directory to the boost dir and issue
Download bjam exectable from http://www.boost.org/tools/build/v1/build_system.htm
+
 
and place it in the boost directory. Open the MSVC Command line prompt and
+
  bjam stage --with-thread
change directory to the boost dir and issue
+
 
 +
This will build the boost thread library.
 +
 
 +
If you are using Visual C++ 7.1 (Visual Studio 2003) or 8.0 (Visual Studio 2005), you can save a lot of time and aggravation by getting precompiled Boost libraries from [http://www.boost-consulting.com/products/free BoostConsulting].  You first download an installer program, which when run lets you choose which library variants you want to install.  For Hugin you need the multithreaded static libraries, built for the static Microsoft C runtime with the compiler you intend to use.  If you already have a Boost installation, you can just add these libraries to it, otherwise install the Boost headers too. 
  
  bjam stage
+
Windows Boost libraries are named according to version, compiler and MS runtime variant (multi|single thread, static|dll) so take care that the Hugin build uses the right names.  Example:
 +
  libboost_date_time-vc80-mt-s-1_34_1.lib
 +
prefix 'lib' shows this is a static link library, not the import library for a Boost dll; 'vc80' says built with VC8.0; 'mt-s' built for release version of the Microsoft multithread static C runtime LIBCMT (i.e. with compiler switch '/MT') (the debug version has 'mt-sgd'); '1_34_1' built from Boost version 1.34.1 source.
  
This will build all boost library, and take several hours. Hugin only needs the boost thread library, if possible try to
 
build only that one.
 
  
 
==== Building OpenEXR ====
 
==== Building OpenEXR ====
Line 89: Line 114:
 
Apply the same procedure to the openexr-1.6 source code. Here only the IlmImf and IlmImfTest projects are needed by Hugin.
 
Apply the same procedure to the openexr-1.6 source code. Here only the IlmImf and IlmImfTest projects are needed by Hugin.
 
Follow the same process as for IlmBase, but additionally add include path for the zlib library (inside the wxWidget/src/zlib) to the IlmImf project, and wxWidget/libs/_vc/wxzlib.lib to the IlmImfTest linker options. The tests should run without errors.
 
Follow the same process as for IlmBase, but additionally add include path for the zlib library (inside the wxWidget/src/zlib) to the IlmImf project, and wxWidget/libs/_vc/wxzlib.lib to the IlmImfTest linker options. The tests should run without errors.
 +
 +
It is a good idea to create new target configurations, say HuginRelease and HuginDebug, with the Visual Studio Configuration Manager, and apply the above changes to them, so that you don't lose the original project settings.  This also makes the Hugin-appropriate libraries easy to find as they will be built in directories named for the configurations.  They should be installed in directories named that way, too; the install commands make those directories in the Deploy/... tree, but fail to copy the static libraries there because the dll library names are built into them.  However it is easy enough to copy the libs from the build folders by hand.  The ilmbase libraries must be in the Deploy tree before IlmImf is built. -- TKSharpless
 +
  
 
==== Building Panotools ====
 
==== Building Panotools ====
Line 94: Line 122:
 
[[Build_pano12_from_sourcecode_MSVC|Building Pano13 with MSVC]] is described on a separate page.
 
[[Build_pano12_from_sourcecode_MSVC|Building Pano13 with MSVC]] is described on a separate page.
  
=== Compiling Hugin ===
+
=== Building Hugin ===
 +
 
 +
Use SVN to retrieve the latest hugin sourcecode (svn root is: https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk), and save it to src/hugin-trunk. Remember the SVN revision, it will be needed later.
 +
 
 +
Place all dependencies alongside the hugin-trunk source directory. Example (versions might be slightly outdated):
 +
 
 +
src/
 +
  hugin-trunk
 +
  OpenExr
 +
  STLport-5.1.4
 +
  boost_1_34_1
 +
  enblend-3.1
 +
  libpano/pano13
 +
  wxMSW-2.8.6
 +
  make/make.exe
  
Use SVN to retrieve the latest hugin sourcecode, run CMakeSetup and use this procedure:
 
  
# Run cmake, select hugin source and build directories, tick the '''show advanced''' button. Do not choose the same directories for both source and build.
+
Run CMakeSetup to create the MSVC project files. If you use the ''Hugin SDK'' or have a 100% identical directory structure, CMakeSetup will pick up the dependencies automatically. Otherwise the paths to each dependency will have to specified manually during the following cmake step
# Press '''Configure''
 
# fill out red fields, select appropriate library and include paths, if required. The msgfmt program can be found in the gettext package installed earlier. zlib, jpeg, png and tiff libraries from the wxWidgets build can be reused. Their includes are in wxWidgets/src/(zlib|jpeg|png|tiff), and the libs are in wxWidgets/lib/vclib/wx*.lib
 
# Press '''Configure'''
 
# If more warnings and red lines appear, goto 3.
 
# Adjust some compiler settings in the CMAKE_C*_FLAGS entries.
 
#* Change C and CXX runtime libraries from \MD to \MT.
 
#* Reduce debug level from \Zl to \Zd (otherwise the debug files become bigger than MSVC can handle).
 
  
Once all fields have been filled out, the "Ok" button should be available. Press it and open the generated hugin.sln file with MSVC. Switch to Build Type to Release and start the build. After quite some time hugin should be build. In order to run hugin, it needs to be installed so that data files are in the right place. This is done by building the '''INSTALL''' project. The binaries and all required files will be installed to CMAKE_HUGIN_PREFIX. By default this is the "Program Files" folder of your windows machine.
+
# Run cmake, select hugin source and build directories. Do not choose the same directories for both source and build.
 +
# Press '''Configure''.
 +
# If building is done using an SVN checkout, the SVN revision number needs to be specified manually. Press '''Configure'' again.
 +
# CMake will pick up the dependencies and show them to you. Press '''Configure''' again. Now the '''Ok''' button should be available. If CMake had problems picking up all dependencies (for example, if you build your own libraries). CMake will prompt you if it misses something. After some iterations, all dependencies should be picked up.
 +
# Press the '''Ok''' button.
 +
# Once all fields have been filled out, the "Ok" button should be available. Press it and open the generated hugin.sln file with MSVC. Switch to Build Type to Release and start the build (press F7). After quite some time hugin should be build. In order to run hugin, it needs to be installed so that data files are in the right place. This is done by building the '''INSTALL''' project. The binaries and all required files will be installed into INSTALL/FILES subdirectory of the build directory specified during the CMake step.
 +
# Creating the .msi installer by opening INSTALL/hugin.warsetup with the WarSetup program available from http://warsetup.jgaa.com/ and clicking on the '''Build''' button.
 +
# A NSIS installer can be build by building the '''PACKAGE''' target (NSIS needs to be installed for this). This is currently a default installer, without specific functionality.
  
 
= Building using MinGW =
 
= Building using MinGW =
Line 114: Line 155:
  
  
<small>--[[User:Pablo|pablo]] 10:32, 28 October 2007 (CET)</small>
+
<small>--[[User:Pablo|pablo]] 18:10, 13 January 2008 (CET)</small>
 +
[[Category:Software:Platform:Windows]]
 +
[[Category:Software:Hugin]]
 +
[[Category:Software:Hugin:Compiling]]

Latest revision as of 22:45, 14 July 2011

NOTE: This is work in progress and not finished yet. And as hugin progresses with the introduction of new dependencies this page becomes more outdated than ever. If you are new to building hugin, try first with this method. If you know what you are doing, keep reading / following this instructions and feel free to update them.

Since mid January 2008, building hugin for Windows has been easier than this page might lead you to expect. The cmake build configuration and control system has become fully functional, and a complete set of precompiled dependencies (the Hugin SDK) is available. There are step-by-step instructions here: Build Hugin for Windows with SDK.

Why do I want to compile hugin?

If you want to fiddle with the hugin code, add new features or help squashing bugs, and do all that on Windows, this is the guide for you. Be warned that building hugin on Windows is not a piece of cake, so only try if you know the dark sides with all the development tools involved.

For normal testing purpose it is better to use the occasional binary snapshot. For first-time builders it is better to use the SDK-based instructions.

This guide is designed to be a help for people who have expressed interest in understanding the depth of building Windows version of the current hugin code on a regular basis.

This guide will describe two ways of building the latest trunk. It does not apply to the hugin code prior to 2007/10/27.

Deciding on the toolchain

Currently, there are two methods for building hugin. Both are based on the CMake build system.

  1. Compilation with Microsoft Visual Studio .NET. MSVC 2003 or 2008 is required. The recommended method is to download Microsoft Visual C++ 2008 Express Edition, and install it. For convenience a Hugin SDK with precompiled libraries for MSVC 2008 is provided. It is recommended to use these initially, rather than to compile your own libraries. There are detailed instructions at Build Hugin for Windows with SDK. Once you are familiar and comfortable with the process described there, you can move in to replace the precompiled libraries with your own self-built ones, step by step.
  2. Compilation with MinGW32. This does not require the Microsoft compiler and even allows cross compilation of binaries for windows on a linux machine. Until now, only the cross compilation approach has been tried, but a building on a native system should also be possible.

The following additional programs are also required for building a hugin installer package:

  1. CMake Note that Microsoft Visual C++ 2008 Express Edition is not supported by CMake 2.4. Download a recent Windows binary of CMake. These instructions were written at a time that only a recent CVS snapshot of CMake worked with this method. It is likely that CMake 2.6.x works as well, but it has not been tested.
  2. enblend 3.2
  3. GNU make, required by hugin, not for building hugin. (included in Hugin SDK)
  4. GNU gettext. (included in Hugin SDK)
  5. Moreover, for packgaging the installer you will need Innosetup. Instructions for this are in the Hugin repository.


For both MSVC and MinGW32 approaches, the hardest task is the compilation of the libraries required by hugin. This mainly includes wxWidgets, boost, libpano13 and OpenEXR.

Building with Microsoft Visual C++ 2008 Express Edition

This also works with earlier version from 2003 onwards. However, you will need to compile the dependencies from scratch. For simpler installation (and less headaches during building) everything is built against the older, multithreaded runtime libraries (\MT option), and linked all executables statically.

Getting the dependencies

It is tempting to download precompiled libraries from the different projects, and use those. Be prepared that they might have been created with different compiler setting (Especially with a different runtime libraries). This can lead to hard to find and nasty problems and amount to days of depressing work.

Downloading precompiled dependencies

This is the recommended approach.

Download the Hugin SDK. and unzip it into a directory of your choice. src is used in this document. Continue with #Building Hugin.

Build all required dependencies from scratch

Download the source packages. Newer versions might work, too.

  1. Download wxWidgets from http://www.wxwidgets.org, 2.8.4 were used to write this guide and it has been last tested to work with 2.8.9, but later version should work, too
  2. Download boost from http://www.boost.org, I used 1.34_1
  3. Download OpenEXR source (IlmBase and OpenEXR) from http://www.openexr.com/
  4. Download panorama tools source (pano13), from http://panotools.sf.net. Use version 2.9.12 or later. Latest SVN is even better.
  5. Download and install gettext installer package from http://gnuwin32.sf.net

Unpack the source packages.

Building wxWidgets

NOTE: this will only work for hugin SVN revisions prior to 8-Oct-2008. TODO: describe how to activate the OpenGL canvas.

1. Open libs/wxWidgets/src/tiff/tiffconf.h in your favorite editor, and add

  #define ZIP_SUPPORT

near line 90 to support ZIP compressed tiff files (update: wxWidgets ships with an ancient version of libtiff, so LZW will still be disabled. The Hugin SDK additionally contains libtiff 3.8.2). To avoid nasty popup messages with the command line tools we are going to build, additionally add:

  #define TIF_PLATFORM_CONSOLE

2. build wxWidgets: start the MSVC command line shell (from the startmenu) and cd to the wxWidgets/build/msw. To build Unicode debug release libraries, execute the following commands:

 cd wxWidgets*/build/msw
 nmake -f makefile.vc BUILD=debug UNICODE=1 SHARED=0 RUNTIME_LIBS=static
 nmake -f makefile.vc BUILD=release UNICODE=1 SHARED=0 RUNTIME_LIBS=static

It may be more reliable to build the wxWidgets libraries with the distributed MSVC projects, as described here. When I used the commandline method several libraries were built wrong, or not at all. -- TKSharpless

I never had trouble using the makefiles, maybe thats a MSVC 2005 issue? -- Pablo d'Angelo

Building boost

Refer to the boost documentation for details, especially Build binaries from source. Download bjam exectable and place it in the boost directory. Open the MSVC Command line prompt located in Start Menu -> Programs Microsoft Visual Studio -> Utilities, change directory to the boost dir and issue

  bjam stage --with-thread

This will build the boost thread library.

If you are using Visual C++ 7.1 (Visual Studio 2003) or 8.0 (Visual Studio 2005), you can save a lot of time and aggravation by getting precompiled Boost libraries from BoostConsulting. You first download an installer program, which when run lets you choose which library variants you want to install. For Hugin you need the multithreaded static libraries, built for the static Microsoft C runtime with the compiler you intend to use. If you already have a Boost installation, you can just add these libraries to it, otherwise install the Boost headers too.

Windows Boost libraries are named according to version, compiler and MS runtime variant (multi|single thread, static|dll) so take care that the Hugin build uses the right names. Example:

 libboost_date_time-vc80-mt-s-1_34_1.lib

prefix 'lib' shows this is a static link library, not the import library for a Boost dll; 'vc80' says built with VC8.0; 'mt-s' built for release version of the Microsoft multithread static C runtime LIBCMT (i.e. with compiler switch '/MT') (the debug version has 'mt-sgd'); '1_34_1' built from Boost version 1.34.1 source.


Building OpenEXR

This is a tricky one, because the MSVC project files have been set up for DLL builds with the \MD runtime, and a custom program is used to prepare the DLLs. For the all static windows binaries, quite some changes to the MSVC project files are needed.

Build according to README_win in ilmbase-1.0.0 but changed the runtime of all projects to MT.

For all projects do:

  • set each project to static lib
  • remove OPENEXR_DLL, _USEDLL and *_EXPORTS defines
  • set runtime to MT
  • disable SSE2, to generate binaries that run on all platforms
  • remove the createDLL part of the post-build command, but keep the call to install*.cmd, such as ..\..\..\installIlmImf.cmd $(IntDir)

Apply the same procedure to the openexr-1.6 source code. Here only the IlmImf and IlmImfTest projects are needed by Hugin. Follow the same process as for IlmBase, but additionally add include path for the zlib library (inside the wxWidget/src/zlib) to the IlmImf project, and wxWidget/libs/_vc/wxzlib.lib to the IlmImfTest linker options. The tests should run without errors.

It is a good idea to create new target configurations, say HuginRelease and HuginDebug, with the Visual Studio Configuration Manager, and apply the above changes to them, so that you don't lose the original project settings. This also makes the Hugin-appropriate libraries easy to find as they will be built in directories named for the configurations. They should be installed in directories named that way, too; the install commands make those directories in the Deploy/... tree, but fail to copy the static libraries there because the dll library names are built into them. However it is easy enough to copy the libs from the build folders by hand. The ilmbase libraries must be in the Deploy tree before IlmImf is built. -- TKSharpless


Building Panotools

Building Pano13 with MSVC is described on a separate page.

Building Hugin

Use SVN to retrieve the latest hugin sourcecode (svn root is: https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk), and save it to src/hugin-trunk. Remember the SVN revision, it will be needed later.

Place all dependencies alongside the hugin-trunk source directory. Example (versions might be slightly outdated):

src/
  hugin-trunk
  OpenExr
  STLport-5.1.4
  boost_1_34_1
  enblend-3.1
  libpano/pano13
  wxMSW-2.8.6
  make/make.exe


Run CMakeSetup to create the MSVC project files. If you use the Hugin SDK or have a 100% identical directory structure, CMakeSetup will pick up the dependencies automatically. Otherwise the paths to each dependency will have to specified manually during the following cmake step

  1. Run cmake, select hugin source and build directories. Do not choose the same directories for both source and build.
  2. Press 'Configure.
  3. If building is done using an SVN checkout, the SVN revision number needs to be specified manually. Press 'Configure again.
  4. CMake will pick up the dependencies and show them to you. Press Configure again. Now the Ok button should be available. If CMake had problems picking up all dependencies (for example, if you build your own libraries). CMake will prompt you if it misses something. After some iterations, all dependencies should be picked up.
  5. Press the Ok button.
  6. Once all fields have been filled out, the "Ok" button should be available. Press it and open the generated hugin.sln file with MSVC. Switch to Build Type to Release and start the build (press F7). After quite some time hugin should be build. In order to run hugin, it needs to be installed so that data files are in the right place. This is done by building the INSTALL project. The binaries and all required files will be installed into INSTALL/FILES subdirectory of the build directory specified during the CMake step.
  7. Creating the .msi installer by opening INSTALL/hugin.warsetup with the WarSetup program available from http://warsetup.jgaa.com/ and clicking on the Build button.
  8. A NSIS installer can be build by building the PACKAGE target (NSIS needs to be installed for this). This is currently a default installer, without specific functionality.

Building using MinGW

I have managed to build the older, pre GSoC 2007 version with MinGW, but still having some problems with the new trunk. Once these are resolved, I will provide instructions


--pablo 18:10, 13 January 2008 (CET)