Difference between revisions of "Hugin SDK (MSVC 2013)"

From PanoTools.org Wiki
Jump to navigation Jump to search
Line 34: Line 34:
 
# Now select <tt>Configure</tt>, confirm directory creation, select <tt>Visual Studio 12 2013</tt> for building 32 bit version or <tt>Visual Studio 12 2013 Win64</tt> for the 64 bit version
 
# Now select <tt>Configure</tt>, confirm directory creation, select <tt>Visual Studio 12 2013</tt> for building 32 bit version or <tt>Visual Studio 12 2013 Win64</tt> for the 64 bit version
 
# Tick option <tt>Advanced</tt> and <tt>Grouped</tt> to see all possible variables.
 
# Tick option <tt>Advanced</tt> and <tt>Grouped</tt> to see all possible variables.
# When configure finished with error, edit some variables as described in the individual section. Then press configure again
+
# When configure finished with error, edit some variables as described in the individual section. (If the variables does not exists after configure, create it <tt>Add entry</tt>.) Then press configure again.
 
# Repeat until CMake reports <tt>Configuring done</tt> and there are no red keys in the GUI.
 
# Repeat until CMake reports <tt>Configuring done</tt> and there are no red keys in the GUI.
 
# Now select <tt>Generate</tt>
 
# Now select <tt>Generate</tt>
Line 58: Line 58:
 
* Now build for 32 bit with  
 
* Now build for 32 bit with  
 
     b2 --with-system --with-filesystem toolset=msvc variant=debug variant=release link=shared threading=multi runtime-link=shared stage
 
     b2 --with-system --with-filesystem toolset=msvc variant=debug variant=release link=shared threading=multi runtime-link=shared stage
or for 64 bit (only 1 command)
+
or for 64 bit
 
     b2 --with-system --with-filesystem toolset=msvc variant=debug variant=release link=shared threading=multi runtime-link=shared address-model=64 stage
 
     b2 --with-system --with-filesystem toolset=msvc variant=debug variant=release link=shared threading=multi runtime-link=shared address-model=64 stage
  
Line 74: Line 74:
  
 
=== zlib ===
 
=== zlib ===
 +
