Difference between revisions of "Hugin Compiling OSX"

From PanoTools.org Wiki
Jump to navigation Jump to search
m (libpano13 also needs location of libpng)
Line 1: Line 1:
 
== Building environment ==
 
== Building environment ==
 
'''Important note:''' this section is written without hands-on experience of a Mac, based on the [http://groups.google.com/group/hugin-ptx/browse_thread/thread/5666ff65a3570806 experience] reported by John Riley. I'd be grateful if people with access to a Mac can verify and rectify it. After rectification, please remove the note.
 
 
 
# [http://developer.apple.com/tools/download/ Download] and install the XCode Tools version for the operating system on the machine that you will use for the building job.
 
# [http://developer.apple.com/tools/download/ Download] and install the XCode Tools version for the operating system on the machine that you will use for the building job.
 
# You may find [http://finkcommander.sourceforge.net/ Fink Commander] helpful. Unfortunately it [http://sourceforge.net/forum/forum.php?forum_id=684829 seems] unsupported / unmaintained. The Fink [http://www.finkproject.org/faq/index.php?phpLang=en FAQ] may help. Can somebody please describe here how to install Fink and Fink Commander?
 
# You may find [http://finkcommander.sourceforge.net/ Fink Commander] helpful. Unfortunately it [http://sourceforge.net/forum/forum.php?forum_id=684829 seems] unsupported / unmaintained. The Fink [http://www.finkproject.org/faq/index.php?phpLang=en FAQ] may help. Can somebody please describe here how to install Fink and Fink Commander?
Line 13: Line 10:
  
 
# 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].
# If you don't have it already, install MacPorts, which provides the <tt>port</tt> command, from [http://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:  <pre>% sudo port selfupdate</pre>Make sure you have synced the latest port files:<pre>% sudo port -d sync</pre>
+
# If you don't have it already, install MacPorts, which provides the <tt>port</tt> command, from [http://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:  <pre>$ sudo port selfupdate</pre>Make sure you have synced the latest port files:<pre>$ sudo port -d sync</pre>
# Don't forget to add <tt>/opt/local/bin</tt> to your path (e.g. <tt>export PATH=/opt/local/bin:$PATH</tt>). Note: I also had to add <tt>/opt/local/include/OpenEXR</tt> to my path.
+
# Use port to install the necessary libraries and commands for Hugin:<pre>$ sudo port install boost tiff jpeg libpng wxWidgets subversion openexr exiv2</pre>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:<pre>% sudo port install boost tiff jpeg libpng wxWidgets26 subversion openexr exiv2</pre>Wait as all of these things are downloaded and compiled, and placed into /opt/local.  Go get a frappe, walk the dog, and total the first 1000 prime numbers in binary.  Rinse, lather, repeat as necessary.   
 
 
# 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]).  Build and install it (configure might need to be used with "$ ./configure --with-jpeg=/opt/local/ --with-tiff=/opt/local/ --with-png=/opt/local/", by default it will go into <tt>/usr/local/lib</tt>).
 
# 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]).  Build and install it (configure might need to be used with "$ ./configure --with-jpeg=/opt/local/ --with-tiff=/opt/local/ --with-png=/opt/local/", by default it will go into <tt>/usr/local/lib</tt>).
# Check out the hugin sources from SVN, like:<pre>% svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk hugin</pre>
+
# 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.
# 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!):<pre>% mkdir hugin_build; cd hugin_build</pre>
+
<pre>$ sudo mv /usr/bin/wx-config /usr/bin/wx-config-2.5
# Configure hugin using cmake from inside the build directory:<pre>% cmake ../hugin</pre>
+
$ sudo mv /usr/include/wx-2.5 /usr/include/wx-2.5-macTiger</pre>
# Fix up a (hopefully temporary) issue with Macport's threaded Boost library not providing generic link names for <tt>libboost_thread</tt>:
+
# Check out the hugin sources from SVN, like:<pre>$ svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk hugin</pre>
<pre>% cd /opt/local/lib
+
# 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!):<pre>$ mkdir hugin_build; cd hugin_build</pre>
% sudo ln -s libboost_thread-mt.a libboost_thread.a
+
# Configure hugin using cmake from inside the build directory:<pre>$ cmake ../hugin</pre>
% sudo ln -s libboost_thread-mt.dylib libboost_thread.dylib
+
# Fix a (hopefully temporary) issue with Macport's threaded Boost library not providing generic link names for <tt>libboost_thread</tt>:
% cd -
+
<pre>$ 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 -
 
</pre>
 
</pre>
# Compile hugin and friends:<pre>% make</pre>Watch the pretty colors go by.  Give the dog another quick spin around the block; you're finished.  Look for the new bundle <tt>src/hugin/Hugin.app</tt>.  Copy it to <tt>/Applications</tt>, or your preferred location, and commence testing.
+
# Compile hugin and friends:<pre>$ make</pre>Watch the pretty colors go by.  Give the dog another quick spin around the block; you're finished.  Look for the new bundle <tt>src/hugin/Hugin.app</tt>.  Copy 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].'''
Line 36: Line 35:
 
== Notes on wxWidgets ==
 
== Notes on wxWidgets ==
  
wxWidgets, the GUI toolkit currently employed by Hugin, is currently at version 2.8.4.  You can try either this version or the older version 2.6.4.  Switching to the latest version is easy:<blockquote>% sudo port deactivate wxWidgets26; sudo port install wxWidgets</blockquote> and recompile by typing <tt>cmake ../hugin; make</tt> in your build directory.  Switching back is as easy as:<blockquote>% sudo port deactivate wxWidgets; sudo port activate wxWidgets26</blockquote>
+
''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>
  
 
[[User:Jdsmith|Jdsmith]] 23:47, 4 August 2007 (CEST)
 
[[User:Jdsmith|Jdsmith]] 23:47, 4 August 2007 (CEST)

Revision as of 13:14, 9 April 2008

Building environment

  1. Download and install the XCode Tools version for the operating system on the machine that you will use for the building job.
  2. 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?
  3. You may find Porticus helpful with MacPorts
  4. Get and install Subversion

Compiling Hugin.app on OSX

OSX Users: Do you wish you could test those snazzy new Hugin features, provide feedback on its development, or contribute patches to make it a better tool? Here are the steps necessary to compile your very own Hugin.app direct from the latest sources:

  1. Get and install the build system CMake, version 2.4.7 or later, from CMake.
  2. 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
  3. 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.
  4. Download and build libpano13 from SourceForge. Alternatively, use SVN to checkout a fresh copy of libpano13 (Instructions). Build and install it (configure might need to be used with "$ ./configure --with-jpeg=/opt/local/ --with-tiff=/opt/local/ --with-png=/opt/local/", by default it will go into /usr/local/lib).
  5. 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
  1. Check out the hugin sources from SVN, like:
    $ svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk hugin
  2. 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
  3. Configure hugin using cmake from inside the build directory:
    $ cmake ../hugin
  4. 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 -
  1. Compile hugin and friends:
    $ make
    Watch the pretty colors go by. Give the dog another quick spin around the block; you're finished. Look for the new bundle src/hugin/Hugin.app. Copy 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