Hugin Compiling OSX

From PanoTools.org Wiki
Revision as of 23:21, 4 August 2007 by Jdsmith (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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. Don't forget to add /opt/local/bin to your path (e.g. export PATH=/opt/local/bin:$PATH).
  4. Use port to install the necessary libraries and commands for Hugin:

    % sudo port install boost tiff jpeg libpng wxWidgets svn

    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.
  5. Download and build libpano13 from SourceForge. Alternatively, use SVN to checkout a fresh copy of libpano13 (Instructions). Build and install it (by default it will go into /usr/local/lib).
  6. Check out the hugin sources from SVN, like:

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

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

  8. Configure hugin using cmake from inside the build directory:

    % cmake ../hugin

  9. Fix up 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 -

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

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 previous stable version is easy:

% sudo port deactivate wxWidgets; sudo port install wxWidgets26

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

% sudo port deactivate wxWidgets26; sudo port activate wxWidgets

and make again.