* Download zlib 1.2.8 from [http://www.zlib.net/] and extract source to <tt>SDKROOT\zlib-1.2.8</tt>
 +
* Now via the CMake way
 +
* After configure change key
 +
    CMAKE_INSTALL_PREFIX = SDKROOT\zlib
 +
* Now configure, generate, open project file and build <tt>INSTALL</tt> project (as described on top).
  
 
=== libpng ===
 
=== libpng ===
 +
* Download libpng from [http://www.libpng.org/pub/png/libpng.html] (e.g. zip version) and extract source
 +
* Also via CMake
 +
* Change the following keys:
 +
    CMAKE_INSTALL_PREFIX = SDKROOT\libpng
 +
    PNG_SHARED [x] (selected)
 +
    PNG_STATIC [ ] (not selected)
 +
    ZLIB_INCLUDE_DIR = SDKROOT\zlib\include
 +
    ZLIB_LIBRARY = SDKROOT\zlib\lib\zlib.lib
 +
* Finish CMake steps.
 +
 +
=== libjpeg ===
  
 
=== libtiff ===
 
=== libtiff ===
  
=== libjpeg ===
 
  
 
=== IlmBase ===
 
=== IlmBase ===
 +
* Download IlmBase from [http://www.openexr.com/downloads.html] and extract source.
 +
* Via the CMake way, change the following keys
 +
  BUILD_SHARED_LIBS [x] (selected)
 +
  CMAKE_INSTALL_PREFIX = SDKROOT\Deploy
 +
* Finish CMake steps.
  
 
=== OpenEXR ===
 
=== OpenEXR ===
 +
* Download OpenEXR from [http://www.openexr.com/downloads.html] and extract file.
 +
* Via the CMake way, change the following keys
 +
    BUILD_SHARED_LIB [x]
 +
    ILMBASE_PACKAGE_PREFIX = SDKROOT\Deploy
 +
    CMAKE_INSTALL_PREFIX = SDKROOT\Deploy
 +
    ZLIB_INCLUDE_DIR = SDKROOT\zlib\include
 +
    ZLIB_LIBRARY = SDKROOT\zlib\lib\zlib.lib
  
 
=== vigra ===
 
=== vigra ===
Line 100: Line 127:
  
 
=== sqlite3 ===
 
=== sqlite3 ===
 +
* Download the sqlite-amalgamation and sqlite-dll-win32 from [http://www.sqlite.org/download.html] and extract both files to <tt>SDKROOT>\sqlite3</tt>
 +
* Via the nmake way. For 32 bit version use
 +
    cl /D_USRDLL /D_WINDLL /MD /D_MBCS /DSQLITE_ENABLE_COLUMN_METADATA /D"SQLITE_API=extern __declspec(dllexport)" sqlite3.c /link /DLL /OUT:sqlite3.dll
 +
    lib /def:sqlite3.def
 +
or for the 64 bit version
 +
    cl /D_USRDLL /D_WINDLL /MD /D_MBCS /DSQLITE_ENABLE_COLUMN_METADATA /D"SQLITE_API=extern __declspec(dllexport)" sqlite3.c /link /DLL /OUT:sqlite3.dll
 +
    lib /def:sqlite3.def /machine:x64
  
 
=== gettext ===
 
=== gettext ===

Revision as of 18:47, 18 May 2015

This side contains some notes to compile Hugin with MS Visual Studio Community Edition 2013.

This instructions applies to build all libs as shared libraries (aka dll). In instructions refers to 32 and 64 bit except otherwise noted.

Prerequisites

First install the following prerequisites:

  • Visual Studio 2013 Community Edition: [1] (Please don't use the 2015 version. Not all needed libraries are updated for the new compiler generation.)
  • CMake [2] (select win32 installer )
  • Tortoise HG, to get code from repository [3] (select 32 or 64 bit, which one is appropriate for your system, not for the architecture you are building)
  • MS HTML Help Workshop, for creating the help file [4]
  • 7-zip, to extract some downloads [5]

Dependencies

General notes

  • First create a directory, where we build all libraries and program. This directory is called SDKROOT in the following steps. It's best to use a directory without white spaces or other special characters, e.g. c:\huginSDK would be a good point. Replace SDKROOT with your real path in all places.
  • There are mainly 2 build ways, depending on the library
    • The CMake way
    • The nmake way

In the following we will give only short instructions, and mention where differences to the general way are.

The CMake way

  1. Open the CMake (CMake-gui) from the start menu
  2. Browse to the path where you extracted the source
  3. Specify a path where the library is build. Normally use SDKROOT\build_lib (Replace lib with the name of the corresponding library.)
  4. Now select Configure, confirm directory creation, select Visual Studio 12 2013 for building 32 bit version or Visual Studio 12 2013 Win64 for the 64 bit version
  5. Tick option Advanced and Grouped to see all possible variables.
  6. When configure finished with error, edit some variables as described in the individual section. (If the variables does not exists after configure, create it Add entry.) Then press configure again.
  7. Repeat until CMake reports Configuring done and there are no red keys in the GUI.
  8. Now select Generate
  9. Open the generated project file (xxx.sln) in the build folder
  10. In Visual Studio check that on the top there is selected Release and 32 bit or x64.
  11. Select the project INSTALL, open context menu (right menu button) and select Build
  12. Now VS builds the lib and copies all necessary files to the install destination.

The nmake way

  1. Open Start>Visual Studio 2013>Visual Studio Tools
  2. Start VS2013 x86 Native Tools Command Prompt (for 32 bit) or VS2013 x64 Native Tools Command Prompt (for 64 bit)
  3. Switch to the path where you extracted the source
   cd SDKROOT\lib
  1. Now build the library. The exact instruction are given in the approbate section.

Boost

  • Download from [6] (.7z version is fine)
  • Extract to SDKROOT\boost_1_58_0
  • Now via the nmake way
    cd SDKROOT\boost_1_58_0
    bootstrap.bat
  • Now build for 32 bit with
    b2 --with-system --with-filesystem toolset=msvc variant=debug variant=release link=shared threading=multi runtime-link=shared stage

or for 64 bit

    b2 --with-system --with-filesystem toolset=msvc variant=debug variant=release link=shared threading=multi runtime-link=shared address-model=64 stage

wxWidgets

  • Download from [7] Windows Source and extract source to SDKROOT\wxWidgets-3.0.2
  • Also via the nmake way
    cd SDKROOT\wxWidgets-3.0.2\build\msw
  • Now build for 32 bit
    nmake -f makefile.vc BUILD=debug SHARED=1 USE_OPENGL=1 RUNTIME_LIBS=dynamic
    nmake -f makefile.vc BUILD=release SHARED=1 USE_OPENGL=1 RUNTIME_LIBS=dynamic

or for 64 bit

    nmake -f makefile.vc BUILD=debug TARGET_CPU=AMD64 SHARED=1 USE_OPENGL=1 RUNTIME_LIBS=dynamic
    nmake -f makefile.vc BUILD=release TARGET_CPU=AMD64 SHARED=1 USE_OPENGL=1 RUNTIME_LIBS=dynamic

zlib

  • Download zlib 1.2.8 from [8] and extract source to SDKROOT\zlib-1.2.8
  • Now via the CMake way
  • After configure change key
   CMAKE_INSTALL_PREFIX = SDKROOT\zlib
  • Now configure, generate, open project file and build INSTALL project (as described on top).

libpng

  • Download libpng from [9] (e.g. zip version) and extract source
  • Also via CMake
  • Change the following keys:
   CMAKE_INSTALL_PREFIX = SDKROOT\libpng
   PNG_SHARED [x] (selected)
   PNG_STATIC [ ] (not selected)
   ZLIB_INCLUDE_DIR = SDKROOT\zlib\include
   ZLIB_LIBRARY = SDKROOT\zlib\lib\zlib.lib
  • Finish CMake steps.

libjpeg

libtiff

IlmBase

  • Download IlmBase from [10] and extract source.
  • Via the CMake way, change the following keys
  BUILD_SHARED_LIBS [x] (selected)
  CMAKE_INSTALL_PREFIX = SDKROOT\Deploy
  • Finish CMake steps.

OpenEXR

  • Download OpenEXR from [11] and extract file.
  • Via the CMake way, change the following keys
   BUILD_SHARED_LIB [x] 
   ILMBASE_PACKAGE_PREFIX = SDKROOT\Deploy
   CMAKE_INSTALL_PREFIX = SDKROOT\Deploy
   ZLIB_INCLUDE_DIR = SDKROOT\zlib\include
   ZLIB_LIBRARY = SDKROOT\zlib\lib\zlib.lib

vigra

expat

exiv2

glut

glew

fftw3

lcms2

sqlite3

  • Download the sqlite-amalgamation and sqlite-dll-win32 from [12] and extract both files to SDKROOT>\sqlite3
  • Via the nmake way. For 32 bit version use
    cl /D_USRDLL /D_WINDLL /MD /D_MBCS /DSQLITE_ENABLE_COLUMN_METADATA /D"SQLITE_API=extern __declspec(dllexport)" sqlite3.c /link /DLL /OUT:sqlite3.dll 
    lib /def:sqlite3.def

or for the 64 bit version

    cl /D_USRDLL /D_WINDLL /MD /D_MBCS /DSQLITE_ENABLE_COLUMN_METADATA /D"SQLITE_API=extern __declspec(dllexport)" sqlite3.c /link /DLL /OUT:sqlite3.dll 
    lib /def:sqlite3.def /machine:x64

gettext

exiftool

  • Download exiftool [13] (select Windows Executable)
  • Create the directory SDKROOT\exiftool
  • Decompress the file to this folder and rename exiftool(-k).exe to exiftool.exe

panotools

Build Hugin