https://wiki.panotools.org/api.php?action=feedcontributions&user=Ylzhao&feedformat=atomPanoTools.org Wiki - User contributions [en]2024-03-29T04:45:19ZUser contributionsMediaWiki 1.35.3https://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=15577Hugin Compiling Ubuntu2013-11-10T12:43:08Z<p>Ylzhao: /* Configure the Build Environment */</p>
<hr />
<div>== Who Is This Page For ==<br />
<br />
These instructions contain the collective wisdom of Hugin contributors that are using Ubuntu or any of its variations (Ku/Xu/Lu/Edu/...buntu). They are work in progress and updated when newer versions of Ubuntu are released or when Hugin introduces new dependencies. They have worked, at the time of release or soon thereafter, with all 'buntu versions up until 12.04. They are intended to help contributors on the learning curve. If you are not here to contribute, spare yourself the effort and see the [[#Shortcut|Shortcut]] section below.<br />
<br />
They are likely to work only for the latest 'buntu release, but you can check this page's history at the time that the older 'buntu version was the most recent one to find the specifics for that version.<br />
<br />
If you are new here, read the whole page. It is recommended that you go sequentially through it.<br />
<br />
If you're familiar with the process and have run it a few times, look at the what's new section for important news.<br />
<br />
Apart from the odd change in package name, nothing should be substantially different (and if it does not work, please leave a comment on the [http://groups.google.com/group/hugin-ptx hugin-ptx mailing list]). Don't worry if the same package appears twice in an apt-get install line - apt-get will update existing packages if there is a newer version, and ignore duplicates if the latest version is already installed. On the other hand, if apt-get says that it can't find a package, it might be the odd change in package name. You can find a replacement package by using apt-cache search with a substring of the package required, e.g.:<br />
<br />
<pre><br />
apt-cache search wxW<br />
</pre><br />
<br />
The goal is to build hugin and the whole set of helper applications required, and start understanding the building process. You will need a deeper understanding of the building process if you want to:<br />
<br />
* develop code<br />
* translate the latest strings<br />
* document the latest features with manuals and tutorials<br />
* package for distribution<br />
<br />
That knowledge is beyond the scope of this document. This document ends with a binary that is fit for installation on your machine. It is not fit for any other purpose, particularly not for distribution. CMake is [http://groups.google.com/group/hugin-ptx/msg/3f29b207c562fd63 known] to build broken deb packages. Please do not distribute these binaries.<br />
<br />
== What's New ==<br />
<br />
'''25 January 2013''': The build instructions for the most recent versions of enblend, libpano13, and hugin have been updated for 'buntu 12.04LTS. A lot of information applying to previous releases has been deleted in an effort to make the page more readable. If you're building on an earlier release, be sure to click the "View History" tab above and check the build details around the time your 'buntu version was released.<br />
<br />
'''9 May 2011''': The integration of the python_scripting development branch brings new dependencies and a new build-time configuration switch for Hugin. See changes in the documentation below. swig2.0 is officially distributed only with Natty (11.04 onwards). If you have an older Ubuntu version you will either have to forego the python scripting feature or find an alternative swig2.0 (either a PPA or build it yourself).<br />
<br />
'''2 May 2011''': If you are using an earlier version of Ubuntu than 11.04, there is a chance that your Mercurial version is too old for grabbing updates. New (non-critical security) updates to a program do not get added to old versions of Ubuntu, so any new changes will need to be added manually. When running Mercurial (pull, update, etc), you may get an error like<br />
<br />
<pre><br />
abort: requirement 'dotencode' not supported!<br />
</pre><br />
<br />
To fix this, you can use the package archive from Mercurial PPA Packagers and get the latest release:<br />
<br />
<pre><br />
sudo apt-add-repository ppa:mercurial-ppa/releases<br />
sudo apt-get update<br />
sudo apt-get install mercurial<br />
</pre><br />
<br />
'''5 March 2010''': Foreign library libtclap removed from source tree. This introduces a new dependency on libtclap-dev<br />
<br />
'''February 2010''': Libpano has migrated from SVN to Mercurial.<br />
<br />
== Shortcut ==<br />
<br />
Hugin evolves fast and the official 'buntu distributions carry versions that are usually 3-6 months older than the 'buntu distribution date. Moreover, they do not backport Hugin and related tools.<br />
<br />
Even if you religiously follow the 'buntu six months update cycle, you may be using a version of Hugin that is one or two release cycles in our past. If your sole objective is to use the new features of Hugin, the instructions in this section are for you. Start a command line terminal, type the three commands and you're done.<br />
<br />
If for some reason that's not enough for you - if you want to actually learn and become a contributor; or if you're just curious about getting even closer to the bleeding edge and trade stability for features and excitement, the rest of this document is for you.<br />
<br />
=== Stable ===<br />
<br />
This will install the latest stable version of the tools:<br />
<pre><br />
sudo add-apt-repository ppa:hugin/hugin-builds<br />
sudo apt-get update<br />
sudo apt-get install hugin enblend panini<br />
</pre><br />
<br />
=== Unstable ===<br />
<br />
This will install the latest unstable version of the tools. While they are likely to work in most cases, there is no guarantee and they are not recommended for a production environment. Use at your own risk, and please report (and if possible fix) bugs. Most of the time these unstable builds are closer to the bleeding edge than to the stable builds. If you want the really really really bleeding edge, you'll have to work through the instructions in the next sections, though.<br />
<br />
<pre><br />
sudo add-apt-repository ppa:hugin/hugin-builds<br />
sudo add-apt-repository ppa:hugin/nightly<br />
sudo apt-get update<br />
sudo apt-get install hugin enblend panini<br />
</pre><br />
<br />
== Building Environment ==<br />
<br />
Since we are going to build hugin, libpano13 and enblend we need to download and install all the development packages. This is very easy with apt-get. In a terminal window (K menu -> System -> Konsole or Applications -> Accessories -> Terminal (in Kubuntu), Applications -> Accessories -> Terminal (in Ubuntu)), enter:<br />
<br />
<pre><br />
sudo apt-get install build-essential autoconf automake1.9 libtool flex bison gdb \<br />
libc6-dev libgcc1 cmake pkg-config help2man checkinstall<br />
</pre><br />
<br />
To get the bleeding edge we'll need access to the SVN and Mercurial repositories, and for this we need the correct tools:<br />
<br />
<pre><br />
sudo apt-get install subversion mercurial<br />
</pre><br />
<br />
Not necessary, but useful if you want to revisit configuration sets in ccmake:<br />
<br />
<pre><br />
sudo apt-get install cmake-curses-gui<br />
</pre><br />
<br />
To get on the same page as far as file system layout is concerned, we'll create a folder to contain all source code in your home folder:<br />
<br />
<pre><br />
cd<br />
mkdir -p src<br />
</pre><br />
<br />
=== For Distributors ===<br />
<br />
If you want to build packages for distribution, you will also need the following tools and settings.<br />
<br />
<pre><br />
sudo apt-get install subversion-tools<br />
sudo echo 'deb-src ftp://ftp.at.debian.org/debian ../project/experimental main' > /etc/apt/sources.list.d/debian-experimental.list<br />
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 55BE302B<br />
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B8D7663<br />
sudo apt-get update<br />
sudo apt-get install devscripts<br />
</pre><br />
<br />
You will also need an OpenPGP key, and a Launchpad account. Follow the [[Hugin_Trackers#Launchpad_Account|instructions]] for Launchpad account creation, including the signing of the Ubuntu Code of Conduct.<br />
<br />
Moreover, it is likely that your environment is not clean enough for distribution builds. In that case, and to produce binaries for other Ubuntu series than the one you are running, you will want to set up a dchroot environment (to be documented later on).<br />
<br />
== Building Libpano13 ==<br />
<br />
libpano13 is the new version of the PanoTools libraries. This is a necessary component for hugin, and we need to build it first. To build libpano13 we need some libraries and particularly their development ("dev") packages:<br />
<br />
<pre><br />
sudo apt-get install zlib1g-dev libpng12-dev libjpeg-dev libtiff-dev<br />
</pre><br />
<br />
We then need to download the source code from the central repository:<br />
<br />
<pre><br />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
hg clone http://hg.code.sf.net/p/panotools/libpano13 libpano.hg<br />
</pre><br />
<br />
If you're a contributor with write access, use the following clone command instead:<br />
<br />
<pre><br />
hg clone ssh://USERNAME@hg.code.sf.net/p/panotools/libpano13 libpano.hg<br />
</pre><br />
<br />
In the future there is no need to get the whole source again. Just issue the following commands to bring your source up to date:<br />
<br />
<pre><br />
cd libpano.hg<br />
hg pull<br />
hg up<br />
cd ..<br />
</pre><br />
<br />
Now start the building process. Set -DCMAKE_BUILD_TYPE=Debug if you want to help investigate/debug a problem and capture even more debugging information.<br />
<br />
<pre><br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano.hg -DCMAKE_INSTALL_PREFIX=/usr/local -DCPACK_BINARY_DEB:BOOL=ON \<br />
-DCPACK_BINARY_NSIS:BOOL=OFF -DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF \<br />
-DCPACK_BINARY_TBZ2:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF \<br />
-DCMAKE_BUILD_TYPE=RelWithDebInfo<br />
make package<br />
sudo dpkg -i libpano13-*-Linux.deb<br />
</pre><br />
<br />
=== The old autotools way ===<br />
<br />
The above described building process uses CMake to build libpano which has many advantages. Amongst others it creates a clean package to install / deinstall and decreases the likelihood of wrecking the system. However CMake support is relatively new in libpano. The old autotools way is documented below for completeness. You should not need it. However if you do, make sure to run either the CMake build or the autotools build on fresh repository checkouts to avoid interferences.<br />
<br />
<pre><br />
./bootstrap<br />
</pre><br />
<br />
If any libraries are missing, the script will complain (or at least, let you know that some library hasn't been found). In that case you probably need to install the library. To find in what package is that library, a general rule is to run the command <code>apt-cache search ''missingfile''</code>, find the relevant library and install both the library and the related <code>-dev</code> package.<br />
Run the <code>./configure</code> script and repeat this process until you have met all the dependencies.<br />
<br />
Then we are ready to launch the make process with<br />
<br />
<pre><br />
make<br />
</pre><br />
<br />
If the library successfully compiles, you have to install it with<br />
<br />
<pre><br />
sudo make install<br />
sudo ldconfig<br />
</pre><br />
<br />
The last part is for the OS to be aware of the new library (that has been installed in <code>/usr/local/lib</code>).<br />
<br />
== Building Enblend ==<br />
<br />
Get the dependencies. If you are working with large images (300 megapixels and up), you should have a libtiff-dev compiled with large file support and libstdc++6.<br />
<br />
<pre><br />
sudo apt-get install libtiff4-dev libopenexr-dev libboost-system-dev \<br />
libboost-filesystem-dev libboost-graph-dev libboost-thread-dev \<br />
freeglut3-dev libglew-dev libxi-dev libxmu-dev libplot-dev libgsl0-dev \<br />
liblcms2-dev<br />
</pre><br />
<br />
UPDATE: the latest package libvigraimpex-dev included in Linux Mint 15 (=Ubuntu 13.04) has the version 1.9.0-0ubuntu2 - and I did not encounter any problems with using this instead of compiling it myself:<br />
<pre><br />
sudo apt-get install libvigraimpex-dev<br />
</pre><br />
<br />
If you still want to compile it yourself, here's how:<br />
The most recent version of Enblend (4.2) also requires version 1.9 of the VIGRA computer vision library. Unfortunately, 'buntu versions up to and including the forthcoming 13.04 (Raring Ringtail) only provide version 1.8 of the VIGRA library, so you'll have to build your own, as follows:<br />
<br />
<pre><br />
cd ~/src<br />
wget http://hci.iwr.uni-heidelberg.de/vigra/vigra-1.9.0-src.tar.gz<br />
tar -zxvf vigra-1.9.0-src.tar.gz<br />
cd vigra-1.9.0<br />
cmake .<br />
sudo checkinstall<br />
sudo ldconfig<br />
</pre><br />
<br />
The <code>''"sudo checkinstall"''</code> step will ask you a few questions (respond with the default answers), and then create and install a package which can later be removed with synaptic or dpkg -r. If you're not worried about being able to cleanly remove the VIGRA library at a later date, you can substitute <code>''"sudo make install"''</code>.<br />
<br />
If you also want to build the documentation, add the following dependencies, and add "-DDOC=ON" to the cmake command below. (Be warned, however, that this will drag in over 700MB of additional dependencies. Unless you have a pressing need to build the documentation yourself, you can save time and disk space by downloading the PDF docs from http://enblend.sourceforge.net .)<br />
<br />
<pre><br />
sudo apt-get install texi2html texinfo fig2ps tidy gnuplot libxml-xpath-perl imagemagick<br />
</pre><br />
<br />
Once all dependencies are in place, get the code. The official repository has migrated from CVS to Mercurial:<br />
<br />
<pre><br />
mkdir -p ~/src/enblend<br />
cd ~/src/enblend<br />
hg clone http://hg.code.sf.net/p/enblend/code enblend.hg<br />
</pre><br />
<br />
If you already have checked out enblend, to update the code to the latest version you need to run:<br />
<br />
<pre><br />
cd enblend.hg<br />
hg pull<br />
hg update<br />
cd ..<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the package.<br />
<br />
The options below are good for modern multi-core computers. For a single core, you may be better off setting ENABLE_OPENMP to OFF and ENABLE_IMAGECACHE to ON. The two options are mutually exclusive.<br />
<br />
<pre><br />
mkdir enblend.build<br />
cd enblend.build<br />
cmake ../enblend.hg -DENABLE_GPU:BOOL=ON -DENABLE_IMAGECACHE:BOOL=OFF -DENABLE_OPENMP:BOOL=ON \<br />
-DCPACK_BINARY_DEB:BOOL=ON -DCPACK_BINARY_NSIS:BOOL=OFF -DCPACK_BINARY_RPM:BOOL=OFF \<br />
-DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TBZ2:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF \<br />
-DCPACK_BINARY_TZ:BOOL=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=/usr/local<br />
make package<br />
sudo dpkg -i enblend*.deb<br />
</pre><br />
<br />
== Building Hugin ==<br />
<br />
=== Dependencies ===<br />
<br />
First we need to activate the <code>universe</code> repository (in the synaptic package manager, or by editing the /etc/apt/sources.lst file for example) and get the dependencies.<br />
<br />
The following command will install on your system all build time dependencies except libpano13.<br />
<br />
<pre><br />
sudo apt-get install libwxgtk2.8-dev libtiff4-dev libpng12-dev \<br />
libopenexr-dev libexiv2-dev freeglut3-dev libglew-dev libboost-dev \<br />
libboost-thread-dev libboost-regex-dev libboost-filesystem-dev \<br />
libboost-iostreams-dev libboost-system-dev libboost-signals-dev \<br />
gettext liblapack-dev libxi-dev libxmu-dev libtclap-dev liblensfun-dev<br />
</pre><br />
<br />
If you want to build hugin with python scripting functionality, you will also need a copy of the python development library and swig2.0. Unfortunately, the swig2.0 package is only included in Natty (11.04) or better. If you are on Lucid or Maverick, you can obtain a swig2.0 package by enabling the Hugin PPA:<br />
<br />
<pre><br />
sudo add-apt-repository ppa:hugin/hugin-builds<br />
sudo apt-get update<br />
</pre><br />
<br />
Then (for all versions from Lucid onwards) execute:<br />
<br />
<pre><br />
sudo apt-get install python-dev swig2.0<br />
</pre><br />
<br />
You could install libpano13 on your system with the command below. But it is recommended that you build your own libpano13 (see section [[Hugin_Compiling_Ubuntu#Building_Libpano13|above]]), since the version of libpano13 in the Ubuntu repositories is probably too old. Alternatively, there may be a recent enough version of libpano13 in the Hugin PPA. If going this last route, you can add it as shown above.<br />
<br />
<pre><br />
sudo apt-get install libpano13-dev<br />
</pre><br />
<br />
wxWidgets is a critical dependency for the Hugin GUI. In the official Ubuntu repositories it is usually at least a few releases behind the current release, and in some cases many releases behind. The wxWidgets project provides alternative [http://wiki.wxpython.org/InstallingOnUbuntuOrDebian repositories] with newer versions, as well as a [http://wiki.wxpython.org/BuildingDebianPackages instructions] to build binary packages of the most recent releases. Newer versions of wxWidgets are not (yet) absolutely necessary, but since eventually things evolve they are useful for development, testing, and in general should give a better user interface experience as wxWidgets improves over time.<br />
<br />
The following are run-time dependencies. Strictly speaking you don't need them to build Hugin, but you will need them to use it. If you follow the instructions on this page to build ExifTool and/or Enblend, you don't need to install them this way.<br />
<br />
<pre><br />
sudo apt-get install libimage-exiftool-perl enblend python-argparse<br />
</pre><br />
<br />
'''Note:''' If you use Python 2.7, there is no need to install "python-argparse" package. Because Python 2.7 has included "argparse" as its core module. Ubuntu 13.10 has Python 2.7 installed by default, so one will find that there is no "python-argparse" package in Ubuntu's repository. For Ubuntu 13.10, you can install run-time dependencies as:<br />
<pre><br />
sudo apt-get install libimage-exiftool-perl enblend<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Otherwise, you need to clone the repository and decide which version/branch to build with:<br />
<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hg.code.sf.net/p/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<br />
</pre><br />
<br />
If you are a contributor with write access, you can use<br />
<br />
<pre><br />
hg clone ssh://${USER}@hg.code.sf.net/p/hugin/hugin hugin.hg<br />
</pre><br />
<br />
The `hg branches` command will list all available branches. If you decide, e.g., to build the 2010.0 branch, you will update to it with:<br />
<br />
<pre><br />
hg update -C 2010.0 <br />
</pre><br />
<br />
=== Advanced Use - Multiple Source Trees ===<br />
<br />
You may want to build multiple versions of Hugin on your machine at the same time, e.g. when you want to build side by side a stable version for your productivity and a development version to give feedback to the developers. In that case, you will clone the Mercurial repository that is already on your drive and update from it a source tree to a different branch. Mercurial takes care of details such as optimizing disk usage. The commands for this are:<br />
<br />
<pre><br />
cd ..<br />
hg clone hugin.hg another_hugin<br />
cd another_hugin<br />
hg update -C default<br />
</pre><br />
<br />
You can have as many "another_hugin" folders as you want. Just make sure, when pulling the latest updates from SourceForge, to first pull your main repository (the one you cloned from http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin. Then pull all others:<br />
<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
cd ../another_hugin<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Reference: [http://groups.google.com/group/hugin-ptx/msg/1ce824dd1364e9be]<br />
<br />
=== Configure the Build Environment ===<br />
<br />
'''Rule:''' You always want to build outside of the source tree to keep the source tree clean. And to avoid confusion, if you have multiple source trees it is preferable to build for each of them in a separate build folder.<br />
<br />
Next we set up the build environment using cmake.<br />
<br />
If you compiled and installed libpano to a non standard location set the variables CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH to point to your install location's include and lib directories.<br />
<br />
If you are building for distribution, you want to set CMAKE_INSTALL_PREFIX=/usr<br />
<br />
<pre><br />
cd ~/src/hugin<br />
mkdir hugin.build<br />
cd hugin.build<br />
cmake ../hugin.hg -DENABLE_LAPACK=YES -DCPACK_BINARY_DEB:BOOL=ON -DCPACK_BINARY_NSIS:BOOL=OFF \<br />
-DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TBZ2:BOOL=OFF \<br />
-DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo \<br />
-DBUILD_HSI:BOOL=ON -DSWIG_EXECUTABLE=/usr/bin/swig2.0<br />
</pre><br />
<br />
The last line of the above cmake statement is for python scripting. The first switch activates the scripting interface (which is deactivated by default because it does not work simply out of the box on all supported platforms) and the second switch fixes a bug in the CMake script to find swig. Self-compiled swig does not need the -DSWIG_EXECUTABLE switch since it is found automatically by the CMake script.<br />
<br />
If you get an error building, try removing the last line of the above cmake statement. Another cause may be a wrong version of libpano13, even if you built it yourself. Go back and check that you are using a (newer) stable branch. Try switching to libpano13-2.9.18 (run hg update -C libpano13-2.9.18 in the proper folder), rebuild as instructed above, and try again.<br />
<br />
Set '''-DCMAKE_BUILD_TYPE=Debug''' if you want to help investigate/debug a problem and capture even more debugging information (for example, this will enable DEBUG_DEBUG(...) to output debug message), however Hugin will be slower and may not work as expected. Don't use a Debug build for production.<br />
<br />
Set '''-DREBUILD_TRANSLATIONS=ON''' if you want to rebuild translation each compile time.<br />
<br />
If you are building for install on your own machine only, -DDISABLE_DPKG=ON will significantly speed up the package generation. Do not distribute packages built this way, they don't have proper dependencies. This is primarily meant for developers doing cycles of fix-compile-install-test.<br />
<br />
=== Build and Install ===<br />
<br />
Finally, we use make to build the code and package it, and dpkg to install it.<br />
<br />
<pre><br />
make package<br />
sudo dpkg -i hugin-*-Linux.deb<br />
sudo ldconfig<br />
</pre><br />
<br />
'''Important:''' the package does not track dependencies yet, so it likely to fail on machines others than yours.<br />
<br />
Reference: [http://theseblog.free.fr/2007/10/building-hugin-in-ubuntu-feisty-fawn.php]<br />
<br />
=== Dive into the Code ===<br />
<br />
If you want to start to navigate, understand and modify the code, the doxygen generated documentation will be helpful to you.<br />
<br />
<pre><br />
sudo apt-get install doxygen graphviz<br />
cd ~/src/hugin/hugin.hg/src<br />
doxygen Doxyfile<br />
</pre><br />
<br />
Point your browser to ~/src/hugin/hugin.hg/src/hugin/html/index.html and you have access to all available information. If you find that a class, a function, or anything else is not properly documented; and if you delve into the source code to understand it, kindly add documentation to the code so that the next person in your situation can use your experience as a stepping stone. Thank you!<br />
<br />
== Automatic Control Point Detectors ==<br />
<br />
=== Autopano-sift-C ===<br />
<br />
Pre-Requisites:<br />
<pre><br />
sudo apt-get install libxml2-dev<br />
</pre><br />
<br />
To build<br />
<br />
(Note February 2011: The latest source code of autopano-sift-C has been unstable for a long time now and nobody is working to fix it. Use the 2.5.1 release tarball instead)<br />
<br />
<pre><br />
mkdir -p ~/src/apsc<br />
cd ~/src/apsc<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/autopano-sift-C apsc.hg<br />
cd apsc.hg<br />
hg branches<br />
hg update -C 2.5.1<br />
cd ..<br />
mkdir apsc.hg.build<br />
cd apsc.hg.build<br />
cmake ../apsc.hg -DCMAKE_INSTALL_PREFIX=/usr/local -DCPACK_BINARY_DEB:BOOL=ON \<br />
-DCPACK_BINARY_NSIS:BOOL=OFF -DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF \<br />
-DCPACK_BINARY_TBZ2:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF \<br />
-DCMAKE_BUILD_TYPE=Debug<br />
make package<br />
sudo dpkg -i autopano-sift-C-*-Linux.deb<br />
</pre><br />
<br />
=== Match-n-shift ===<br />
<br />
Match-n-shift is yet an other Autopano-SIFT replacement. It comes in a bundle with pto file manipulation perl libraries and a rich selection of other tools that use nona, enblend, ImageMagick among other things. To use match-n-shift, you need to install at least the [http://search.cpan.org/dist/Panotools-Script/ Panotools::Script] library and some other perl modules. It requires:<br />
<br />
* Image::Size 2.9<br />
* Storable 2.0<br />
* Image::ExifTool 6<br />
<br />
Chances are that you do not need to update Storable which is a standard perl module. To check the version of installed versions of these modules, write these lines to the command prompt:<br />
<br />
perl -MStorable -le 'print Storable->VERSION;'<br />
perl -MImage::Size -le 'print Image::Size->VERSION;'<br />
perl -MImage::ExifTool -le 'print Image::ExifTool->VERSION;'<br />
<br />
There are various ways to install or upgrade these modules. Ubuntu has binary packages for many perl modules, you can skip the CPAN installation below and type:<br />
<br />
sudo apt-get install libimage-size-perl libimage-exiftool-perl<br />
<br />
Alternatively, perl is an interpreted language and these modules are pure perl, so installing from source is an easy thing.<br />
<br />
The best place to install perl modules is directly from a CPAN archive. CPAN is short for Comprehensive Perl Archive Network. The program to interact with CPAN comes with all perl installations. Start it by running:<br />
<br />
sudo cpan<br />
<br />
If this is your first time running the program you will be asked a number of questions (you can safely accept the suggested values). Last question lets you select a number of CPAN mirrors nearest to you.<br />
<br />
When all is done, you can enter the install commands after the 'cpan>' prompt:<br />
<br />
install Image::Size Storable Image::ExifTool<br />
<br />
Answer 'y' to any question of dependencies and wait for install to complete. 'exit' leaves the cpan shell.<br />
<br />
Next, you need to retrieve and install the Panotools-Script collection<br />
of perl libraries (Panotools::Script) and programs that use them -<br />
including match-n-shift:<br />
<br />
hg clone http://hg.code.sf.net/p/panotools/Panotools-Script Panotools-Script<br />
cd Panotools-Script<br />
perl Makefile.PL<br />
make<br />
make test<br />
sudo make install<br />
<br />
Just to confuse you, you can also ignore everything above and just install Panotools::Script and all its dependencies from CPAN. From command line, type:<br />
<br />
sudo cpan Panotools::Script<br />
<br />
You can run match-n-shift from command line using the same parameters as autopano-c-complete.sh or you can modify hugin to run it for you:<br />
<br />
* start Hugin<br />
* navigate the menu File to Preferences<br />
* In the Preferences window, open the Autopano tab<br />
* Select Autopano -> Autopano-SIFT<br />
* tick the checkbox for Use alternative Autopano-SIFT program<br />
* enter the full path to match-n-shift (/usr/local/bin/match-n-shift) in the Autopano-SIFT field<br />
* enter the following string in the Arguments field:<br />
-f %f -v %v -c -p %p -o %o %i<br />
<br />
=== MatchPoint ===<br />
<br />
MatchPoint is a next generation CP generator. The result of a GSoC2007 project, it is still very experimental. Experience reports needed. Read more [http://groups.google.com/group/hugin-ptx/browse_thread/thread/cba2b2ce94dd9054 here]<br />
<br />
Matchpoint is now located inside the main hugin source tree, no need to checkout separately. It is compiled together with hugin, but not installed by default.<br />
<br />
* copy the MatchPoint executable into /usr/local/bin manually<br />
<pre><br />
cd ~/src/hugin/hugin.hg-build<br />
sudo cp src/matchpoint/matchpoint /usr/local/bin/<br />
</pre><br />
* edit /usr/local/bin/autopano-c-complete.sh (do it with sudo to have the necessary permission)<br />
** line 79: replace the .key.gz extension with .key (not sure if matchpoint supports compression)<br />
** lines 83 and 88: replace '''generatekeys "$arg" $FILENAME $SIZE''' with '''matchpoint "$arg" $FILENAME''' (not sure if the size option or any other options of the original generatekeys are applicable)<br />
<br />
=== Pan-o-matic ===<br />
<br />
Yet another control point generator [http://aorlinsk2.free.fr/panomatic/?p=home Home Page]<br />
<br />
<pre>sudo apt-get install libboost-dev</pre><br />
<br />
Download [http://aorlinsk2.free.fr/panomatic/download.php?d=7&v=0.9.4 Panomatic 0.9.4 bz2] and if you're on Ubuntu 9.10 or newer also the [http://aorlinsk2.free.fr/panomatic/panomatic_gcc44.patch patch] for the gcc4.4 compiler.<br />
<br />
<pre><br />
mkdir -p ~/src/panomatic<br />
cd ~/src/panomatic<br />
wget "http://aorlinsk2.free.fr/panomatic/download.php?d=7&v=0.9.4" -O panomatic-0.9.4-src.tar.bz2<br />
wget http://aorlinsk2.free.fr/panomatic/panomatic_gcc44.patch patch<br />
tar xvfj panomatic-0.9.4-src.tar.bz2<br />
cd panomatic-0.9.4<br />
patch -p 1 < ../panomatic_gcc44.patch<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
To use Pano-o-matic, open Hugin<br />
<br />
* In File > Preferences > Autopano :<br />
* Select Autopano-SIFT<br />
* Check "Use alternative autopano-SIFT program"<br />
* Choose the path to the binary ( /usr/local/bin )<br />
* In Arguments, put : -o %o %i<br />
<br />
==== Pablo's variation ====<br />
<br />
Around the end of the year 2009, Pablo integrated a [http://groups.google.com/group/hugin-ptx/browse_thread/thread/d9c0558c679cad52 new] experimental descriptor based on the geometric blur and DAISY papers. Also, Pablo said that the algorithm is not really based on a published approach, just on some ideas that are mentioned in a few of them, and its currently simpler than any of them:<br />
<br />
o geometric blur: [http://www.eecs.berkeley.edu/~aberg/gb.html]<br />
<br />
o daisy: [http://cvlab.epfl.ch/~tola/daisy.html]<br />
<br />
o descriptor learning: [http://cvlab.epfl.ch/~brown/learndesc/learndesc.html]<br />
<br />
To build that version of panomatic instead, follow these instructions:<br />
<br />
This is current the subject of a GSoC 2010 project and may be available in future versions of Hugin.<br />
<br />
<pre><br />
sudo aptitude install libboost-python-dev bzr cmake libvigraimpex-dev<br />
</pre><br />
<br />
<pre><br />
bzr branch lp:~pablo.dangelo/hugin/panomatic-lib<br />
mkdir build<br />
cd build<br />
cmake ../panomatic-lib<br />
make<br />
sudo make install<br />
</pre><br />
<br />
To use the new descriptor the arguments for Hugin are: '''--sieve1size 100 --sieve2size 2 -o %o %i'''<br />
<br />
== ExifTool ==<br />
<br />
ExifTool is no longer mandatory for Hugin to work. It is used to pass metadata from the input to the output images during the stitching process. <br />
<br />
[http://www.sno.phy.queensu.ca/~phil/exiftool/ ExifTool] is a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files.<br />
<br />
Usually the version distributed with Ubuntu (8.15 in Ubuntu 10.10; 7.89 in Ubuntu 10.4) is good enough and you don't need to bother with the following instructions. However there were situations in the past and there might be situations in the future where the latest versions offer better support. These issues will occur most likely with specific camera brands/models and the most recent models. The following instructions are for those cases.<br />
<br />
<pre><br />
sudo apt-get purge libimage-exiftool-perl<br />
</pre><br />
<br />
<pre><br />
wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-8.50.tar.gz<br />
tar -xzf Image-ExifTool-8.50.tar.gz<br />
cd Image-ExifTool-8.50<br />
perl Makefile.PL<br />
make test<br />
sudo make install<br />
</pre><br />
<br />
== Pano Viewers ==<br />
<br />
=== PanoGLView ===<br />
<br />
PanoGLView is an OpenGL hardware accelerated interactive immersive viewer for equirectangular images.<br />
<br />
Pre-Requisites:<br />
<pre>sudo apt-get install wx-common libwxgtk2.8-dev libglew-dev</pre><br />
<br />
To build and install:<br />
<pre><br />
mkdir -p ~/src/panoglview<br />
cd ~/src/panoglview<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/panoglview panoglview.hg<br />
cd panoglview.hg<br />
hg update<br />
./bootstrap<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
=== FreePV - DEPENDENCIES ARE BROKEN - FAILS TO BUILD ===<br />
<br />
Pre-Requisites:<br />
<pre><br />
sudo apt-get install cmake make pkg-config g++ mozilla-devscripts freeglut3-dev zlib1g-dev \<br />
libjpeg-dev libxext-dev libxmu-dev x11proto-xf86vidmode-dev libxxf86vm-dev libnspr4-dev \<br />
libxml2-dev libpng12-dev<br />
</pre><br />
To build<br />
<pre><br />
svn co https://freepv.svn.sourceforge.net/svnroot/freepv/freepv/trunk/ freepv<br />
cd freepv<br />
cmake .<br />
make<br />
sudo make install<br />
</pre><br />
<br />
=== Panini Perspective Tool ===<br />
<br />
Strictly speaking, Panini is more than just a viewer. It's a powerful tool to extract/transform views and can also be easily used as a viewer.<br />
<br />
Get dependencies:<br />
<pre><br />
sudo apt-get install qt4-qmake libqt4-dev zlib1g-dev<br />
</pre><br />
<br />
Get code:<br />
<pre><br />
mkdir -p ~/src/pvqt<br />
cd ~/src/pvqt<br />
svn co https://pvqt.svn.sourceforge.net/svnroot/pvqt pvqt.svn<br />
</pre><br />
<br />
Build:<br />
<pre><br />
cd pvqt.svn<br />
qmake panini.pro<br />
make<br />
</pre><br />
<br />
Install (brute force):<br />
<pre><br />
sudo cp Panini /usr/local/bin/ <br />
</pre><br />
<br />
Menu Entry for Kubuntu:<br />
<pre><br />
kmenuedit<br />
</pre><br />
<br />
in kmenuedit<br />
* navigate to Graphics<br />
** click on New Item<br />
** Enter "Panini" as Name<br />
** Enter "Perspective Tool" as Description<br />
** click on the empty icon and look for an icon (I used the akonadi one)<br />
** Enter "Panini" as Command<br />
** Click on Save button<br />
<br />
== Notes for Packagers ==<br />
<br />
=== Tarballs ===<br />
<br />
* to get an updated ChangeLog in Mercurial repositories (Hugin has it also in the cmake invocation, use '''-DUPDATE_CHANGELOG=1''')<br />
<pre><br />
hg log --follow --style=changelog <br />
</pre><br />
* to update the ChangeLog in SVN repositories (Panotools)<br />
<pre><br />
svn up<br />
svn2cl<br />
svn ci<br />
</pre><br />
<br />
=== Deb Packages ===<br />
<br />
The deb packages built by CMake (2.8.2) are broken by Debian standard. Please do not distribute them. There are official updated recent packages at the Hugin PPA mentioned above which include nightlies (produced every 24 hours) and stables (produced out of released tarballs). If you miss binaries for your series of Ubuntu and you have built them for yourself following the instructions above, considering moving up one level and contributing to the [[Hugin PPA]].<br />
<br />
[[Category:Software:Platform:Linux]]<br />
[[Category:Software:Hugin]]<br />
[[Category:Software:Hugin:Compiling]]</div>Ylzhaohttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=15576Hugin Compiling Ubuntu2013-11-10T12:14:27Z<p>Ylzhao: /* Configure the Build Environment */</p>
<hr />
<div>== Who Is This Page For ==<br />
<br />
These instructions contain the collective wisdom of Hugin contributors that are using Ubuntu or any of its variations (Ku/Xu/Lu/Edu/...buntu). They are work in progress and updated when newer versions of Ubuntu are released or when Hugin introduces new dependencies. They have worked, at the time of release or soon thereafter, with all 'buntu versions up until 12.04. They are intended to help contributors on the learning curve. If you are not here to contribute, spare yourself the effort and see the [[#Shortcut|Shortcut]] section below.<br />
<br />
They are likely to work only for the latest 'buntu release, but you can check this page's history at the time that the older 'buntu version was the most recent one to find the specifics for that version.<br />
<br />
If you are new here, read the whole page. It is recommended that you go sequentially through it.<br />
<br />
If you're familiar with the process and have run it a few times, look at the what's new section for important news.<br />
<br />
Apart from the odd change in package name, nothing should be substantially different (and if it does not work, please leave a comment on the [http://groups.google.com/group/hugin-ptx hugin-ptx mailing list]). Don't worry if the same package appears twice in an apt-get install line - apt-get will update existing packages if there is a newer version, and ignore duplicates if the latest version is already installed. On the other hand, if apt-get says that it can't find a package, it might be the odd change in package name. You can find a replacement package by using apt-cache search with a substring of the package required, e.g.:<br />
<br />
<pre><br />
apt-cache search wxW<br />
</pre><br />
<br />
The goal is to build hugin and the whole set of helper applications required, and start understanding the building process. You will need a deeper understanding of the building process if you want to:<br />
<br />
* develop code<br />
* translate the latest strings<br />
* document the latest features with manuals and tutorials<br />
* package for distribution<br />
<br />
That knowledge is beyond the scope of this document. This document ends with a binary that is fit for installation on your machine. It is not fit for any other purpose, particularly not for distribution. CMake is [http://groups.google.com/group/hugin-ptx/msg/3f29b207c562fd63 known] to build broken deb packages. Please do not distribute these binaries.<br />
<br />
== What's New ==<br />
<br />
'''25 January 2013''': The build instructions for the most recent versions of enblend, libpano13, and hugin have been updated for 'buntu 12.04LTS. A lot of information applying to previous releases has been deleted in an effort to make the page more readable. If you're building on an earlier release, be sure to click the "View History" tab above and check the build details around the time your 'buntu version was released.<br />
<br />
'''9 May 2011''': The integration of the python_scripting development branch brings new dependencies and a new build-time configuration switch for Hugin. See changes in the documentation below. swig2.0 is officially distributed only with Natty (11.04 onwards). If you have an older Ubuntu version you will either have to forego the python scripting feature or find an alternative swig2.0 (either a PPA or build it yourself).<br />
<br />
'''2 May 2011''': If you are using an earlier version of Ubuntu than 11.04, there is a chance that your Mercurial version is too old for grabbing updates. New (non-critical security) updates to a program do not get added to old versions of Ubuntu, so any new changes will need to be added manually. When running Mercurial (pull, update, etc), you may get an error like<br />
<br />
<pre><br />
abort: requirement 'dotencode' not supported!<br />
</pre><br />
<br />
To fix this, you can use the package archive from Mercurial PPA Packagers and get the latest release:<br />
<br />
<pre><br />
sudo apt-add-repository ppa:mercurial-ppa/releases<br />
sudo apt-get update<br />
sudo apt-get install mercurial<br />
</pre><br />
<br />
'''5 March 2010''': Foreign library libtclap removed from source tree. This introduces a new dependency on libtclap-dev<br />
<br />
'''February 2010''': Libpano has migrated from SVN to Mercurial.<br />
<br />
== Shortcut ==<br />
<br />
Hugin evolves fast and the official 'buntu distributions carry versions that are usually 3-6 months older than the 'buntu distribution date. Moreover, they do not backport Hugin and related tools.<br />
<br />
Even if you religiously follow the 'buntu six months update cycle, you may be using a version of Hugin that is one or two release cycles in our past. If your sole objective is to use the new features of Hugin, the instructions in this section are for you. Start a command line terminal, type the three commands and you're done.<br />
<br />
If for some reason that's not enough for you - if you want to actually learn and become a contributor; or if you're just curious about getting even closer to the bleeding edge and trade stability for features and excitement, the rest of this document is for you.<br />
<br />
=== Stable ===<br />
<br />
This will install the latest stable version of the tools:<br />
<pre><br />
sudo add-apt-repository ppa:hugin/hugin-builds<br />
sudo apt-get update<br />
sudo apt-get install hugin enblend panini<br />
</pre><br />
<br />
=== Unstable ===<br />
<br />
This will install the latest unstable version of the tools. While they are likely to work in most cases, there is no guarantee and they are not recommended for a production environment. Use at your own risk, and please report (and if possible fix) bugs. Most of the time these unstable builds are closer to the bleeding edge than to the stable builds. If you want the really really really bleeding edge, you'll have to work through the instructions in the next sections, though.<br />
<br />
<pre><br />
sudo add-apt-repository ppa:hugin/hugin-builds<br />
sudo add-apt-repository ppa:hugin/nightly<br />
sudo apt-get update<br />
sudo apt-get install hugin enblend panini<br />
</pre><br />
<br />
== Building Environment ==<br />
<br />
Since we are going to build hugin, libpano13 and enblend we need to download and install all the development packages. This is very easy with apt-get. In a terminal window (K menu -> System -> Konsole or Applications -> Accessories -> Terminal (in Kubuntu), Applications -> Accessories -> Terminal (in Ubuntu)), enter:<br />
<br />
<pre><br />
sudo apt-get install build-essential autoconf automake1.9 libtool flex bison gdb \<br />
libc6-dev libgcc1 cmake pkg-config help2man checkinstall<br />
</pre><br />
<br />
To get the bleeding edge we'll need access to the SVN and Mercurial repositories, and for this we need the correct tools:<br />
<br />
<pre><br />
sudo apt-get install subversion mercurial<br />
</pre><br />
<br />
Not necessary, but useful if you want to revisit configuration sets in ccmake:<br />
<br />
<pre><br />
sudo apt-get install cmake-curses-gui<br />
</pre><br />
<br />
To get on the same page as far as file system layout is concerned, we'll create a folder to contain all source code in your home folder:<br />
<br />
<pre><br />
cd<br />
mkdir -p src<br />
</pre><br />
<br />
=== For Distributors ===<br />
<br />
If you want to build packages for distribution, you will also need the following tools and settings.<br />
<br />
<pre><br />
sudo apt-get install subversion-tools<br />
sudo echo 'deb-src ftp://ftp.at.debian.org/debian ../project/experimental main' > /etc/apt/sources.list.d/debian-experimental.list<br />
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 55BE302B<br />
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B8D7663<br />
sudo apt-get update<br />
sudo apt-get install devscripts<br />
</pre><br />
<br />
You will also need an OpenPGP key, and a Launchpad account. Follow the [[Hugin_Trackers#Launchpad_Account|instructions]] for Launchpad account creation, including the signing of the Ubuntu Code of Conduct.<br />
<br />
Moreover, it is likely that your environment is not clean enough for distribution builds. In that case, and to produce binaries for other Ubuntu series than the one you are running, you will want to set up a dchroot environment (to be documented later on).<br />
<br />
== Building Libpano13 ==<br />
<br />
libpano13 is the new version of the PanoTools libraries. This is a necessary component for hugin, and we need to build it first. To build libpano13 we need some libraries and particularly their development ("dev") packages:<br />
<br />
<pre><br />
sudo apt-get install zlib1g-dev libpng12-dev libjpeg-dev libtiff-dev<br />
</pre><br />
<br />
We then need to download the source code from the central repository:<br />
<br />
<pre><br />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
hg clone http://hg.code.sf.net/p/panotools/libpano13 libpano.hg<br />
</pre><br />
<br />
If you're a contributor with write access, use the following clone command instead:<br />
<br />
<pre><br />
hg clone ssh://USERNAME@hg.code.sf.net/p/panotools/libpano13 libpano.hg<br />
</pre><br />
<br />
In the future there is no need to get the whole source again. Just issue the following commands to bring your source up to date:<br />
<br />
<pre><br />
cd libpano.hg<br />
hg pull<br />
hg up<br />
cd ..<br />
</pre><br />
<br />
Now start the building process. Set -DCMAKE_BUILD_TYPE=Debug if you want to help investigate/debug a problem and capture even more debugging information.<br />
<br />
<pre><br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano.hg -DCMAKE_INSTALL_PREFIX=/usr/local -DCPACK_BINARY_DEB:BOOL=ON \<br />
-DCPACK_BINARY_NSIS:BOOL=OFF -DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF \<br />
-DCPACK_BINARY_TBZ2:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF \<br />
-DCMAKE_BUILD_TYPE=RelWithDebInfo<br />
make package<br />
sudo dpkg -i libpano13-*-Linux.deb<br />
</pre><br />
<br />
=== The old autotools way ===<br />
<br />
The above described building process uses CMake to build libpano which has many advantages. Amongst others it creates a clean package to install / deinstall and decreases the likelihood of wrecking the system. However CMake support is relatively new in libpano. The old autotools way is documented below for completeness. You should not need it. However if you do, make sure to run either the CMake build or the autotools build on fresh repository checkouts to avoid interferences.<br />
<br />
<pre><br />
./bootstrap<br />
</pre><br />
<br />
If any libraries are missing, the script will complain (or at least, let you know that some library hasn't been found). In that case you probably need to install the library. To find in what package is that library, a general rule is to run the command <code>apt-cache search ''missingfile''</code>, find the relevant library and install both the library and the related <code>-dev</code> package.<br />
Run the <code>./configure</code> script and repeat this process until you have met all the dependencies.<br />
<br />
Then we are ready to launch the make process with<br />
<br />
<pre><br />
make<br />
</pre><br />
<br />
If the library successfully compiles, you have to install it with<br />
<br />
<pre><br />
sudo make install<br />
sudo ldconfig<br />
</pre><br />
<br />
The last part is for the OS to be aware of the new library (that has been installed in <code>/usr/local/lib</code>).<br />
<br />
== Building Enblend ==<br />
<br />
Get the dependencies. If you are working with large images (300 megapixels and up), you should have a libtiff-dev compiled with large file support and libstdc++6.<br />
<br />
<pre><br />
sudo apt-get install libtiff4-dev libopenexr-dev libboost-system-dev \<br />
libboost-filesystem-dev libboost-graph-dev libboost-thread-dev \<br />
freeglut3-dev libglew-dev libxi-dev libxmu-dev libplot-dev libgsl0-dev \<br />
liblcms2-dev<br />
</pre><br />
<br />
UPDATE: the latest package libvigraimpex-dev included in Linux Mint 15 (=Ubuntu 13.04) has the version 1.9.0-0ubuntu2 - and I did not encounter any problems with using this instead of compiling it myself:<br />
<pre><br />
sudo apt-get install libvigraimpex-dev<br />
</pre><br />
<br />
If you still want to compile it yourself, here's how:<br />
The most recent version of Enblend (4.2) also requires version 1.9 of the VIGRA computer vision library. Unfortunately, 'buntu versions up to and including the forthcoming 13.04 (Raring Ringtail) only provide version 1.8 of the VIGRA library, so you'll have to build your own, as follows:<br />
<br />
<pre><br />
cd ~/src<br />
wget http://hci.iwr.uni-heidelberg.de/vigra/vigra-1.9.0-src.tar.gz<br />
tar -zxvf vigra-1.9.0-src.tar.gz<br />
cd vigra-1.9.0<br />
cmake .<br />
sudo checkinstall<br />
sudo ldconfig<br />
</pre><br />
<br />
The <code>''"sudo checkinstall"''</code> step will ask you a few questions (respond with the default answers), and then create and install a package which can later be removed with synaptic or dpkg -r. If you're not worried about being able to cleanly remove the VIGRA library at a later date, you can substitute <code>''"sudo make install"''</code>.<br />
<br />
If you also want to build the documentation, add the following dependencies, and add "-DDOC=ON" to the cmake command below. (Be warned, however, that this will drag in over 700MB of additional dependencies. Unless you have a pressing need to build the documentation yourself, you can save time and disk space by downloading the PDF docs from http://enblend.sourceforge.net .)<br />
<br />
<pre><br />
sudo apt-get install texi2html texinfo fig2ps tidy gnuplot libxml-xpath-perl imagemagick<br />
</pre><br />
<br />
Once all dependencies are in place, get the code. The official repository has migrated from CVS to Mercurial:<br />
<br />
<pre><br />
mkdir -p ~/src/enblend<br />
cd ~/src/enblend<br />
hg clone http://hg.code.sf.net/p/enblend/code enblend.hg<br />
</pre><br />
<br />
If you already have checked out enblend, to update the code to the latest version you need to run:<br />
<br />
<pre><br />
cd enblend.hg<br />
hg pull<br />
hg update<br />
cd ..<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the package.<br />
<br />
The options below are good for modern multi-core computers. For a single core, you may be better off setting ENABLE_OPENMP to OFF and ENABLE_IMAGECACHE to ON. The two options are mutually exclusive.<br />
<br />
<pre><br />
mkdir enblend.build<br />
cd enblend.build<br />
cmake ../enblend.hg -DENABLE_GPU:BOOL=ON -DENABLE_IMAGECACHE:BOOL=OFF -DENABLE_OPENMP:BOOL=ON \<br />
-DCPACK_BINARY_DEB:BOOL=ON -DCPACK_BINARY_NSIS:BOOL=OFF -DCPACK_BINARY_RPM:BOOL=OFF \<br />
-DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TBZ2:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF \<br />
-DCPACK_BINARY_TZ:BOOL=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=/usr/local<br />
make package<br />
sudo dpkg -i enblend*.deb<br />
</pre><br />
<br />
== Building Hugin ==<br />
<br />
=== Dependencies ===<br />
<br />
First we need to activate the <code>universe</code> repository (in the synaptic package manager, or by editing the /etc/apt/sources.lst file for example) and get the dependencies.<br />
<br />
The following command will install on your system all build time dependencies except libpano13.<br />
<br />
<pre><br />
sudo apt-get install libwxgtk2.8-dev libtiff4-dev libpng12-dev \<br />
libopenexr-dev libexiv2-dev freeglut3-dev libglew-dev libboost-dev \<br />
libboost-thread-dev libboost-regex-dev libboost-filesystem-dev \<br />
libboost-iostreams-dev libboost-system-dev libboost-signals-dev \<br />
gettext liblapack-dev libxi-dev libxmu-dev libtclap-dev liblensfun-dev<br />
</pre><br />
<br />
If you want to build hugin with python scripting functionality, you will also need a copy of the python development library and swig2.0. Unfortunately, the swig2.0 package is only included in Natty (11.04) or better. If you are on Lucid or Maverick, you can obtain a swig2.0 package by enabling the Hugin PPA:<br />
<br />
<pre><br />
sudo add-apt-repository ppa:hugin/hugin-builds<br />
sudo apt-get update<br />
</pre><br />
<br />
Then (for all versions from Lucid onwards) execute:<br />
<br />
<pre><br />
sudo apt-get install python-dev swig2.0<br />
</pre><br />
<br />
You could install libpano13 on your system with the command below. But it is recommended that you build your own libpano13 (see section [[Hugin_Compiling_Ubuntu#Building_Libpano13|above]]), since the version of libpano13 in the Ubuntu repositories is probably too old. Alternatively, there may be a recent enough version of libpano13 in the Hugin PPA. If going this last route, you can add it as shown above.<br />
<br />
<pre><br />
sudo apt-get install libpano13-dev<br />
</pre><br />
<br />
wxWidgets is a critical dependency for the Hugin GUI. In the official Ubuntu repositories it is usually at least a few releases behind the current release, and in some cases many releases behind. The wxWidgets project provides alternative [http://wiki.wxpython.org/InstallingOnUbuntuOrDebian repositories] with newer versions, as well as a [http://wiki.wxpython.org/BuildingDebianPackages instructions] to build binary packages of the most recent releases. Newer versions of wxWidgets are not (yet) absolutely necessary, but since eventually things evolve they are useful for development, testing, and in general should give a better user interface experience as wxWidgets improves over time.<br />
<br />
The following are run-time dependencies. Strictly speaking you don't need them to build Hugin, but you will need them to use it. If you follow the instructions on this page to build ExifTool and/or Enblend, you don't need to install them this way.<br />
<br />
<pre><br />
sudo apt-get install libimage-exiftool-perl enblend python-argparse<br />
</pre><br />
<br />
'''Note:''' If you use Python 2.7, there is no need to install "python-argparse" package. Because Python 2.7 has included "argparse" as its core module. Ubuntu 13.10 has Python 2.7 installed by default, so one will find that there is no "python-argparse" package in Ubuntu's repository. For Ubuntu 13.10, you can install run-time dependencies as:<br />
<pre><br />
sudo apt-get install libimage-exiftool-perl enblend<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Otherwise, you need to clone the repository and decide which version/branch to build with:<br />
<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hg.code.sf.net/p/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<br />
</pre><br />
<br />
If you are a contributor with write access, you can use<br />
<br />
<pre><br />
hg clone ssh://${USER}@hg.code.sf.net/p/hugin/hugin hugin.hg<br />
</pre><br />
<br />
The `hg branches` command will list all available branches. If you decide, e.g., to build the 2010.0 branch, you will update to it with:<br />
<br />
<pre><br />
hg update -C 2010.0 <br />
</pre><br />
<br />
=== Advanced Use - Multiple Source Trees ===<br />
<br />
You may want to build multiple versions of Hugin on your machine at the same time, e.g. when you want to build side by side a stable version for your productivity and a development version to give feedback to the developers. In that case, you will clone the Mercurial repository that is already on your drive and update from it a source tree to a different branch. Mercurial takes care of details such as optimizing disk usage. The commands for this are:<br />
<br />
<pre><br />
cd ..<br />
hg clone hugin.hg another_hugin<br />
cd another_hugin<br />
hg update -C default<br />
</pre><br />
<br />
You can have as many "another_hugin" folders as you want. Just make sure, when pulling the latest updates from SourceForge, to first pull your main repository (the one you cloned from http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin. Then pull all others:<br />
<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
cd ../another_hugin<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Reference: [http://groups.google.com/group/hugin-ptx/msg/1ce824dd1364e9be]<br />
<br />
=== Configure the Build Environment ===<br />
<br />
'''Rule:''' You always want to build outside of the source tree to keep the source tree clean. And to avoid confusion, if you have multiple source trees it is preferable to build for each of them in a separate build folder.<br />
<br />
Next we set up the build environment using cmake.<br />
<br />
If you compiled and installed libpano to a non standard location set the variables CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH to point to your install location's include and lib directories.<br />
<br />
If you are building for distribution, you want to set CMAKE_INSTALL_PREFIX=/usr<br />
<br />
<pre><br />
cd ~/src/hugin<br />
mkdir hugin.build<br />
cd hugin.build<br />
cmake ../hugin.hg -DENABLE_LAPACK=YES -DCPACK_BINARY_DEB:BOOL=ON -DCPACK_BINARY_NSIS:BOOL=OFF \<br />
-DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TBZ2:BOOL=OFF \<br />
-DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo \<br />
-DBUILD_HSI:BOOL=ON -DSWIG_EXECUTABLE=/usr/bin/swig2.0<br />
</pre><br />
<br />
The last line of the above cmake statement is for python scripting. The first switch activates the scripting interface (which is deactivated by default because it does not work simply out of the box on all supported platforms) and the second switch fixes a bug in the CMake script to find swig. Self-compiled swig does not need the -DSWIG_EXECUTABLE switch since it is found automatically by the CMake script.<br />
<br />
If you get an error building, try removing the last line of the above cmake statement. Another cause may be a wrong version of libpano13, even if you built it yourself. Go back and check that you are using a (newer) stable branch. Try switching to libpano13-2.9.18 (run hg update -C libpano13-2.9.18 in the proper folder), rebuild as instructed above, and try again.<br />
<br />
Set '''-DCMAKE_BUILD_TYPE=Debug''' if you want to help investigate/debug a problem and capture even more debugging information (for example, this will enable DEBUG_DEBUG(...) to output debug message), however Hugin will be slower and may not work as expected. Don't use a Debug build for production.<br />
<br />
If you are building for install on your own machine only, -DDISABLE_DPKG=ON will significantly speed up the package generation. Do not distribute packages built this way, they don't have proper dependencies. This is primarily meant for developers doing cycles of fix-compile-install-test.<br />
<br />
=== Build and Install ===<br />
<br />
Finally, we use make to build the code and package it, and dpkg to install it.<br />
<br />
<pre><br />
make package<br />
sudo dpkg -i hugin-*-Linux.deb<br />
sudo ldconfig<br />
</pre><br />
<br />
'''Important:''' the package does not track dependencies yet, so it likely to fail on machines others than yours.<br />
<br />
Reference: [http://theseblog.free.fr/2007/10/building-hugin-in-ubuntu-feisty-fawn.php]<br />
<br />
=== Dive into the Code ===<br />
<br />
If you want to start to navigate, understand and modify the code, the doxygen generated documentation will be helpful to you.<br />
<br />
<pre><br />
sudo apt-get install doxygen graphviz<br />
cd ~/src/hugin/hugin.hg/src<br />
doxygen Doxyfile<br />
</pre><br />
<br />
Point your browser to ~/src/hugin/hugin.hg/src/hugin/html/index.html and you have access to all available information. If you find that a class, a function, or anything else is not properly documented; and if you delve into the source code to understand it, kindly add documentation to the code so that the next person in your situation can use your experience as a stepping stone. Thank you!<br />
<br />
== Automatic Control Point Detectors ==<br />
<br />
=== Autopano-sift-C ===<br />
<br />
Pre-Requisites:<br />
<pre><br />
sudo apt-get install libxml2-dev<br />
</pre><br />
<br />
To build<br />
<br />
(Note February 2011: The latest source code of autopano-sift-C has been unstable for a long time now and nobody is working to fix it. Use the 2.5.1 release tarball instead)<br />
<br />
<pre><br />
mkdir -p ~/src/apsc<br />
cd ~/src/apsc<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/autopano-sift-C apsc.hg<br />
cd apsc.hg<br />
hg branches<br />
hg update -C 2.5.1<br />
cd ..<br />
mkdir apsc.hg.build<br />
cd apsc.hg.build<br />
cmake ../apsc.hg -DCMAKE_INSTALL_PREFIX=/usr/local -DCPACK_BINARY_DEB:BOOL=ON \<br />
-DCPACK_BINARY_NSIS:BOOL=OFF -DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF \<br />
-DCPACK_BINARY_TBZ2:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF \<br />
-DCMAKE_BUILD_TYPE=Debug<br />
make package<br />
sudo dpkg -i autopano-sift-C-*-Linux.deb<br />
</pre><br />
<br />
=== Match-n-shift ===<br />
<br />
Match-n-shift is yet an other Autopano-SIFT replacement. It comes in a bundle with pto file manipulation perl libraries and a rich selection of other tools that use nona, enblend, ImageMagick among other things. To use match-n-shift, you need to install at least the [http://search.cpan.org/dist/Panotools-Script/ Panotools::Script] library and some other perl modules. It requires:<br />
<br />
* Image::Size 2.9<br />
* Storable 2.0<br />
* Image::ExifTool 6<br />
<br />
Chances are that you do not need to update Storable which is a standard perl module. To check the version of installed versions of these modules, write these lines to the command prompt:<br />
<br />
perl -MStorable -le 'print Storable->VERSION;'<br />
perl -MImage::Size -le 'print Image::Size->VERSION;'<br />
perl -MImage::ExifTool -le 'print Image::ExifTool->VERSION;'<br />
<br />
There are various ways to install or upgrade these modules. Ubuntu has binary packages for many perl modules, you can skip the CPAN installation below and type:<br />
<br />
sudo apt-get install libimage-size-perl libimage-exiftool-perl<br />
<br />
Alternatively, perl is an interpreted language and these modules are pure perl, so installing from source is an easy thing.<br />
<br />
The best place to install perl modules is directly from a CPAN archive. CPAN is short for Comprehensive Perl Archive Network. The program to interact with CPAN comes with all perl installations. Start it by running:<br />
<br />
sudo cpan<br />
<br />
If this is your first time running the program you will be asked a number of questions (you can safely accept the suggested values). Last question lets you select a number of CPAN mirrors nearest to you.<br />
<br />
When all is done, you can enter the install commands after the 'cpan>' prompt:<br />
<br />
install Image::Size Storable Image::ExifTool<br />
<br />
Answer 'y' to any question of dependencies and wait for install to complete. 'exit' leaves the cpan shell.<br />
<br />
Next, you need to retrieve and install the Panotools-Script collection<br />
of perl libraries (Panotools::Script) and programs that use them -<br />
including match-n-shift:<br />
<br />
hg clone http://hg.code.sf.net/p/panotools/Panotools-Script Panotools-Script<br />
cd Panotools-Script<br />
perl Makefile.PL<br />
make<br />
make test<br />
sudo make install<br />
<br />
Just to confuse you, you can also ignore everything above and just install Panotools::Script and all its dependencies from CPAN. From command line, type:<br />
<br />
sudo cpan Panotools::Script<br />
<br />
You can run match-n-shift from command line using the same parameters as autopano-c-complete.sh or you can modify hugin to run it for you:<br />
<br />
* start Hugin<br />
* navigate the menu File to Preferences<br />
* In the Preferences window, open the Autopano tab<br />
* Select Autopano -> Autopano-SIFT<br />
* tick the checkbox for Use alternative Autopano-SIFT program<br />
* enter the full path to match-n-shift (/usr/local/bin/match-n-shift) in the Autopano-SIFT field<br />
* enter the following string in the Arguments field:<br />
-f %f -v %v -c -p %p -o %o %i<br />
<br />
=== MatchPoint ===<br />
<br />
MatchPoint is a next generation CP generator. The result of a GSoC2007 project, it is still very experimental. Experience reports needed. Read more [http://groups.google.com/group/hugin-ptx/browse_thread/thread/cba2b2ce94dd9054 here]<br />
<br />
Matchpoint is now located inside the main hugin source tree, no need to checkout separately. It is compiled together with hugin, but not installed by default.<br />
<br />
* copy the MatchPoint executable into /usr/local/bin manually<br />
<pre><br />
cd ~/src/hugin/hugin.hg-build<br />
sudo cp src/matchpoint/matchpoint /usr/local/bin/<br />
</pre><br />
* edit /usr/local/bin/autopano-c-complete.sh (do it with sudo to have the necessary permission)<br />
** line 79: replace the .key.gz extension with .key (not sure if matchpoint supports compression)<br />
** lines 83 and 88: replace '''generatekeys "$arg" $FILENAME $SIZE''' with '''matchpoint "$arg" $FILENAME''' (not sure if the size option or any other options of the original generatekeys are applicable)<br />
<br />
=== Pan-o-matic ===<br />
<br />
Yet another control point generator [http://aorlinsk2.free.fr/panomatic/?p=home Home Page]<br />
<br />
<pre>sudo apt-get install libboost-dev</pre><br />
<br />
Download [http://aorlinsk2.free.fr/panomatic/download.php?d=7&v=0.9.4 Panomatic 0.9.4 bz2] and if you're on Ubuntu 9.10 or newer also the [http://aorlinsk2.free.fr/panomatic/panomatic_gcc44.patch patch] for the gcc4.4 compiler.<br />
<br />
<pre><br />
mkdir -p ~/src/panomatic<br />
cd ~/src/panomatic<br />
wget "http://aorlinsk2.free.fr/panomatic/download.php?d=7&v=0.9.4" -O panomatic-0.9.4-src.tar.bz2<br />
wget http://aorlinsk2.free.fr/panomatic/panomatic_gcc44.patch patch<br />
tar xvfj panomatic-0.9.4-src.tar.bz2<br />
cd panomatic-0.9.4<br />
patch -p 1 < ../panomatic_gcc44.patch<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
To use Pano-o-matic, open Hugin<br />
<br />
* In File > Preferences > Autopano :<br />
* Select Autopano-SIFT<br />
* Check "Use alternative autopano-SIFT program"<br />
* Choose the path to the binary ( /usr/local/bin )<br />
* In Arguments, put : -o %o %i<br />
<br />
==== Pablo's variation ====<br />
<br />
Around the end of the year 2009, Pablo integrated a [http://groups.google.com/group/hugin-ptx/browse_thread/thread/d9c0558c679cad52 new] experimental descriptor based on the geometric blur and DAISY papers. Also, Pablo said that the algorithm is not really based on a published approach, just on some ideas that are mentioned in a few of them, and its currently simpler than any of them:<br />
<br />
o geometric blur: [http://www.eecs.berkeley.edu/~aberg/gb.html]<br />
<br />
o daisy: [http://cvlab.epfl.ch/~tola/daisy.html]<br />
<br />
o descriptor learning: [http://cvlab.epfl.ch/~brown/learndesc/learndesc.html]<br />
<br />
To build that version of panomatic instead, follow these instructions:<br />
<br />
This is current the subject of a GSoC 2010 project and may be available in future versions of Hugin.<br />
<br />
<pre><br />
sudo aptitude install libboost-python-dev bzr cmake libvigraimpex-dev<br />
</pre><br />
<br />
<pre><br />
bzr branch lp:~pablo.dangelo/hugin/panomatic-lib<br />
mkdir build<br />
cd build<br />
cmake ../panomatic-lib<br />
make<br />
sudo make install<br />
</pre><br />
<br />
To use the new descriptor the arguments for Hugin are: '''--sieve1size 100 --sieve2size 2 -o %o %i'''<br />
<br />
== ExifTool ==<br />
<br />
ExifTool is no longer mandatory for Hugin to work. It is used to pass metadata from the input to the output images during the stitching process. <br />
<br />
[http://www.sno.phy.queensu.ca/~phil/exiftool/ ExifTool] is a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files.<br />
<br />
Usually the version distributed with Ubuntu (8.15 in Ubuntu 10.10; 7.89 in Ubuntu 10.4) is good enough and you don't need to bother with the following instructions. However there were situations in the past and there might be situations in the future where the latest versions offer better support. These issues will occur most likely with specific camera brands/models and the most recent models. The following instructions are for those cases.<br />
<br />
<pre><br />
sudo apt-get purge libimage-exiftool-perl<br />
</pre><br />
<br />
<pre><br />
wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-8.50.tar.gz<br />
tar -xzf Image-ExifTool-8.50.tar.gz<br />
cd Image-ExifTool-8.50<br />
perl Makefile.PL<br />
make test<br />
sudo make install<br />
</pre><br />
<br />
== Pano Viewers ==<br />
<br />
=== PanoGLView ===<br />
<br />
PanoGLView is an OpenGL hardware accelerated interactive immersive viewer for equirectangular images.<br />
<br />
Pre-Requisites:<br />
<pre>sudo apt-get install wx-common libwxgtk2.8-dev libglew-dev</pre><br />
<br />
To build and install:<br />
<pre><br />
mkdir -p ~/src/panoglview<br />
cd ~/src/panoglview<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/panoglview panoglview.hg<br />
cd panoglview.hg<br />
hg update<br />
./bootstrap<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
=== FreePV - DEPENDENCIES ARE BROKEN - FAILS TO BUILD ===<br />
<br />
Pre-Requisites:<br />
<pre><br />
sudo apt-get install cmake make pkg-config g++ mozilla-devscripts freeglut3-dev zlib1g-dev \<br />
libjpeg-dev libxext-dev libxmu-dev x11proto-xf86vidmode-dev libxxf86vm-dev libnspr4-dev \<br />
libxml2-dev libpng12-dev<br />
</pre><br />
To build<br />
<pre><br />
svn co https://freepv.svn.sourceforge.net/svnroot/freepv/freepv/trunk/ freepv<br />
cd freepv<br />
cmake .<br />
make<br />
sudo make install<br />
</pre><br />
<br />
=== Panini Perspective Tool ===<br />
<br />
Strictly speaking, Panini is more than just a viewer. It's a powerful tool to extract/transform views and can also be easily used as a viewer.<br />
<br />
Get dependencies:<br />
<pre><br />
sudo apt-get install qt4-qmake libqt4-dev zlib1g-dev<br />
</pre><br />
<br />
Get code:<br />
<pre><br />
mkdir -p ~/src/pvqt<br />
cd ~/src/pvqt<br />
svn co https://pvqt.svn.sourceforge.net/svnroot/pvqt pvqt.svn<br />
</pre><br />
<br />
Build:<br />
<pre><br />
cd pvqt.svn<br />
qmake panini.pro<br />
make<br />
</pre><br />
<br />
Install (brute force):<br />
<pre><br />
sudo cp Panini /usr/local/bin/ <br />
</pre><br />
<br />
Menu Entry for Kubuntu:<br />
<pre><br />
kmenuedit<br />
</pre><br />
<br />
in kmenuedit<br />
* navigate to Graphics<br />
** click on New Item<br />
** Enter "Panini" as Name<br />
** Enter "Perspective Tool" as Description<br />
** click on the empty icon and look for an icon (I used the akonadi one)<br />
** Enter "Panini" as Command<br />
** Click on Save button<br />
<br />
== Notes for Packagers ==<br />
<br />
=== Tarballs ===<br />
<br />
* to get an updated ChangeLog in Mercurial repositories (Hugin has it also in the cmake invocation, use '''-DUPDATE_CHANGELOG=1''')<br />
<pre><br />
hg log --follow --style=changelog <br />
</pre><br />
* to update the ChangeLog in SVN repositories (Panotools)<br />
<pre><br />
svn up<br />
svn2cl<br />
svn ci<br />
</pre><br />
<br />
=== Deb Packages ===<br />
<br />
The deb packages built by CMake (2.8.2) are broken by Debian standard. Please do not distribute them. There are official updated recent packages at the Hugin PPA mentioned above which include nightlies (produced every 24 hours) and stables (produced out of released tarballs). If you miss binaries for your series of Ubuntu and you have built them for yourself following the instructions above, considering moving up one level and contributing to the [[Hugin PPA]].<br />
<br />
[[Category:Software:Platform:Linux]]<br />
[[Category:Software:Hugin]]<br />
[[Category:Software:Hugin:Compiling]]</div>Ylzhaohttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=15557Hugin Compiling Ubuntu2013-10-20T08:04:18Z<p>Ylzhao: /* Dependencies */</p>
<hr />
<div>== Who Is This Page For ==<br />
<br />
These instructions contain the collective wisdom of Hugin contributors that are using Ubuntu or any of its variations (Ku/Xu/Lu/Edu/...buntu). They are work in progress and updated when newer versions of Ubuntu are released or when Hugin introduces new dependencies. They have worked, at the time of release or soon thereafter, with all 'buntu versions up until 12.04. They are intended to help contributors on the learning curve. If you are not here to contribute, spare yourself the effort and see the [[#Shortcut|Shortcut]] section below.<br />
<br />
They are likely to work only for the latest 'buntu release, but you can check this page's history at the time that the older 'buntu version was the most recent one to find the specifics for that version.<br />
<br />
If you are new here, read the whole page. It is recommended that you go sequentially through it.<br />
<br />
If you're familiar with the process and have run it a few times, look at the what's new section for important news.<br />
<br />
Apart from the odd change in package name, nothing should be substantially different (and if it does not work, please leave a comment on the [http://groups.google.com/group/hugin-ptx hugin-ptx mailing list]). Don't worry if the same package appears twice in an apt-get install line - apt-get will update existing packages if there is a newer version, and ignore duplicates if the latest version is already installed. On the other hand, if apt-get says that it can't find a package, it might be the odd change in package name. You can find a replacement package by using apt-cache search with a substring of the package required, e.g.:<br />
<br />
<pre><br />
apt-cache search wxW<br />
</pre><br />
<br />
The goal is to build hugin and the whole set of helper applications required, and start understanding the building process. You will need a deeper understanding of the building process if you want to:<br />
<br />
* develop code<br />
* translate the latest strings<br />
* document the latest features with manuals and tutorials<br />
* package for distribution<br />
<br />
That knowledge is beyond the scope of this document. This document ends with a binary that is fit for installation on your machine. It is not fit for any other purpose, particularly not for distribution. CMake is [http://groups.google.com/group/hugin-ptx/msg/3f29b207c562fd63 known] to build broken deb packages. Please do not distribute these binaries.<br />
<br />
== What's New ==<br />
<br />
'''25 January 2013''': The build instructions for the most recent versions of enblend, libpano13, and hugin have been updated for 'buntu 12.04LTS. A lot of information applying to previous releases has been deleted in an effort to make the page more readable. If you're building on an earlier release, be sure to click the "View History" tab above and check the build details around the time your 'buntu version was released.<br />
<br />
'''9 May 2011''': The integration of the python_scripting development branch brings new dependencies and a new build-time configuration switch for Hugin. See changes in the documentation below. swig2.0 is officially distributed only with Natty (11.04 onwards). If you have an older Ubuntu version you will either have to forego the python scripting feature or find an alternative swig2.0 (either a PPA or build it yourself).<br />
<br />
'''2 May 2011''': If you are using an earlier version of Ubuntu than 11.04, there is a chance that your Mercurial version is too old for grabbing updates. New (non-critical security) updates to a program do not get added to old versions of Ubuntu, so any new changes will need to be added manually. When running Mercurial (pull, update, etc), you may get an error like<br />
<br />
<pre><br />
abort: requirement 'dotencode' not supported!<br />
</pre><br />
<br />
To fix this, you can use the package archive from Mercurial PPA Packagers and get the latest release:<br />
<br />
<pre><br />
sudo apt-add-repository ppa:mercurial-ppa/releases<br />
sudo apt-get update<br />
sudo apt-get install mercurial<br />
</pre><br />
<br />
'''5 March 2010''': Foreign library libtclap removed from source tree. This introduces a new dependency on libtclap-dev<br />
<br />
'''February 2010''': Libpano has migrated from SVN to Mercurial.<br />
<br />
== Shortcut ==<br />
<br />
Hugin evolves fast and the official 'buntu distributions carry versions that are usually 3-6 months older than the 'buntu distribution date. Moreover, they do not backport Hugin and related tools.<br />
<br />
Even if you religiously follow the 'buntu six months update cycle, you may be using a version of Hugin that is one or two release cycles in our past. If your sole objective is to use the new features of Hugin, the instructions in this section are for you. Start a command line terminal, type the three commands and you're done.<br />
<br />
If for some reason that's not enough for you - if you want to actually learn and become a contributor; or if you're just curious about getting even closer to the bleeding edge and trade stability for features and excitement, the rest of this document is for you.<br />
<br />
=== Stable ===<br />
<br />
This will install the latest stable version of the tools:<br />
<pre><br />
sudo add-apt-repository ppa:hugin/hugin-builds<br />
sudo apt-get update<br />
sudo apt-get install hugin enblend panini<br />
</pre><br />
<br />
=== Unstable ===<br />
<br />
This will install the latest unstable version of the tools. While they are likely to work in most cases, there is no guarantee and they are not recommended for a production environment. Use at your own risk, and please report (and if possible fix) bugs. Most of the time these unstable builds are closer to the bleeding edge than to the stable builds. If you want the really really really bleeding edge, you'll have to work through the instructions in the next sections, though.<br />
<br />
<pre><br />
sudo add-apt-repository ppa:hugin/hugin-builds<br />
sudo add-apt-repository ppa:hugin/nightly<br />
sudo apt-get update<br />
sudo apt-get install hugin enblend panini<br />
</pre><br />
<br />
== Building Environment ==<br />
<br />
Since we are going to build hugin, libpano13 and enblend we need to download and install all the development packages. This is very easy with apt-get. In a terminal window (K menu -> System -> Konsole or Applications -> Accessories -> Terminal (in Kubuntu), Applications -> Accessories -> Terminal (in Ubuntu)), enter:<br />
<br />
<pre><br />
sudo apt-get install build-essential autoconf automake1.9 libtool flex bison gdb \<br />
libc6-dev libgcc1 cmake pkg-config help2man checkinstall<br />
</pre><br />
<br />
To get the bleeding edge we'll need access to the SVN and Mercurial repositories, and for this we need the correct tools:<br />
<br />
<pre><br />
sudo apt-get install subversion mercurial<br />
</pre><br />
<br />
Not necessary, but useful if you want to revisit configuration sets in ccmake:<br />
<br />
<pre><br />
sudo apt-get install cmake-curses-gui<br />
</pre><br />
<br />
To get on the same page as far as file system layout is concerned, we'll create a folder to contain all source code in your home folder:<br />
<br />
<pre><br />
cd<br />
mkdir -p src<br />
</pre><br />
<br />
=== For Distributors ===<br />
<br />
If you want to build packages for distribution, you will also need the following tools and settings.<br />
<br />
<pre><br />
sudo apt-get install subversion-tools<br />
sudo echo 'deb-src ftp://ftp.at.debian.org/debian ../project/experimental main' > /etc/apt/sources.list.d/debian-experimental.list<br />
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 55BE302B<br />
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B8D7663<br />
sudo apt-get update<br />
sudo apt-get install devscripts<br />
</pre><br />
<br />
You will also need an OpenPGP key, and a Launchpad account. Follow the [[Hugin_Trackers#Launchpad_Account|instructions]] for Launchpad account creation, including the signing of the Ubuntu Code of Conduct.<br />
<br />
Moreover, it is likely that your environment is not clean enough for distribution builds. In that case, and to produce binaries for other Ubuntu series than the one you are running, you will want to set up a dchroot environment (to be documented later on).<br />
<br />
== Building Libpano13 ==<br />
<br />
libpano13 is the new version of the PanoTools libraries. This is a necessary component for hugin, and we need to build it first. To build libpano13 we need some libraries and particularly their development ("dev") packages:<br />
<br />
<pre><br />
sudo apt-get install zlib1g-dev libpng12-dev libjpeg-dev libtiff-dev<br />
</pre><br />
<br />
We then need to download the source code from the central repository:<br />
<br />
<pre><br />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
hg clone http://hg.code.sf.net/p/panotools/libpano13 libpano.hg<br />
</pre><br />
<br />
If you're a contributor with write access, use the following clone command instead:<br />
<br />
<pre><br />
hg clone ssh://USERNAME@hg.code.sf.net/p/panotools/libpano13 libpano.hg<br />
</pre><br />
<br />
In the future there is no need to get the whole source again. Just issue the following commands to bring your source up to date:<br />
<br />
<pre><br />
cd libpano.hg<br />
hg pull<br />
hg up<br />
cd ..<br />
</pre><br />
<br />
Now start the building process. Set -DCMAKE_BUILD_TYPE=Debug if you want to help investigate/debug a problem and capture even more debugging information.<br />
<br />
<pre><br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano.hg -DCMAKE_INSTALL_PREFIX=/usr/local -DCPACK_BINARY_DEB:BOOL=ON \<br />
-DCPACK_BINARY_NSIS:BOOL=OFF -DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF \<br />
-DCPACK_BINARY_TBZ2:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF \<br />
-DCMAKE_BUILD_TYPE=RelWithDebInfo<br />
make package<br />
sudo dpkg -i libpano13-*-Linux.deb<br />
</pre><br />
<br />
=== The old autotools way ===<br />
<br />
The above described building process uses CMake to build libpano which has many advantages. Amongst others it creates a clean package to install / deinstall and decreases the likelihood of wrecking the system. However CMake support is relatively new in libpano. The old autotools way is documented below for completeness. You should not need it. However if you do, make sure to run either the CMake build or the autotools build on fresh repository checkouts to avoid interferences.<br />
<br />
<pre><br />
./bootstrap<br />
</pre><br />
<br />
If any libraries are missing, the script will complain (or at least, let you know that some library hasn't been found). In that case you probably need to install the library. To find in what package is that library, a general rule is to run the command <code>apt-cache search ''missingfile''</code>, find the relevant library and install both the library and the related <code>-dev</code> package.<br />
Run the <code>./configure</code> script and repeat this process until you have met all the dependencies.<br />
<br />
Then we are ready to launch the make process with<br />
<br />
<pre><br />
make<br />
</pre><br />
<br />
If the library successfully compiles, you have to install it with<br />
<br />
<pre><br />
sudo make install<br />
sudo ldconfig<br />
</pre><br />
<br />
The last part is for the OS to be aware of the new library (that has been installed in <code>/usr/local/lib</code>).<br />
<br />
== Building Enblend ==<br />
<br />
Get the dependencies. If you are working with large images (300 megapixels and up), you should have a libtiff-dev compiled with large file support and libstdc++6.<br />
<br />
<pre><br />
sudo apt-get install libtiff4-dev libopenexr-dev libboost-system-dev \<br />
libboost-filesystem-dev libboost-graph-dev libboost-thread-dev \<br />
freeglut3-dev libglew-dev libxi-dev libxmu-dev libplot-dev libgsl0-dev \<br />
liblcms2-dev<br />
</pre><br />
<br />
The most recent version of Enblend (4.2) also requires version 1.9 of the VIGRA computer vision library. Unfortunately, 'buntu versions up to and including the forthcoming 13.04 (Raring Ringtail) only provide version 1.8 of the VIGRA library, so you'll have to build your own, as follows:<br />
<br />
<pre><br />
cd ~/src<br />
wget http://hci.iwr.uni-heidelberg.de/vigra/vigra-1.9.0-src.tar.gz<br />
tar -zxvf vigra-1.9.0-src.tar.gz<br />
cd vigra-1.9.0<br />
cmake .<br />
sudo checkinstall<br />
sudo ldconfig<br />
</pre><br />
<br />
The <code>''"sudo checkinstall"''</code> step will ask you a few questions (respond with the default answers), and then create and install a package which can later be removed with synaptic or dpkg -r. If you're not worried about being able to cleanly remove the VIGRA library at a later date, you can substitute <code>''"sudo make install"''</code>.<br />
<br />
If you also want to build the documentation, add the following dependencies, and add "-DDOC=ON" to the cmake command below. (Be warned, however, that this will drag in over 700MB of additional dependencies. Unless you have a pressing need to build the documentation yourself, you can save time and disk space by downloading the PDF docs from http://enblend.sourceforge.net .)<br />
<br />
<pre><br />
sudo apt-get install texi2html texinfo fig2ps tidy gnuplot libxml-xpath-perl imagemagick<br />
</pre><br />
<br />
Once all dependencies are in place, get the code. The official repository has migrated from CVS to Mercurial:<br />
<br />
<pre><br />
mkdir -p ~/src/enblend<br />
cd ~/src/enblend<br />
hg clone http://hg.code.sf.net/p/enblend/code enblend.hg<br />
</pre><br />
<br />
If you already have checked out enblend, to update the code to the latest version you need to run:<br />
<br />
<pre><br />
cd enblend.hg<br />
hg pull<br />
hg update<br />
cd ..<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the package.<br />
<br />
The options below are good for modern multi-core computers. For a single core, you may be better off setting ENABLE_OPENMP to OFF and ENABLE_IMAGECACHE to ON. The two options are mutually exclusive.<br />
<br />
<pre><br />
mkdir enblend.build<br />
cd enblend.build<br />
cmake ../enblend.hg -DENABLE_GPU:BOOL=ON -DENABLE_IMAGECACHE:BOOL=OFF -DENABLE_OPENMP:BOOL=ON \<br />
-DCPACK_BINARY_DEB:BOOL=ON -DCPACK_BINARY_NSIS:BOOL=OFF -DCPACK_BINARY_RPM:BOOL=OFF \<br />
-DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TBZ2:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF \<br />
-DCPACK_BINARY_TZ:BOOL=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=/usr/local<br />
make package<br />
sudo dpkg -i enblend*.deb<br />
</pre><br />
<br />
== Building Hugin ==<br />
<br />
=== Dependencies ===<br />
<br />
First we need to activate the <code>universe</code> repository (in the synaptic package manager, or by editing the /etc/apt/sources.lst file for example) and get the dependencies.<br />
<br />
The following command will install on your system all build time dependencies except libpano13.<br />
<br />
<pre><br />
sudo apt-get install libwxgtk2.8-dev libtiff4-dev libpng12-dev \<br />
libopenexr-dev libexiv2-dev freeglut3-dev libglew-dev libboost-dev \<br />
libboost-thread-dev libboost-regex-dev libboost-filesystem-dev \<br />
libboost-iostreams-dev libboost-system-dev libboost-signals-dev \<br />
gettext liblapack-dev libxi-dev libxmu-dev libtclap-dev liblensfun-dev<br />
</pre><br />
<br />
If you want to build hugin with python scripting functionality, you will also need a copy of the python development library and swig2.0. Unfortunately, the swig2.0 package is only included in Natty (11.04) or better. If you are on Lucid or Maverick, you can obtain a swig2.0 package by enabling the Hugin PPA:<br />
<br />
<pre><br />
sudo add-apt-repository ppa:hugin/hugin-builds<br />
sudo apt-get update<br />
</pre><br />
<br />
Then (for all versions from Lucid onwards) execute:<br />
<br />
<pre><br />
sudo apt-get install python-dev swig2.0<br />
</pre><br />
<br />
You could install libpano13 on your system with the command below. But it is recommended that you build your own libpano13 (see section [[Hugin_Compiling_Ubuntu#Building_Libpano13|above]]), since the version of libpano13 in the Ubuntu repositories is probably too old. Alternatively, there may be a recent enough version of libpano13 in the Hugin PPA. If going this last route, you can add it as shown above.<br />
<br />
<pre><br />
sudo apt-get install libpano13-dev<br />
</pre><br />
<br />
wxWidgets is a critical dependency for the Hugin GUI. In the official Ubuntu repositories it is usually at least a few releases behind the current release, and in some cases many releases behind. The wxWidgets project provides alternative [http://wiki.wxpython.org/InstallingOnUbuntuOrDebian repositories] with newer versions, as well as a [http://wiki.wxpython.org/BuildingDebianPackages instructions] to build binary packages of the most recent releases. Newer versions of wxWidgets are not (yet) absolutely necessary, but since eventually things evolve they are useful for development, testing, and in general should give a better user interface experience as wxWidgets improves over time.<br />
<br />
The following are run-time dependencies. Strictly speaking you don't need them to build Hugin, but you will need them to use it. If you follow the instructions on this page to build ExifTool and/or Enblend, you don't need to install them this way.<br />
<br />
<pre><br />
sudo apt-get install libimage-exiftool-perl enblend python-argparse<br />
</pre><br />
<br />
'''Note:''' If you use Python 2.7, there is no need to install "python-argparse" package. Because Python 2.7 has included "argparse" as its core module. Ubuntu 13.10 has Python 2.7 installed by default, so one will find that there is no "python-argparse" package in Ubuntu's repository. For Ubuntu 13.10, you can install run-time dependencies as:<br />
<pre><br />
sudo apt-get install libimage-exiftool-perl enblend<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Otherwise, you need to clone the repository and decide which version/branch to build with:<br />
<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hg.code.sf.net/p/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<br />
</pre><br />
<br />
If you are a contributor with write access, you can use<br />
<br />
<pre><br />
hg clone ssh://${USER}@hg.code.sf.net/p/hugin/hugin hugin.hg<br />
</pre><br />
<br />
The `hg branches` command will list all available branches. If you decide, e.g., to build the 2010.0 branch, you will update to it with:<br />
<br />
<pre><br />
hg update -C 2010.0 <br />
</pre><br />
<br />
=== Advanced Use - Multiple Source Trees ===<br />
<br />
You may want to build multiple versions of Hugin on your machine at the same time, e.g. when you want to build side by side a stable version for your productivity and a development version to give feedback to the developers. In that case, you will clone the Mercurial repository that is already on your drive and update from it a source tree to a different branch. Mercurial takes care of details such as optimizing disk usage. The commands for this are:<br />
<br />
<pre><br />
cd ..<br />
hg clone hugin.hg another_hugin<br />
cd another_hugin<br />
hg update -C default<br />
</pre><br />
<br />
You can have as many "another_hugin" folders as you want. Just make sure, when pulling the latest updates from SourceForge, to first pull your main repository (the one you cloned from http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin. Then pull all others:<br />
<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
cd ../another_hugin<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Reference: [http://groups.google.com/group/hugin-ptx/msg/1ce824dd1364e9be]<br />
<br />
=== Configure the Build Environment ===<br />
<br />
'''Rule:''' You always want to build outside of the source tree to keep the source tree clean. And to avoid confusion, if you have multiple source trees it is preferable to build for each of them in a separate build folder.<br />
<br />
Next we set up the build environment using cmake.<br />
<br />
If you compiled and installed libpano to a non standard location set the variables CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH to point to your install location's include and lib directories.<br />
<br />
If you are building for distribution, you want to set CMAKE_INSTALL_PREFIX=/usr<br />
<br />
<pre><br />
cd ~/src/hugin<br />
mkdir hugin.build<br />
cd hugin.build<br />
cmake ../hugin.hg -DENABLE_LAPACK=YES -DCPACK_BINARY_DEB:BOOL=ON -DCPACK_BINARY_NSIS:BOOL=OFF \<br />
-DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TBZ2:BOOL=OFF \<br />
-DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo \<br />
-DBUILD_HSI:BOOL=ON -DSWIG_EXECUTABLE=/usr/bin/swig2.0<br />
</pre><br />
<br />
The last line of the above cmake statement is for python scripting. The first switch activates the scripting interface (which is deactivated by default because it does not work simply out of the box on all supported platforms) and the second switch fixes a bug in the CMake script to find swig. Self-compiled swig does not need the -DSWIG_EXECUTABLE switch since it is found automatically by the CMake script.<br />
<br />
If you get an error building, try removing the last line of the above cmake statement. Another cause may be a wrong version of libpano13, even if you built it yourself. Go back and check that you are using a (newer) stable branch. Try switching to libpano13-2.9.18 (run hg update -C libpano13-2.9.18 in the proper folder), rebuild as instructed above, and try again.<br />
<br />
Set -DCMAKE_BUILD_TYPE=Debug if you want to help investigate/debug a problem and capture even more debugging information, however Hugin will be slower and may not work as expected. Don't use a Debug build for production.<br />
<br />
If you are building for install on your own machine only, -DDISABLE_DPKG=ON will significantly speed up the package generation. Do not distribute packages built this way, they don't have proper dependencies. This is primarily meant for developers doing cycles of fix-compile-install-test.<br />
<br />
=== Build and Install ===<br />
<br />
Finally, we use make to build the code and package it, and dpkg to install it.<br />
<br />
<pre><br />
make package<br />
sudo dpkg -i hugin-*-Linux.deb<br />
sudo ldconfig<br />
</pre><br />
<br />
'''Important:''' the package does not track dependencies yet, so it likely to fail on machines others than yours.<br />
<br />
Reference: [http://theseblog.free.fr/2007/10/building-hugin-in-ubuntu-feisty-fawn.php]<br />
<br />
=== Dive into the Code ===<br />
<br />
If you want to start to navigate, understand and modify the code, the doxygen generated documentation will be helpful to you.<br />
<br />
<pre><br />
sudo apt-get install doxygen graphviz<br />
cd ~/src/hugin/hugin.hg/src<br />
doxygen Doxyfile<br />
</pre><br />
<br />
Point your browser to ~/src/hugin/hugin.hg/src/hugin/html/index.html and you have access to all available information. If you find that a class, a function, or anything else is not properly documented; and if you delve into the source code to understand it, kindly add documentation to the code so that the next person in your situation can use your experience as a stepping stone. Thank you!<br />
<br />
== Automatic Control Point Detectors ==<br />
<br />
=== Autopano-sift-C ===<br />
<br />
Pre-Requisites:<br />
<pre><br />
sudo apt-get install libxml2-dev<br />
</pre><br />
<br />
To build<br />
<br />
(Note February 2011: The latest source code of autopano-sift-C has been unstable for a long time now and nobody is working to fix it. Use the 2.5.1 release tarball instead)<br />
<br />
<pre><br />
mkdir -p ~/src/apsc<br />
cd ~/src/apsc<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/autopano-sift-C apsc.hg<br />
cd apsc.hg<br />
hg branches<br />
hg update -C 2.5.1<br />
cd ..<br />
mkdir apsc.hg.build<br />
cd apsc.hg.build<br />
cmake ../apsc.hg -DCMAKE_INSTALL_PREFIX=/usr/local -DCPACK_BINARY_DEB:BOOL=ON \<br />
-DCPACK_BINARY_NSIS:BOOL=OFF -DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF \<br />
-DCPACK_BINARY_TBZ2:BOOL=OFF -DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF \<br />
-DCMAKE_BUILD_TYPE=Debug<br />
make package<br />
sudo dpkg -i autopano-sift-C-*-Linux.deb<br />
</pre><br />
<br />
=== Match-n-shift ===<br />
<br />
Match-n-shift is yet an other Autopano-SIFT replacement. It comes in a bundle with pto file manipulation perl libraries and a rich selection of other tools that use nona, enblend, ImageMagick among other things. To use match-n-shift, you need to install at least the [http://search.cpan.org/dist/Panotools-Script/ Panotools::Script] library and some other perl modules. It requires:<br />
<br />
* Image::Size 2.9<br />
* Storable 2.0<br />
* Image::ExifTool 6<br />
<br />
Chances are that you do not need to update Storable which is a standard perl module. To check the version of installed versions of these modules, write these lines to the command prompt:<br />
<br />
perl -MStorable -le 'print Storable->VERSION;'<br />
perl -MImage::Size -le 'print Image::Size->VERSION;'<br />
perl -MImage::ExifTool -le 'print Image::ExifTool->VERSION;'<br />
<br />
There are various ways to install or upgrade these modules. Ubuntu has binary packages for many perl modules, you can skip the CPAN installation below and type:<br />
<br />
sudo apt-get install libimage-size-perl libimage-exiftool-perl<br />
<br />
Alternatively, perl is an interpreted language and these modules are pure perl, so installing from source is an easy thing.<br />
<br />
The best place to install perl modules is directly from a CPAN archive. CPAN is short for Comprehensive Perl Archive Network. The program to interact with CPAN comes with all perl installations. Start it by running:<br />
<br />
sudo cpan<br />
<br />
If this is your first time running the program you will be asked a number of questions (you can safely accept the suggested values). Last question lets you select a number of CPAN mirrors nearest to you.<br />
<br />
When all is done, you can enter the install commands after the 'cpan>' prompt:<br />
<br />
install Image::Size Storable Image::ExifTool<br />
<br />
Answer 'y' to any question of dependencies and wait for install to complete. 'exit' leaves the cpan shell.<br />
<br />
Next, you need to retrieve and install the Panotools-Script collection<br />
of perl libraries (Panotools::Script) and programs that use them -<br />
including match-n-shift:<br />
<br />
hg clone http://hg.code.sf.net/p/panotools/Panotools-Script Panotools-Script<br />
cd Panotools-Script<br />
perl Makefile.PL<br />
make<br />
make test<br />
sudo make install<br />
<br />
Just to confuse you, you can also ignore everything above and just install Panotools::Script and all its dependencies from CPAN. From command line, type:<br />
<br />
sudo cpan Panotools::Script<br />
<br />
You can run match-n-shift from command line using the same parameters as autopano-c-complete.sh or you can modify hugin to run it for you:<br />
<br />
* start Hugin<br />
* navigate the menu File to Preferences<br />
* In the Preferences window, open the Autopano tab<br />
* Select Autopano -> Autopano-SIFT<br />
* tick the checkbox for Use alternative Autopano-SIFT program<br />
* enter the full path to match-n-shift (/usr/local/bin/match-n-shift) in the Autopano-SIFT field<br />
* enter the following string in the Arguments field:<br />
-f %f -v %v -c -p %p -o %o %i<br />
<br />
=== MatchPoint ===<br />
<br />
MatchPoint is a next generation CP generator. The result of a GSoC2007 project, it is still very experimental. Experience reports needed. Read more [http://groups.google.com/group/hugin-ptx/browse_thread/thread/cba2b2ce94dd9054 here]<br />
<br />
Matchpoint is now located inside the main hugin source tree, no need to checkout separately. It is compiled together with hugin, but not installed by default.<br />
<br />
* copy the MatchPoint executable into /usr/local/bin manually<br />
<pre><br />
cd ~/src/hugin/hugin.hg-build<br />
sudo cp src/matchpoint/matchpoint /usr/local/bin/<br />
</pre><br />
* edit /usr/local/bin/autopano-c-complete.sh (do it with sudo to have the necessary permission)<br />
** line 79: replace the .key.gz extension with .key (not sure if matchpoint supports compression)<br />
** lines 83 and 88: replace '''generatekeys "$arg" $FILENAME $SIZE''' with '''matchpoint "$arg" $FILENAME''' (not sure if the size option or any other options of the original generatekeys are applicable)<br />
<br />
=== Pan-o-matic ===<br />
<br />
Yet another control point generator [http://aorlinsk2.free.fr/panomatic/?p=home Home Page]<br />
<br />
<pre>sudo apt-get install libboost-dev</pre><br />
<br />
Download [http://aorlinsk2.free.fr/panomatic/download.php?d=7&v=0.9.4 Panomatic 0.9.4 bz2] and if you're on Ubuntu 9.10 or newer also the [http://aorlinsk2.free.fr/panomatic/panomatic_gcc44.patch patch] for the gcc4.4 compiler.<br />
<br />
<pre><br />
mkdir -p ~/src/panomatic<br />
cd ~/src/panomatic<br />
wget "http://aorlinsk2.free.fr/panomatic/download.php?d=7&v=0.9.4" -O panomatic-0.9.4-src.tar.bz2<br />
wget http://aorlinsk2.free.fr/panomatic/panomatic_gcc44.patch patch<br />
tar xvfj panomatic-0.9.4-src.tar.bz2<br />
cd panomatic-0.9.4<br />
patch -p 1 < ../panomatic_gcc44.patch<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
To use Pano-o-matic, open Hugin<br />
<br />
* In File > Preferences > Autopano :<br />
* Select Autopano-SIFT<br />
* Check "Use alternative autopano-SIFT program"<br />
* Choose the path to the binary ( /usr/local/bin )<br />
* In Arguments, put : -o %o %i<br />
<br />
==== Pablo's variation ====<br />
<br />
Around the end of the year 2009, Pablo integrated a [http://groups.google.com/group/hugin-ptx/browse_thread/thread/d9c0558c679cad52 new] experimental descriptor based on the geometric blur and DAISY papers. Also, Pablo said that the algorithm is not really based on a published approach, just on some ideas that are mentioned in a few of them, and its currently simpler than any of them:<br />
<br />
o geometric blur: [http://www.eecs.berkeley.edu/~aberg/gb.html]<br />
<br />
o daisy: [http://cvlab.epfl.ch/~tola/daisy.html]<br />
<br />
o descriptor learning: [http://cvlab.epfl.ch/~brown/learndesc/learndesc.html]<br />
<br />
To build that version of panomatic instead, follow these instructions:<br />
<br />
This is current the subject of a GSoC 2010 project and may be available in future versions of Hugin.<br />
<br />
<pre><br />
sudo aptitude install libboost-python-dev bzr cmake libvigraimpex-dev<br />
</pre><br />
<br />
<pre><br />
bzr branch lp:~pablo.dangelo/hugin/panomatic-lib<br />
mkdir build<br />
cd build<br />
cmake ../panomatic-lib<br />
make<br />
sudo make install<br />
</pre><br />
<br />
To use the new descriptor the arguments for Hugin are: '''--sieve1size 100 --sieve2size 2 -o %o %i'''<br />
<br />
== ExifTool ==<br />
<br />
ExifTool is no longer mandatory for Hugin to work. It is used to pass metadata from the input to the output images during the stitching process. <br />
<br />
[http://www.sno.phy.queensu.ca/~phil/exiftool/ ExifTool] is a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files.<br />
<br />
Usually the version distributed with Ubuntu (8.15 in Ubuntu 10.10; 7.89 in Ubuntu 10.4) is good enough and you don't need to bother with the following instructions. However there were situations in the past and there might be situations in the future where the latest versions offer better support. These issues will occur most likely with specific camera brands/models and the most recent models. The following instructions are for those cases.<br />
<br />
<pre><br />
sudo apt-get purge libimage-exiftool-perl<br />
</pre><br />
<br />
<pre><br />
wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-8.50.tar.gz<br />
tar -xzf Image-ExifTool-8.50.tar.gz<br />
cd Image-ExifTool-8.50<br />
perl Makefile.PL<br />
make test<br />
sudo make install<br />
</pre><br />
<br />
== Pano Viewers ==<br />
<br />
=== PanoGLView ===<br />
<br />
PanoGLView is an OpenGL hardware accelerated interactive immersive viewer for equirectangular images.<br />
<br />
Pre-Requisites:<br />
<pre>sudo apt-get install wx-common libwxgtk2.8-dev libglew-dev</pre><br />
<br />
To build and install:<br />
<pre><br />
mkdir -p ~/src/panoglview<br />
cd ~/src/panoglview<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/panoglview panoglview.hg<br />
cd panoglview.hg<br />
hg update<br />
./bootstrap<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
=== FreePV - DEPENDENCIES ARE BROKEN - FAILS TO BUILD ===<br />
<br />
Pre-Requisites:<br />
<pre><br />
sudo apt-get install cmake make pkg-config g++ mozilla-devscripts freeglut3-dev zlib1g-dev \<br />
libjpeg-dev libxext-dev libxmu-dev x11proto-xf86vidmode-dev libxxf86vm-dev libnspr4-dev \<br />
libxml2-dev libpng12-dev<br />
</pre><br />
To build<br />
<pre><br />
svn co https://freepv.svn.sourceforge.net/svnroot/freepv/freepv/trunk/ freepv<br />
cd freepv<br />
cmake .<br />
make<br />
sudo make install<br />
</pre><br />
<br />
=== Panini Perspective Tool ===<br />
<br />
Strictly speaking, Panini is more than just a viewer. It's a powerful tool to extract/transform views and can also be easily used as a viewer.<br />
<br />
Get dependencies:<br />
<pre><br />
sudo apt-get install qt4-qmake libqt4-dev zlib1g-dev<br />
</pre><br />
<br />
Get code:<br />
<pre><br />
mkdir -p ~/src/pvqt<br />
cd ~/src/pvqt<br />
svn co https://pvqt.svn.sourceforge.net/svnroot/pvqt pvqt.svn<br />
</pre><br />
<br />
Build:<br />
<pre><br />
cd pvqt.svn<br />
qmake panini.pro<br />
make<br />
</pre><br />
<br />
Install (brute force):<br />
<pre><br />
sudo cp Panini /usr/local/bin/ <br />
</pre><br />
<br />
Menu Entry for Kubuntu:<br />
<pre><br />
kmenuedit<br />
</pre><br />
<br />
in kmenuedit<br />
* navigate to Graphics<br />
** click on New Item<br />
** Enter "Panini" as Name<br />
** Enter "Perspective Tool" as Description<br />
** click on the empty icon and look for an icon (I used the akonadi one)<br />
** Enter "Panini" as Command<br />
** Click on Save button<br />
<br />
== Notes for Packagers ==<br />
<br />
=== Tarballs ===<br />
<br />
* to get an updated ChangeLog in Mercurial repositories (Hugin has it also in the cmake invocation, use '''-DUPDATE_CHANGELOG=1''')<br />
<pre><br />
hg log --follow --style=changelog <br />
</pre><br />
* to update the ChangeLog in SVN repositories (Panotools)<br />
<pre><br />
svn up<br />
svn2cl<br />
svn ci<br />
</pre><br />
<br />
=== Deb Packages ===<br />
<br />
The deb packages built by CMake (2.8.2) are broken by Debian standard. Please do not distribute them. There are official updated recent packages at the Hugin PPA mentioned above which include nightlies (produced every 24 hours) and stables (produced out of released tarballs). If you miss binaries for your series of Ubuntu and you have built them for yourself following the instructions above, considering moving up one level and contributing to the [[Hugin PPA]].<br />
<br />
[[Category:Software:Platform:Linux]]<br />
[[Category:Software:Hugin]]<br />
[[Category:Software:Hugin:Compiling]]</div>Ylzhaohttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12206Hugin Compiling Ubuntu2010-03-08T07:38:39Z<p>Ylzhao: /* Pablo's variation */</p>
<hr />
<div>These instructions are work in progress and updated when newer versions of Ubuntu are released or when Hugin introduces new dependencies. They have worked, at the time of release or soon thereafter, with the following Ubuntu/Kubuntu versions:<br />
* Ubuntu 9.10: on AMD64 computer<br />
* Ubuntu 9.04: on AMD64 computer<br />
* Ubuntu 8.10: on AMD64 computer<br />
* Ubuntu 8.04: on an Intel processor<br />
* Ubuntu 7.10: on AMD Athlon XP<br />
* Ubuntu 7.04: on AMD64 computer<br />
* Ubuntu 6.06: on AMD64 computer<br />
<br />
They are likely to work only for the latest one, but you can check this page's history at the time that the older Ubuntu version was the most recent one to find the specifics for that version.<br />
<br />
Apart from the odd change in package name, nothing should be substantially different (and if does not work, please leave a comment on the [http://groups.google.com/group/hugin-ptx hugin-ptx mailing list]). Don't worry if the same package appears twice in an apt-get install line - apt-get will update existing packages if there is a newer version, and ignore duplicates if the latest version is already installed. On the other hand, if apt-get says that it can't find a package, it might be the odd change in package name. You can find a replacement package by using apt-cache search with a substring of the package required, e.g.<br />
<pre>apt-cache search wxW<br />
</pre><br />
<br />
The goal is to build hugin and the whole set of helper applications required.<br />
<br />
== Building environment ==<br />
Since we are going to build hugin, libpano13 and enblend we need to download and install all the development packages. This is very easy with apt-get.<br />
In a terminal window (K menu -> System -> Konsole or Applications -> Accessories -> Terminal (in Kubuntu), Applications -> Accessories -> Terminal (in Ubuntu))<br />
<br />
<pre>sudo apt-get install build-essential autoconf automake1.9 libtool flex bison gdb<br />
</pre><br />
<br />
Unless you have an amd64 system prior to 7.10, add the following packages.<br />
<pre>sudo apt-get install libc6-dev libgcc1<br />
</pre><br />
<br />
For older amd64 environments, the packages have a slightly different name:<br />
<pre>sudo apt-get install libc6-dev-amd64 lib64gcc1<br />
</pre><br />
<br />
To get the bleeding edge we'll need access to the SVN and Mercurial repositories, and for this we need the correct tools:<br />
<br />
<pre><br />
sudo apt-get install subversion mercurial<br />
</pre><br />
<br />
Not necessary, but useful if you want to move to the next level and build packages for distribution (list is incomplete):<br />
<br />
<pre><br />
sudo apt-get install subversion-tools<br />
</pre><br />
<br />
== Building Enblend ==<br />
<br />
Get the dependencies. If you are working with large images (300 megapixels and up), you should have a libtiff-devel compiled with large file support and libstdc++6.<br />
<br />
<pre>sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev libxi-dev libxmu-dev \<br />
help2man texi2html texinfo fig2ps tidy gnuplot libxml-xpath-perl<br />
</pre><br />
<br />
For Ubuntu systems prior to 8.10, you will also need<br />
<br />
<pre>sudo apt-get install libopenexr2ldbl<br />
</pre><br />
<br />
Once all dependencies are in place, get the code. The official repository has migrated from CVS to Mercurial:<br />
<br />
<pre><br />
hg clone http://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend<br />
cd enblend<br />
</pre><br />
<br />
If you already have checked out enblend, to update the code to the latest version you need to run:<br />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
We are then ready to compile. The CXXFLAGS <tt>--param inline-unit-growth=60</tt> is a workaround for x86_64 systems, Feb 2009, and apparently no longer needed (set by default). If you have an SMP machine and you're building a recent version, <tt>--disable-image-cache</tt> and <tt>--enable-openmp</tt> will speed up enblend/enfuse massively but may cause segmentation faults; in that case you will be better off with <tt>--enable-image-cache</tt> and <tt>--disable-openmp.</tt> <tt>-march=native</tt> is also beneficial and -O2 is better than -O3.<br />
<br />
<pre><br />
make --makefile=Makefile.scm<br />
mkdir BUILD<br />
cd BUILD<br />
CXXFLAGS="--param inline-unit-growth=60 -march=native -O2" ../configure --disable-image-cache --enable-openmp<br />
make<br />
</pre><br />
<br />
The second make step can be very long and memory consuming. Make sure you have enough swap space, and go get a healthy snack while the computer is compiling.<br />
<br />
If you encounter problems at any of these stages, please report back to the hugin-ptx mailing list. Report what command in the sequence you were executing, what machine/operating system, the revision checked out from CVS, and all other relevant information.<br />
<br />
You are then ready to install with<br />
<pre><br />
sudo make install<br />
</pre><br />
<br />
== Building Libpano13 ==<br />
<br />
libpano13 is the new version of the PanoTools libraries. This is a necessary component for hugin, and we need to build it first.<br />
To build libpano13 we need some libraries and particularly their <code>dev</code> package:<br />
<br />
<pre>sudo apt-get install zlib1g zlib1g-dev libpng12-dev libjpeg62-dev libtiff4-dev cmake</pre><br />
<br />
On older distributions, zlib1g and zlib1g-dev may not be found. In that case, the same library may be available with the names lib64z1 and lib64z1-dev.<br />
<br />
We then need to download the source code from SVN:<br />
<br />
<pre><br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13<br />
cd libpano13<br />
</pre><br />
<br />
In the future there is no need to get the whole source again. Just issue the following commands to bring your source up to date:<br />
<pre><br />
cd libpano13<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir build.libpano<br />
cd build.libpano<br />
cmake ../libpano13 -DCMAKE_INSTALL_PREFIX=/usr/local -DCPACK_BINARY_DEB:BOOL=ON -DCPACK_BINARY_NSIS:BOOL=OFF \<br />
-DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TBZ2:BOOL=OFF \<br />
-DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF<br />
make package<br />
sudo dpkg -i libpano13-*-Linux.deb<br />
</pre><br />
<br />
=== autotools ===<br />
<br />
The above described building process uses CMake to build libpano which has many advantages. Amongst others it creates a clean package to install / deinstall and decreases the likelihood of wrecking the system. However CMake support is relatively new in libpano. The old autotools way is documented below for completness. You should not need it. However if you do, make sure to run either the CMake build or the autotools build on fresh SVN checkouts to avoid interferences.<br />
<br />
<pre><br />
./bootstrap<br />
</pre><br />
<br />
If any libraries are missing, the script will complain (or at least, let you know that some library hasn't been found). In that case you probably need to install the library. To find in what package is that library, a general rule is to run the command <code>apt-cache search ''missingfile''</code>, find the relevant library and install both the library and the related <code>-dev</code> package.<br />
Run the <code>./configure</code> script and repeat this process until you have met all the dependencies.<br />
<br />
Then we are ready to launch the make process with<br />
<pre>make</pre><br />
<br />
If the library successfully compiles, you have to install it with<br />
<pre>sudo make install<br />
sudo ldconfig</pre><br />
The last part is for the OS to be aware of the new library (that has been installed in <code>/usr/local/lib</code>).<br />
We can now go back up one folder level and get ready for hugin.<br />
<pre>cd ..</pre><br />
<br />
== Building Hugin ==<br />
<br />
=== Dependencies ===<br />
<br />
First we need to activate the <code>universe</code> repository (in adept package manager, or by editing the /etc/apt/sources.lst file for example) and get the dependencies:<br />
<br />
<pre><br />
sudo apt-get install cmake libopenexr-dev libboost-dev boost-build libboost-thread-dev libboost-graph-dev \<br />
gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl libglew-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code from SVN ===<br />
<br />
Next we download Hugin from SVN. But which Hugin? There are many [http://svnbook.red-bean.com/en/1.1/ch04.html#svn-ch-4-sect-1 branches] in SVN. Also SVN keeps track of every single change (revision) in time, so we can download a branch in its state at a specific point in time. For example <code>-r 4008 https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk/</code> will download the trunk branch at the point in time when revision [http://hugin.svn.sourceforge.net/viewvc/hugin?view=rev&revision=4008 4008] was committed, which happens to be Tue Jul 7 22:07:54 2009 UTC. It also happens to be the same as the 0.8.0 release. For a list of branches and revisions that build well, refer to these [[Development_of_Open_Source_tools#Specific_revisions|lists]]. There is no guarantee that a particular branch and/or revision builds and/or performs as expected.<br />
<br />
<pre><br />
cd<br />
svn co -r 4061 https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/tags/hugin-2009.07.1/ hugin<br />
</pre><br />
<br />
If you know what you are doing, you can replace /hugin-2009.07.1/ with another branch; and you can omit the -r and get the last revision of that branch.<br />
<br />
For hugin 2010.0 use:<br />
<pre><br />
cd<br />
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/releases/2010.0 hugin<br />
</pre><br />
<br />
In the future there is no need to get the whole source again. Just issue the following commands to bring your source up to date:<br />
<pre><br />
cd hugin<br />
svn up<br />
</pre><br />
<br />
=== Set the Build Environment ===<br />
<br />
Next we set up the build environment using cmake.<br />
<br />
If you compiled and installed libpano to a non standard location set the variables CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH to point to your install location's include and lib directories.<br />
<br />
If you are building for distribution, you want to set CMAKE_INSTALL_PREFIX=/usr<br />
<br />
<pre><br />
cd<br />
mkdir hugin-build<br />
cd hugin-build<br />
cmake ../hugin -DENABLE_LAPACK=YES -DCPACK_BINARY_DEB:BOOL=ON -DCPACK_BINARY_NSIS:BOOL=OFF \<br />
-DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TBZ2:BOOL=OFF \<br />
-DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF<br />
</pre><br />
<br />
=== Build and Install ===<br />
<br />
Finally, we use make to build the code and package it, and dpkg to install it. Look for the version number in the .deb file created and edit the lines below accordingly: <br />
<br />
<pre><br />
make package<br />
sudo dpkg -i hugin-*-Linux.deb<br />
sudo ldconfig<br />
</pre><br />
<br />
'''Important:''' the package does not track dependencies yet, so it likely to fail on machines others than yours.<br />
<br />
Reference: [http://theseblog.free.fr/2007/10/building-hugin-in-ubuntu-feisty-fawn.php]<br />
<br />
== Autopano-sift-C ==<br />
<br />
Pre-Requisites:<br />
<pre><br />
sudo apt-get install libxml2-dev<br />
</pre><br />
<br />
To build<br />
<br />
(Note January 2010: Currently the autopano-sift-C SVN trunk is unstable, use the 2.5.1 release tarball instead)<br />
<br />
<pre><br />
cd<br />
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/autopano-sift-C/trunk/ autopano-sift-C<br />
cd<br />
mkdir autopano-sift-C.build<br />
cd autopano-sift-C.build<br />
cmake ../autopano-sift-C -DCMAKE_INSTALL_PREFIX=/usr/local -DCPACK_BINARY_DEB:BOOL=ON -DCPACK_BINARY_NSIS:BOOL=OFF \<br />
-DCPACK_BINARY_RPM:BOOL=OFF -DCPACK_BINARY_STGZ:BOOL=OFF -DCPACK_BINARY_TBZ2:BOOL=OFF \<br />
-DCPACK_BINARY_TGZ:BOOL=OFF -DCPACK_BINARY_TZ:BOOL=OFF<br />
make package<br />
sudo dpkg -i autopano-sift-C-*-Linux.deb<br />
</pre><br />
<br />
== Match-n-shift ==<br />
<br />
Match-n-shift is yet an other Autopano-SIFT replacement. It comes in a bundle with pto file manipulation perl libraries and a rich selection of other tools that use nona, enblend, ImageMagick among other things. To use match-n-shift, you need to install at least the [http://search.cpan.org/dist/Panotools-Script/ Panotools::Script] library and some other perl modules. It requires:<br />
<br />
* Image::Size 2.9<br />
* Storable 2.0<br />
* Image::ExifTool 6<br />
<br />
Chances are that you do not need to update Storable which is a standard perl module. To check the version of installed versions of these modules, write these lines to the command prompt:<br />
<br />
perl -MStorable -le 'print Storable->VERSION;'<br />
perl -MImage::Size -le 'print Image::Size->VERSION;'<br />
perl -MImage::ExifTool -le 'print Image::ExifTool->VERSION;'<br />
<br />
There are various ways to install or upgrade these modules. Ubuntu has binary packages for many perl modules, you can skip the CPAN installation below and type:<br />
<br />
sudo apt-get install libimage-size-perl libimage-exiftool-perl<br />
<br />
Alternatively, perl is an interpreted language and these modules are pure perl, so installing from source is an easy thing.<br />
<br />
The best place to install perl modules is directly from a CPAN archive. CPAN is short for Comprehensive Perl Archive Network. The program to interact with CPAN comes with all perl installations. Start it by running:<br />
<br />
sudo cpan<br />
<br />
If this is your first time running the program you will be asked a number of questions (you can safely accept the suggested values). Last question lets you select a number of CPAN mirrors nearest to you.<br />
<br />
When all is done, you can enter the install commands after the 'cpan>' prompt:<br />
<br />
install Image::Size Storable Image::ExifTool<br />
<br />
Answer 'y' to any question of dependencies and wait for install to complete. 'exit' leaves the cpan shell.<br />
<br />
Next, you need to retrieve and install the Panotools-Script collection<br />
of perl libraries (Panotools::Script) and programs that use them -<br />
including match-n-shift:<br />
<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/Panotools-Script Panotools-Script<br />
cd Panotools-Script<br />
perl Makefile.PL<br />
make<br />
make test<br />
sudo make install<br />
<br />
Just to confuse you, you can also ignore everything above and just install Panotools::Script and all its dependencies from CPAN. From command line, type:<br />
<br />
sudo cpan Panotools::Script<br />
<br />
You can run match-n-shift from command line using the same parameters as autopano-c-complete.sh or you can modify hugin to run it for you:<br />
<br />
* start Hugin<br />
* navigate the menu File to Preferences<br />
* In the Preferences window, open the Autopano tab<br />
* Select Autopano -> Autopano-SIFT<br />
* tick the checkbox for Use alternative Autopano-SIFT program<br />
* enter the full path to match-n-shift (/usr/local/bin/match-n-shift) in the Autopano-SIFT field<br />
* enter the following string in the Arguments field:<br />
-f %f -v %v -c -p %p -o %o %i<br />
<br />
== MatchPoint ==<br />
<br />
MatchPoint is a next generation CP generator. The result of a GSoC2007 project, it is still very experimental. Experience reports needed. Read more [http://groups.google.com/group/hugin-ptx/browse_thread/thread/cba2b2ce94dd9054 here]<br />
<br />
Matchpoint is now located inside the main hugin source tree, no need to checkout https://hugin.svn.sourceforge.net/svnroot/hugin/gsoc07_featuredetection anymore. It is compiled together with hugin, but not installed by default.<br />
<br />
* copy the MatchPoint executable into /usr/local/bin manually<br />
<pre><br />
sudo cp src/matchpoint/matchpoint /usr/local/bin/<br />
</pre><br />
* edit /usr/local/bin/autopano-c-complete.sh (do it with sudo to have the necessary permission)<br />
** line 79: replace the .key.gz extension with .key (not sure if matchpoint supports compression)<br />
** lines 83 and 88: replace '''generatekeys "$arg" $FILENAME $SIZE''' with '''matchpoint "$arg" $FILENAME''' (not sure if the size option or any other options of the original generatekeys are applicable)<br />
<br />
== Pan-o-matic ==<br />
<br />
Yet another control point generator [http://aorlinsk2.free.fr/panomatic/?p=home Home Page]<br />
<br />
<pre>sudo apt-get install libboost-dev</pre><br />
<br />
Download [http://aorlinsk2.free.fr/panomatic/download.php?d=7&v=0.9.4 Panomatic 0.9.4 bz2] and if you're on Ubuntu 9.10 or newer also the [http://aorlinsk2.free.fr/panomatic/panomatic_gcc44.patch patch] for the gcc4.4 compiler.<br />
<br />
<pre><br />
tar xvfj panomatic-0.9.4-src.tar.bz2<br />
cd panomatic-0.9.4<br />
patch -p 1 < ../panomatic_gcc44.patch<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
To use Pano-o-matic, open Hugin<br />
<br />
* In File > Preferences > Autopano :<br />
* Select Autopano-SIFT<br />
* Check "Use alternative autopaon-SIFT program"<br />
* Choose the path to the binary ( /usr/local/bin )<br />
* In Arguments, put : -o %o %i<br />
<br />
=== Pablo's variation ===<br />
<br />
Around the end of the year 2009, Pablo integrated a [http://groups.google.com/group/hugin-ptx/browse_thread/thread/d9c0558c679cad52 new] experimental descriptor based on the geometric blur and DAISY papers. Also, Pablo said that the algorithm is not really based on a published approach, just on some ideas that are mentioned in a few of them, and its currently simpler than any of them:<br />
<br />
o geometric blur: [http://www.eecs.berkeley.edu/~aberg/gb.html]<br />
<br />
o daisy: [http://cvlab.epfl.ch/~tola/daisy.html]<br />
<br />
o descriptor learning: [http://cvlab.epfl.ch/~brown/learndesc/learndesc.html]<br />
<br />
To build that version of panomatic instead, follow these instructions:<br />
<br />
<pre><br />
sudo aptitude install libboost-python-dev bzr cmake libvigraimpex-dev<br />
</pre><br />
<br />
<pre><br />
bzr branch lp:~pablo.dangelo/hugin/panomatic-lib<br />
mkdir build<br />
cd build<br />
cmake ../panomatic-lib<br />
make<br />
make install<br />
</pre><br />
<br />
To use the new descriptor the arguments for Hugin are: '''--grad --sieve1size 100 --sieve2size 2 -o %o %i'''<br />
<br />
== Exiftool ==<br />
<br />
ExifTool is a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files.<br />
<br />
<pre><br />
sudo apt-get purge libimage-exiftool-perl<br />
</pre><br />
<br />
<pre><br />
wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-7.94.tar.gz<br />
tar -xzf Image-ExifTool-7.94.tar.gz<br />
cd Image-ExifTool-7.94<br />
perl Makefile.PL<br />
make test<br />
sudo make install<br />
</pre><br />
<br />
== Panoglview ==<br />
<br />
PanoGLView is an OpenGL hardware accelerated interactive immersive viewer for equirectangular images.<br />
<br />
Pre-Requisites:<br />
<pre>sudo apt-get install wx-common</pre><br />
<br />
To build<br />
<pre><br />
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/panoglview/trunk panoglview<br />
cd panoglview<br />
./bootstrap<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
== FreePV ==<br />
<br />
Pre-Requisites:<br />
<pre><br />
sudo apt-get install cmake make pkg-config g++ mozilla-dev freeglut-dev zlib1g-dev libjpeg-dev libxext-dev libxmu-dev \<br />
x11proto-xf86vidmode-dev libxxf86vm-dev libnspr4-dev libxml2-dev libpng12-dev<br />
</pre><br />
To build<br />
<pre><br />
svn co https://freepv.svn.sourceforge.net/svnroot/freepv/freepv/trunk/ freepv<br />
cd freepv<br />
cmake .<br />
make<br />
sudo make install<br />
</pre><br />
<br />
== Notes for Packagers ==<br />
* before releasing a tarball, upgrade the Changelog with svn2cl<br />
<pre><br />
$ svn up<br />
$ svn2cl<br />
$ svn ci<br />
</pre><br />
<br />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Ylzhaohttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Windows&diff=9203Hugin Compiling Windows2007-10-28T12:55:54Z<p>Ylzhao: /* Building OpenEXR */</p>
<hr />
<div>NOTE: this is work in progress and not finished yet. Please add clarifications or comments for the individual steps.<br />
<br />
= Why do I want to compile hugin? =<br />
<br />
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.<br />
<br />
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.<br />
<br />
This guide will describe two ways of building the latest trunk. It does not apply to the hugin code prior to 2007/10/27.<br />
<br />
= Deciding on the toolchain =<br />
<br />
Currently, there are two methods for building hugin. Both are based on the CMake build system.<br />
<br />
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.<br />
<br />
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.<br />
<br />
For both approaches, the hardest task is the compilation of the libraries required by hugin. This mainly includes wxWidgets, boost, libpano13 and OpenEXR.<br />
<br />
= Building with Microsoft Visual Studio .Net 2003 (or later) =<br />
<br />
For simpler installation I have build everything against the older, multithreaded runtime libraries (\MT option).<br />
<br />
== Getting the dependencies ==<br />
<br />
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).<br />
<br />
=== Downloading precompiled dependencies ===<br />
<br />
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.<br />
<br />
=== Build all required dependencies from scratch ===<br />
<br />
Download the source packages. Newer versions might work, too.<br />
<br />
1. Download wxWidgets from http://www.wxwidgets.org, I used 2.6.0<br />
<br />
2. Download boost from http://www.boost.org, I used 1.33<br />
<br />
3. Download OpenEXR source (IlmBase and OpenEXR) from http://www.openexr.com/<br />
<br />
4. Download panorama tools source (pano13), from http://panotools.sf.net. Use version 2.9.12 or later. Latest SVN is even better.<br />
<br />
5. Download and install gettext installer package from http://gnuwin32.sf.net<br />
<br />
Unpack the source packages.<br />
<br />
==== Building wxWidgets ====<br />
<br />
1. Open libs/wxWidgets/src/tiff/tiffconf.h in your favorite editor, and add<br />
<br />
#define ZIP_SUPPORT<br />
<br />
near line 90 to support ZIP compressed tiff files. This might not be needed in<br />
newer version of wxWidgets.<br />
<br />
2. build wxWidgets: start the MSVC command line shell (from the startmenu) and cd to the wxWidgets/build/msw. To build ANSI debug and Unicode release libraries, execute the following commands:<br />
<br />
nmake -f makefile.vc BUILD=debug UNICODE=0 SHARED=0 RUNTIME_LIBS=static<br />
nmake -f makefile.vc BUILD=release UNICODE=1 SHARED=0 RUNTIME_LIBS=static<br />
<br />
<br />
==== Building boost ====<br />
<br />
Refer to the boost documentation for details. Here is a short overview:<br />
Download bjam exectable from http://www.boost.org/tools/build/v1/build_system.htm<br />
and place it in the boost directory. Open the MSVC Command line prompt and<br />
change directory to the boost dir and issue<br />
<br />
bjam stage<br />
<br />
This will build all boost library, and take several hours. Hugin only needs the boost thread library, if possible try to<br />
build only that one.<br />
<br />
==== Building OpenEXR ====<br />
<br />
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.<br />
<br />
Build according to README_win in ilmbase-1.0.0 but changed the runtime of all projects to MT. <br />
<br />
For all projects do:<br />
* set each project to static lib<br />
* remove OPENEXR_DLL, _USEDLL and *_EXPORTS defines<br />
* set runtime to MT<br />
* disable SSE2, to generate binaries that run on all platforms<br />
* remove the createDLL part of the post-build command, but keep the call to '''install*.cmd''', such as '''..\..\..\installIlmImf.cmd $(IntDir)'''<br />
<br />
Apply the same procedure to the openexr-1.6 source code. Here only the IlmImf and IlmImfTest projects are needed by Hugin.<br />
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.<br />
<br />
==== Building Panotools ====<br />
<br />
[[Build_pano12_from_sourcecode_MSVC|Building Pano13 with MSVC]] is described on a separate page.<br />
<br />
=== Compiling Hugin ===<br />
<br />
Use SVN to retrieve the latest hugin sourcecode, run CMakeSetup and use this procedure:<br />
<br />
# Run cmake, select hugin source and build directories, tick the '''show advanced''' button. Do not choose the same directories for both source and build.<br />
# Press '''Configure''<br />
# fill out red fields, select appropriate library and include paths, if required. The msgfmt program can be found in the gettext package installed earlier.<br />
# Press '''Configure'''<br />
# If more warnings and red lines appear, goto 3.<br />
# Adjust some compiler settings in the CMAKE_C*_FLAGS entries.<br />
#* Change C runtime library from \MD to \MT.<br />
#* Reduce debug level from \Zl to \Zd (otherwise the debug files become bigger than MSVC can handle).<br />
<br />
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.<br />
<br />
= Building using MinGW =<br />
<br />
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<br />
<br />
<br />
<small>--[[User:Pablo|pablo]] 10:32, 28 October 2007 (CET)</small></div>Ylzhao