Difference between revisions of "Hugin Compiling OSX"

From PanoTools.org Wiki
Jump to: navigation, search
m
m
Line 8: Line 8:
 
**Fink: sudo apt-get [install][update][uninstall][search] <package1> <package2> <packagex>
 
**Fink: sudo apt-get [install][update][uninstall][search] <package1> <package2> <packagex>
 
'''Note:''' These are only the bare command options for both port and apt-get. See their respective websites [http://www.macports.org/ Macports.org] and [http://www.finkproject.org/ Finkproject.org] for documentation.
 
'''Note:''' These are only the bare command options for both port and apt-get. See their respective websites [http://www.macports.org/ Macports.org] and [http://www.finkproject.org/ Finkproject.org] for documentation.
 +
  
  
Line 13: Line 14:
 
===Download and install XCode===
 
===Download and install XCode===
 
[http://developer.apple.com/tools/download/ Download] and install the XCode Tools version for your MacOSX version: Xcode 2.4.x for MacOSX 10.4.x or below and Xcode 3.x for 10.5.x (Leopard). You will not use the Xcode development environment itself, but the MacOSX system comes without the GNU compiler, builder, linker and so on. For those who are brave enough to ponder into the dark corners of the installed base: You will find a 4.x version and a 3.3 version of the GNU compiler and it's "companions". Do not remove either of them. The 4.x version is used for i386/X_64 builds and the 3.3 version is used for the "older"PPC builds.
 
[http://developer.apple.com/tools/download/ Download] and install the XCode Tools version for your MacOSX version: Xcode 2.4.x for MacOSX 10.4.x or below and Xcode 3.x for 10.5.x (Leopard). You will not use the Xcode development environment itself, but the MacOSX system comes without the GNU compiler, builder, linker and so on. For those who are brave enough to ponder into the dark corners of the installed base: You will find a 4.x version and a 3.3 version of the GNU compiler and it's "companions". Do not remove either of them. The 4.x version is used for i386/X_64 builds and the 3.3 version is used for the "older"PPC builds.
 
 
===Install CMake===
 
===Install CMake===
 
Get and install the build system CMake, version 2.4.7 or later, from [http://www.cmake.org/HTML/Download.html CMake].
 
Get and install the build system CMake, version 2.4.7 or later, from [http://www.cmake.org/HTML/Download.html CMake].
 
 
===Install Macports===
 
===Install Macports===
 
If you don't have it already, install MacPorts, which provides the <tt>port</tt> command, from [http://www.macports.org MacPorts], giving you compilable package access to thousands of pieces of open source software.  If you already have macports (formerly darwinports) installed, update it:  <blockquote><pre>$ sudo port selfupdate</pre>Make sure you have synced the latest port files:<pre>$ sudo port -d sync</pre></blockquote>
 
If you don't have it already, install MacPorts, which provides the <tt>port</tt> command, from [http://www.macports.org MacPorts], giving you compilable package access to thousands of pieces of open source software.  If you already have macports (formerly darwinports) installed, update it:  <blockquote><pre>$ sudo port selfupdate</pre>Make sure you have synced the latest port files:<pre>$ sudo port -d sync</pre></blockquote>
 
 
===Fink commander===
 
===Fink commander===
 
''Note: This tutorial describes how to build Hugin with MacPorts. This should more or less be the same for Fink. All references to <tt>/opt/local</tt> that are mentioned here for MacPorts shoudl be changed with <tt>/sw</tt> for Fink.''
 
''Note: This tutorial describes how to build Hugin with MacPorts. This should more or less be the same for Fink. All references to <tt>/opt/local</tt> that are mentioned here for MacPorts shoudl be changed with <tt>/sw</tt> for Fink.''
Line 32: Line 30:
 
==Install necessary libraries==  
 
==Install necessary libraries==  
 
Use port to install the necessary libraries and commands for Hugin:<blockquote><pre>$ sudo port install boost tiff jpeg libpng wxWidgets subversion openexr exiv2</pre></blockquote>Wait as all of these source packages (and it's dependencies) are downloaded and compiled, and installed into /opt/local.  Go get a frappe, walk the dog, and total the first 1000 prime numbers in binary.  Rinse, lather, repeat as necessary.   
 
Use port to install the necessary libraries and commands for Hugin:<blockquote><pre>$ sudo port install boost tiff jpeg libpng wxWidgets subversion openexr exiv2</pre></blockquote>Wait as all of these source packages (and it's dependencies) are downloaded and compiled, and installed into /opt/local.  Go get a frappe, walk the dog, and total the first 1000 prime numbers in binary.  Rinse, lather, repeat as necessary.   
 
 
===Build libpano13===
 
===Build libpano13===
 
Download and build libpano13 from [http://sourceforge.net/project/showfiles.php?group_id=96188&package_id=237430 SourceForge]. Alternatively, use SVN to checkout a fresh copy of libpano13 ([http://sourceforge.net/svn/?group_id=96188 Instructions]).   
 
Download and build libpano13 from [http://sourceforge.net/project/showfiles.php?group_id=96188&package_id=237430 SourceForge]. Alternatively, use SVN to checkout a fresh copy of libpano13 ([http://sourceforge.net/svn/?group_id=96188 Instructions]).   
Line 42: Line 39:
 
$ sudo make install</pre></blockquote>
 
$ sudo make install</pre></blockquote>
 
By default it will go into <tt>/usr/local/lib</tt>).
 
By default it will go into <tt>/usr/local/lib</tt>).
 
 
===WxWidgets on Tiger (10.4.x)===
 
===WxWidgets on Tiger (10.4.x)===
 
Fix a problem on Tiger (10.4.x): Tiger comes with WxWindows version 2.5. The Hugin cmake will search OS paths first and will find it's own version 2.5 instead of your freshly compiled 2.8. You need to get Tiger's 2.5 version out of the way as you won't be able to build hugin succesfully.
 
Fix a problem on Tiger (10.4.x): Tiger comes with WxWindows version 2.5. The Hugin cmake will search OS paths first and will find it's own version 2.5 instead of your freshly compiled 2.8. You need to get Tiger's 2.5 version out of the way as you won't be able to build hugin succesfully.
 
<blockquote><pre>$ sudo mv /usr/bin/wx-config /usr/bin/wx-config-2.5
 
<blockquote><pre>$ sudo mv /usr/bin/wx-config /usr/bin/wx-config-2.5
 
$ sudo mv /usr/include/wx-2.5 /usr/include/wx-2.5-macTiger</pre></blockquote>
 
$ sudo mv /usr/include/wx-2.5 /usr/include/wx-2.5-macTiger</pre></blockquote>
 
+
===Fix libboost===  
===Fix lib_boost===  
 
 
Fix a (hopefully temporary) issue with Macport's threaded Boost library not providing generic link names for <tt>libboost_thread</tt>:
 
Fix a (hopefully temporary) issue with Macport's threaded Boost library not providing generic link names for <tt>libboost_thread</tt>:
 
<blockquote><pre>$ cd /opt/local/lib
 
<blockquote><pre>$ cd /opt/local/lib
Line 56: Line 51:
 
</pre></blockquote>
 
</pre></blockquote>
  
===Get and compile hugin===
+
 
====Get Hugin from SVN====
+
 
 +
==Build Hugin==
 +
===Get Hugin from SVN===
 
Check out the hugin sources from SVN, like:<blockquote><pre>$ svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk hugin</pre></blockquote>
 
Check out the hugin sources from SVN, like:<blockquote><pre>$ svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk hugin</pre></blockquote>
 
+
===Create hugin build directory===
====Create hugin_build directory====
+
Create another directory alongside the newly created <tt>hugin/</tt> for the build files (a cool feature of CMake: it doesn't need to pollute your source directory with build files!):<blockquote><pre>$ mkdir hugin_build; cd hugin_build</pre></blockquote>''Note: You can give this directory any name you want, but hugin_build is chosen for it's clarity.''
Create another directory alongside the newly created <tt>hugin/</tt> for the build files (a cool feature of CMake: it doesn't need to pollute your source directory with build files!):<blockquote><pre>$ mkdir hugin_build; cd hugin_build</pre></blockquote>
+
===Configure build===
====Configure build====
+
Configure hugin using cmake from inside the build directory you created:<blockquote><pre>$ cmake ../hugin</pre></blockquote>
Configure hugin using cmake from inside the build directory:<blockquote><pre>$ cmake ../hugin</pre></blockquote>
+
===Compile Hugin===
====Compile Hugin====
 
 
Compile Hugin and friends:<blockquote><pre>$ make
 
Compile Hugin and friends:<blockquote><pre>$ make
 
$ sudo make install</pre></blockquote>Watch the pretty colors go by.  Give the dog another quick spin around the block; you're finished.  Look for the new bundle <tt>Hugin.app</tt> in <tt>usr/local/Applications/</tt> or in <tt>usr/local/bin/</tt>.  Copy or link it to <tt>/Applications</tt>, or your preferred location, and commence testing.
 
$ sudo make install</pre></blockquote>Watch the pretty colors go by.  Give the dog another quick spin around the block; you're finished.  Look for the new bundle <tt>Hugin.app</tt> in <tt>usr/local/Applications/</tt> or in <tt>usr/local/bin/</tt>.  Copy or link it to <tt>/Applications</tt>, or your preferred location, and commence testing.
  
 
'''Note: This is a new build configuration and you may encounter problems.  Report them on [http://groups.google.com/group/hugin-ptx the Hugin mailing list].'''
 
'''Note: This is a new build configuration and you may encounter problems.  Report them on [http://groups.google.com/group/hugin-ptx the Hugin mailing list].'''
 +
 +
  
 
== Important Note on the produced Bundle ==
 
== Important Note on the produced Bundle ==
 +
Since the produced Hugin.app bundle links dynamically to libraries outside of the bundle, it is not yet portable, i.e. cannot be copied or shared unless the other machine has the same collection of libraries available in the same places.  This is to facilitate development and testing (re-compile external libraries and test without re-building).  Building a fully portable universal binary version at the command line is planned.
 +
  
Since the produced Hugin.app bundle links dynamically to libraries outside of the bundle, it is not yet portable, i.e. cannot be copied or shared unless the other machine has the same collection of libraries available in the same places.  This is to facilitate development and testing (re-compile external libraries and test without re-building).  Building a fully portable universal binary version at the command line is planned.
 
  
 
== Notes on wxWidgets ==
 
== Notes on wxWidgets ==
 
 
''Note: For testing purposes you might use wxWidgets 2.6.4, but the newer versions of the 0.7 version no longer fully support 2.6.''
 
''Note: For testing purposes you might use wxWidgets 2.6.4, but the newer versions of the 0.7 version no longer fully support 2.6.''
 
wxWidgets, the GUI toolkit currently employed by Hugin, is currently at version 2.8.4.  You can use either this version or try the older version 2.6.4.  Switching to the older version 2.6.4 is easy:<blockquote>$ sudo port deactivate wxWidgets; sudo port install wxWidgets26</blockquote> and recompile by typing <tt>cmake ../hugin; make</tt> in your build directory.  Switching back is as easy as:<blockquote>$ sudo port deactivate wxWidgets26; sudo port activate wxWidgets</blockquote>
 
wxWidgets, the GUI toolkit currently employed by Hugin, is currently at version 2.8.4.  You can use either this version or try the older version 2.6.4.  Switching to the older version 2.6.4 is easy:<blockquote>$ sudo port deactivate wxWidgets; sudo port install wxWidgets26</blockquote> and recompile by typing <tt>cmake ../hugin; make</tt> in your build directory.  Switching back is as easy as:<blockquote>$ sudo port deactivate wxWidgets26; sudo port activate wxWidgets</blockquote>
  
 
[[User:Jdsmith|Jdsmith]] 23:47, 4 August 2007 (CEST)
 
[[User:Jdsmith|Jdsmith]] 23:47, 4 August 2007 (CEST)
 +
 +
  
 
== Building Enblend (using Fink) ==
 
== Building Enblend (using Fink) ==
 +
follow these [[Enblend_Compiling_OSX|updated instructions]]
 +
  
follow these [[Enblend_Compiling_OSX|updated instructions]]
 
  
 
== Bulding Autopano-Sift-C ==
 
== Bulding Autopano-Sift-C ==
 
 
Follow [[autopano-sift-C_Compiling_OSX|these instructions]]
 
Follow [[autopano-sift-C_Compiling_OSX|these instructions]]
  
 
[[Category:Software:Hugin]] [[Category:Software:Platform:Mac OS X]]
 
[[Category:Software:Hugin]] [[Category:Software:Platform:Mac OS X]]

Revision as of 10:53, 10 April 2008

Introduction

OSX Users: This tutorial describes how to build hugin on OSX via MacPorts. Fink users should also be able to use it even though the commands and directory structure is different from MacPorts.

  • Directory structure where everything is built and installed:
    • MacPorts: /opt/local
    • Fink: /sw
  • Main commands to install/update/uninstall/deactivate packages:
    • MacPorts: sudo port [install][update][uninstall][search] <package1> <package2> <packagex>
    • Fink: sudo apt-get [install][update][uninstall][search] <package1> <package2> <packagex>

Note: These are only the bare command options for both port and apt-get. See their respective websites Macports.org and Finkproject.org for documentation.


Building environment

Download and install XCode

Download and install the XCode Tools version for your MacOSX version: Xcode 2.4.x for MacOSX 10.4.x or below and Xcode 3.x for 10.5.x (Leopard). You will not use the Xcode development environment itself, but the MacOSX system comes without the GNU compiler, builder, linker and so on. For those who are brave enough to ponder into the dark corners of the installed base: You will find a 4.x version and a 3.3 version of the GNU compiler and it's "companions". Do not remove either of them. The 4.x version is used for i386/X_64 builds and the 3.3 version is used for the "older"PPC builds.

Install CMake

Get and install the build system CMake, version 2.4.7 or later, from CMake.

Install Macports

If you don't have it already, install MacPorts, which provides the port command, from MacPorts, giving you compilable package access to thousands of pieces of open source software. If you already have macports (formerly darwinports) installed, update it:

$ sudo port selfupdate

Make sure you have synced the latest port files:

$ sudo port -d sync

Fink commander

Note: This tutorial describes how to build Hugin with MacPorts. This should more or less be the same for Fink. All references to /opt/local that are mentioned here for MacPorts shoudl be changed with /sw for Fink. You may find Fink Commander helpful. Unfortunately it seems unsupported / unmaintained. The Fink FAQ may help. Can somebody please describe here how to install Fink and Fink Commander?

Porticus

You may find Porticus helpful with MacPorts

Subversion (SVN)

Get and install Subversion


Install necessary libraries

Use port to install the necessary libraries and commands for Hugin:

$ sudo port install boost tiff jpeg libpng wxWidgets subversion openexr exiv2

Wait as all of these source packages (and it's dependencies) are downloaded and compiled, and installed into /opt/local. Go get a frappe, walk the dog, and total the first 1000 prime numbers in binary. Rinse, lather, repeat as necessary.

Build libpano13

Download and build libpano13 from SourceForge. Alternatively, use SVN to checkout a fresh copy of libpano13 (Instructions).

Build SVN libpano13

To build and install the svn version (preferred) you first need to edit the bootstrap file and change LIBTOOLIZE=${LIBTOOLIZE:-libtoolize} to LIBTOOLIZE=${LIBTOOLIZE:-glibtoolize}.

$ ./bootstrap --with-jpeg=/opt/local/ --with-tiff=/opt/local/ --with-png=/opt/local/
$ ./configure
$ make
$ sudo make install

By default it will go into /usr/local/lib).

WxWidgets on Tiger (10.4.x)

Fix a problem on Tiger (10.4.x): Tiger comes with WxWindows version 2.5. The Hugin cmake will search OS paths first and will find it's own version 2.5 instead of your freshly compiled 2.8. You need to get Tiger's 2.5 version out of the way as you won't be able to build hugin succesfully.

$ sudo mv /usr/bin/wx-config /usr/bin/wx-config-2.5
$ sudo mv /usr/include/wx-2.5 /usr/include/wx-2.5-macTiger

Fix libboost

Fix a (hopefully temporary) issue with Macport's threaded Boost library not providing generic link names for libboost_thread:

$ cd /opt/local/lib
$ sudo ln -s libboost_thread-mt.a libboost_thread.a
$ sudo ln -s libboost_thread-mt.dylib libboost_thread.dylib
$ cd -


Build Hugin

Get Hugin from SVN

Check out the hugin sources from SVN, like:

$ svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk hugin

Create hugin build directory

Create another directory alongside the newly created hugin/ for the build files (a cool feature of CMake: it doesn't need to pollute your source directory with build files!):

$ mkdir hugin_build; cd hugin_build

Note: You can give this directory any name you want, but hugin_build is chosen for it's clarity.

Configure build

Configure hugin using cmake from inside the build directory you created:

$ cmake ../hugin

Compile Hugin

Compile Hugin and friends:

$ make
$ sudo make install

Watch the pretty colors go by. Give the dog another quick spin around the block; you're finished. Look for the new bundle Hugin.app in usr/local/Applications/ or in usr/local/bin/. Copy or link it to /Applications, or your preferred location, and commence testing.

Note: This is a new build configuration and you may encounter problems. Report them on the Hugin mailing list.


Important Note on the produced Bundle

Since the produced Hugin.app bundle links dynamically to libraries outside of the bundle, it is not yet portable, i.e. cannot be copied or shared unless the other machine has the same collection of libraries available in the same places. This is to facilitate development and testing (re-compile external libraries and test without re-building). Building a fully portable universal binary version at the command line is planned.


Notes on wxWidgets

Note: For testing purposes you might use wxWidgets 2.6.4, but the newer versions of the 0.7 version no longer fully support 2.6.

wxWidgets, the GUI toolkit currently employed by Hugin, is currently at version 2.8.4. You can use either this version or try the older version 2.6.4. Switching to the older version 2.6.4 is easy:

$ sudo port deactivate wxWidgets; sudo port install wxWidgets26

and recompile by typing cmake ../hugin; make in your build directory. Switching back is as easy as:

$ sudo port deactivate wxWidgets26; sudo port activate wxWidgets

Jdsmith 23:47, 4 August 2007 (CEST)


Building Enblend (using Fink)

follow these updated instructions


Bulding Autopano-Sift-C

Follow these instructions