https://wiki.panotools.org/api.php?action=feedcontributions&user=Drbeams&feedformat=atomPanoTools.org Wiki - User contributions [en]2024-03-29T05:02:06ZUser contributionsMediaWiki 1.35.3https://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12996Hugin Compiling Ubuntu2011-01-17T17:19:11Z<p>Drbeams: /* ExifTool */</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 10.10. 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]] 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 time, 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 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, and start understanding the building process. You will need deeper understanding of the building process if you want to:<br />
* develop code<br />
* translate the latest strings<br />
* document the latest features with manuals and tutorials<br />
* package for distribution<br />
That knowledge is out of scope for 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 />
CMake 2.8.2, as packaged in Ubuntu 10.10, contains a bug (http://public.kitware.com/Bug/view.php?id=11020) the prevents the created debs to install successfully, due to it not storing needed directories in the deb package.<br />
Installing the resulting debs will fail with a message error saying something like<br />
<br />
<pre><br />
unable to create `/usr/local/share/hugin/xrc/data/redo.png.dpkg-new' (while processing `./usr/local/share/hugin/xrc/data/redo.png'): No such file or directory<br />
</pre><br />
<br />
Commands to create the necessary folders have been documented below and may be added to the CMake build in the repository of Hugin, Libpano, Enblend. However it is possible that the lists are incomplete. If you bump in the above message, the solution is to create the full missing path and run dpkg -i again, recursively adding folders until the install succeed.<br />
<br />
<pre><br />
sudo mkdir -p /usr/local/share/hugin/xrc/data/<br />
</pre><br />
<br />
Another workaround is, to partially rebuild the deb package by hand:<br />
<br />
<pre><br />
mkdir unpacked<br />
cd unpacked/<br />
ar x ../hugin.build/hugin-2010.2.0-Linux.deb<br />
mkdir untarred<br />
cd untarred<br />
tar xzf ../data.tar.gz<br />
tar czf ../data.tar.gz .<br />
cd ..<br />
ar r ../hugin-2010.2.0-Linux.deb debian-binary control.tar.gz data.tar.gz<br />
</pre><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 follow religiously 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 you 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 autopano-sift-c panini<br />
</pre><br />
<br />
=== Unstable ===<br />
<br />
This will install you the latest unstable version of the tools that has been built as a binary. While they are likely to work in most cases, there is no guarantee and they are not recommended for 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 autopano-sift-c panini<br />
</pre><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 libc6-dev libgcc1 \<br />
cmake<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 />
<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 />
<pre><br />
cd<br />
mkdir -p src<br />
</pre><br />
<br />
=== For Distributors ===<br />
<br />
Not necessary, but useful if you want to move to the next level and build packages for distribution:<br />
<br />
<pre><br />
sudo apt-get install subversion-tools<br />
sudo echo 'deb-src ftp://ftp.at.debian.org/debian ../project/experimental main' > debian-experimental.list<br />
mv debian-experimental.list /etc/apt/sources.list.d/<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 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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man texi2html texinfo fig2ps tidy gnuplot libxml-xpath-perl \<br />
imagemagick libplot-dev liblcms1-dev libboost-system-dev<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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<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 />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
If the install quits with an error, it is likely because of missing folders. Run the following commands and retry:<br />
<pre><br />
sudo mkdir -p /usr/local/share/man/man1<br />
sudo mkdir -p /usr/local/bin<br />
</pre><br />
<br />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
Set -DCMAKE_BUILD_TYPE=Debug if you want to help investigate/debug a problem and capture even more debugging information.<br />
<br />
If the install quits with an error, it is likely because of missing folders. Run the following commands and retry:<br />
<pre><br />
sudo mkdir -p /usr/local/include/pano13/<br />
sudo mkdir -p /usr/local/include/pano13/doc<br />
sudo mkdir -p /usr/local/lib/pkgconfig<br />
sudo mkdir -p /usr/local/share/man/man1<br />
sudo mkdir -p /usr/local/bin<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 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 />
The following command will install on your system all build time dependencies except libpano13.<br />
<pre><br />
sudo apt-get install libwxgtk2.8-dev libtiff4-dev libpng12-dev \<br />
libopenexr-dev libexiv2-dev libglut3-dev libglew-dev libboost-dev \<br />
boost-build libboost-thread-dev libboost-graph-dev libboost-regex-dev \<br />
libboost-iostreams-dev libboost-filesystem-dev gettext liblapack-dev \<br />
libxi-dev libxmu-dev libboost-signals-dev libboost-system-dev<br />
</pre><br />
<br />
You could install libpano13 on your system with the command below. However it is likely to be a version of libpano13 that is too old for the current Hugin. It is recommended that you first build your own libpano13 (above). Alternatively, there may be a recent enough version of libpano13 in the Hugin PPA.<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. You don't need this line if you follow the instructions on this page to build ExifTool, Enblend, Autopano-SIFT-C.<br />
<pre><br />
sudo apt-get install libimage-exiftool-perl enblend autopano-sift-c<br />
</pre><br />
<br />
If you want to use the Python scripting tools, you will also need the following dependencies at runtime.<br />
<br />
<pre><br />
sudo apt-get install python-argparse<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/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 />
<pre><br />
hg clone ssh://${USER}@hugin.hg.sourceforge.net/hgroot/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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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 />
</pre><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 />
=== 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 />
If the install quits with an error, it is likely because of missing folders. Run the following commands and retry: <br />
<pre><br />
sudo mkdir -p /usr/local/share/pixmaps<br />
sudo mkdir -p /usr/local/share/mime/packages<br />
sudo mkdir -p /usr/local/share/applications/<br />
sudo mkdir -p /usr/local/share/icons/gnome/48x48/mimetypes/<br />
sudo mkdir -p /usr/local/share/locale/en_GB/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/es_la/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/fr/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/zh_TW/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ru/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/bg/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/de/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ko/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/pt_BR/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/zh_CN/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ja/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/it/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/sl/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/sk/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/sv/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ca_ES/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/nl/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/fi/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/cs_CZ/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/uk/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/es/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/pl/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/hu/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/es_VE/LC_MESSAGES<br />
sudo mkdir -p /usr/local/share/hugin/xrc/data/help_it_IT<br />
sudo mkdir -p /usr/local/share/hugin/xrc/data/help_en_EN<br />
sudo mkdir -p /usr/local/share/hugin/data/<br />
sudo mkdir -p /usr/local/lib/hugin<br />
sudo mkdir -p /usr/local/share/man/man1<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 />
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. [http://www.sno.phy.queensu.ca/~phil/exiftool/ Home Page].<br />
<br />
Usually the version distributed with Ubuntu (8.15 in Ubuntu 10.10 and 7.89 in Ubuntu 10.4) are good enough and you don't need to bother with the following instructions. However there were situations in the past and there might be situation in the future that are better supported in the latest versions. These situation are most likely due to your specific camera brand/model, and occur with 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.45.tar.gz<br />
tar -xzf Image-ExifTool-8.45.tar.gz<br />
cd Image-ExifTool-8.45<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:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12900Hugin Compiling Ubuntu2010-12-04T14:32:15Z<p>Drbeams: /* Build and Install */</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 10.10. 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]] 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 time, 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 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, and start understanding the building process. You will need deeper understanding of the building process if you want to:<br />
* develop code<br />
* translate the latest strings<br />
* document the latest features with manuals and tutorials<br />
* package for distribution<br />
That knowledge is out of scope for 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 />
CMake 2.8.2, as packaged in Ubuntu 10.10, contains a bug (http://public.kitware.com/Bug/view.php?id=11020) the prevents the created debs to install successfully, due to it not storing needed directories in the deb package.<br />
Installing the resulting debs will fail with a message error saying something like<br />
<br />
<pre><br />
unable to create `/usr/local/share/hugin/xrc/data/redo.png.dpkg-new' (while processing `./usr/local/share/hugin/xrc/data/redo.png'): No such file or directory<br />
</pre><br />
<br />
Commands to create the necessary folders have been documented below and may be added to the CMake build in the repository of Hugin, Libpano, Enblend. However it is possible that the lists are incomplete. If you bump in the above message, the solution is to create the full missing path and run dpkg -i again, recursively adding folders until the install succeed.<br />
<br />
<pre><br />
sudo mkdir -p /usr/local/share/hugin/xrc/data/<br />
</pre><br />
<br />
Another workaround is, to partially rebuild the deb package by hand:<br />
<br />
<pre><br />
mkdir unpacked<br />
cd unpacked/<br />
ar x ../hugin.build/hugin-2010.2.0-Linux.deb<br />
mkdir untarred<br />
cd untarred<br />
tar xzf ../data.tar.gz<br />
tar czf ../data.tar.gz .<br />
cd ..<br />
ar r ../hugin-2010.2.0-Linux.deb debian-binary control.tar.gz data.tar.gz<br />
</pre><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 follow religiously 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 you 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 autopano-sift-c panini<br />
</pre><br />
<br />
=== Unstable ===<br />
<br />
This will install you the latest unstable version of the tools that has been built as a binary. While they are likely to work in most cases, there is no guarantee and they are not recommended for 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 autopano-sift-c panini<br />
</pre><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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man texi2html texinfo fig2ps tidy gnuplot libxml-xpath-perl \<br />
imagemagick libplot-dev liblcms1-dev<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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<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 />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
If the install quits with an error, it is likely because of missing folders. Run the following commands and retry:<br />
<pre><br />
sudo mkdir -p /usr/local/share/man/man1<br />
sudo mkdir -p /usr/local/bin<br />
</pre><br />
<br />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
Set -DCMAKE_BUILD_TYPE=Debug if you want to help investigate/debug a problem and capture even more debugging information.<br />
<br />
If the install quits with an error, it is likely because of missing folders. Run the following commands and retry:<br />
<pre><br />
sudo mkdir -p /usr/local/include/pano13/<br />
sudo mkdir -p /usr/local/include/pano13/doc<br />
sudo mkdir -p /usr/local/lib/pkgconfig<br />
sudo mkdir -p /usr/local/share/man/man1<br />
sudo mkdir -p /usr/local/bin<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 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 />
The following command will install on your system all build time dependencies except libpano13.<br />
<pre><br />
sudo apt-get install libwxgtk2.8-dev libtiff4-dev libpng12-dev \<br />
libopenexr-dev libexiv2-dev libglut3-dev libglew-dev libboost-dev \<br />
boost-build libboost-thread-dev libboost-graph-dev libboost-regex-dev \<br />
libboost-iostreams-dev libboost-filesystem-dev gettext liblapack-dev \<br />
libxi-dev libxmu-dev libboost-signals-dev libboost-system-dev<br />
</pre><br />
<br />
You could install libpano13 on your system with the command below. However it is likely to be a version of libpano13 that is too old for the current Hugin. It is recommended that you first build your own libpano13 (above). Alternatively, there may be a recent enough version of libpano13 in the Hugin PPA.<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. You don't need this line if you follow the instructions on this page to build ExifTool, Enblend, Autopano-SIFT-C.<br />
<pre><br />
sudo apt-get install libimage-exiftool-perl enblend autopano-sift-c<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/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 />
<pre><br />
hg clone ssh://${USER}@hugin.hg.sourceforge.net/hgroot/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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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 />
</pre><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 />
=== 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 />
If the install quits with an error, it is likely because of missing folders. Run the following commands and retry: <br />
<pre><br />
sudo mkdir -p /usr/local/share/pixmaps<br />
sudo mkdir -p /usr/local/share/mime/packages<br />
sudo mkdir -p /usr/local/share/applications/<br />
sudo mkdir -p /usr/local/share/icons/gnome/48x48/mimetypes/<br />
sudo mkdir -p /usr/local/share/locale/en_GB/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/fr/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/zh_TW/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ru/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/bg/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/de/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ko/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/pt_BR/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/zh_CN/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ja/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/it/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/sl/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/sk/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/sv/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ca_ES/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/nl/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/fi/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/cs_CZ/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/uk/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/es/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/pl/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/hu/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/es_VE/LC_MESSAGES<br />
sudo mkdir -p /usr/local/share/hugin/xrc/data/help_it_IT<br />
sudo mkdir -p /usr/local/share/hugin/xrc/data/help_en_EN<br />
sudo mkdir -p /usr/local/share/hugin/data/<br />
sudo mkdir -p /usr/local/lib/hugin<br />
sudo mkdir -p /usr/local/share/man/man1<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 />
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. [http://www.sno.phy.queensu.ca/~phil/exiftool/ Home Page].<br />
<br />
Usually the version distributed with Ubuntu (8.15 in Ubuntu 10.10 and 7.89 in Ubuntu 10.4) are good enough and you don't need to bother with the following instructions. However there were situations in the past and there might be situation in the future that are better supported in the latest versions. These situation are most likely due to your specific camera brand/model, and occur with 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.41.tar.gz<br />
tar -xzf Image-ExifTool-8.41.tar.gz<br />
cd Image-ExifTool-8.41<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 />
* The deb packages built by CMake (2.8.2) are broken by Debian standard. Better not distributing them. There are official updated recent packages at<br />
*:http://packages.debian.org/hugin<br />
*:http://packages.debian.org/hugin-tools<br />
*:http://packages.debian.org/hugin-data<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 />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12899Hugin Compiling Ubuntu2010-12-04T13:35:06Z<p>Drbeams: /* ExifTool */</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 10.10. 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]] 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 time, 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 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, and start understanding the building process. You will need deeper understanding of the building process if you want to:<br />
* develop code<br />
* translate the latest strings<br />
* document the latest features with manuals and tutorials<br />
* package for distribution<br />
That knowledge is out of scope for 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 />
CMake 2.8.2, as packaged in Ubuntu 10.10, contains a bug (http://public.kitware.com/Bug/view.php?id=11020) the prevents the created debs to install successfully, due to it not storing needed directories in the deb package.<br />
Installing the resulting debs will fail with a message error saying something like<br />
<br />
<pre><br />
unable to create `/usr/local/share/hugin/xrc/data/redo.png.dpkg-new' (while processing `./usr/local/share/hugin/xrc/data/redo.png'): No such file or directory<br />
</pre><br />
<br />
Commands to create the necessary folders have been documented below and may be added to the CMake build in the repository of Hugin, Libpano, Enblend. However it is possible that the lists are incomplete. If you bump in the above message, the solution is to create the full missing path and run dpkg -i again, recursively adding folders until the install succeed.<br />
<br />
<pre><br />
sudo mkdir -p /usr/local/share/hugin/xrc/data/<br />
</pre><br />
<br />
Another workaround is, to partially rebuild the deb package by hand:<br />
<br />
<pre><br />
mkdir unpacked<br />
cd unpacked/<br />
ar x ../hugin.build/hugin-2010.2.0-Linux.deb<br />
mkdir untarred<br />
cd untarred<br />
tar xzf ../data.tar.gz<br />
tar czf ../data.tar.gz .<br />
cd ..<br />
ar r ../hugin-2010.2.0-Linux.deb debian-binary control.tar.gz data.tar.gz<br />
</pre><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 follow religiously 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 you 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 autopano-sift-c panini<br />
</pre><br />
<br />
=== Unstable ===<br />
<br />
This will install you the latest unstable version of the tools that has been built as a binary. While they are likely to work in most cases, there is no guarantee and they are not recommended for 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 autopano-sift-c panini<br />
</pre><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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man texi2html texinfo fig2ps tidy gnuplot libxml-xpath-perl \<br />
imagemagick libplot-dev liblcms1-dev<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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<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 />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
If the install quits with an error, it is likely because of missing folders. Run the following commands and retry:<br />
<pre><br />
sudo mkdir -p /usr/local/share/man/man1<br />
sudo mkdir -p /usr/local/bin<br />
</pre><br />
<br />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
Set -DCMAKE_BUILD_TYPE=Debug if you want to help investigate/debug a problem and capture even more debugging information.<br />
<br />
If the install quits with an error, it is likely because of missing folders. Run the following commands and retry:<br />
<pre><br />
sudo mkdir -p /usr/local/include/pano13/<br />
sudo mkdir -p /usr/local/include/pano13/doc<br />
sudo mkdir -p /usr/local/lib/pkgconfig<br />
sudo mkdir -p /usr/local/share/man/man1<br />
sudo mkdir -p /usr/local/bin<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 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 />
The following command will install on your system all build time dependencies except libpano13.<br />
<pre><br />
sudo apt-get install libwxgtk2.8-dev libtiff4-dev libpng12-dev \<br />
libopenexr-dev libexiv2-dev libglut3-dev libglew-dev libboost-dev \<br />
boost-build libboost-thread-dev libboost-graph-dev libboost-regex-dev \<br />
libboost-iostreams-dev libboost-filesystem-dev gettext liblapack-dev \<br />
libxi-dev libxmu-dev libboost-signals-dev libboost-system-dev<br />
</pre><br />
<br />
You could install libpano13 on your system with the command below. However it is likely to be a version of libpano13 that is too old for the current Hugin. It is recommended that you first build your own libpano13 (above). Alternatively, there may be a recent enough version of libpano13 in the Hugin PPA.<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. You don't need this line if you follow the instructions on this page to build ExifTool, Enblend, Autopano-SIFT-C.<br />
<pre><br />
sudo apt-get install libimage-exiftool-perl enblend autopano-sift-c<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/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 />
<pre><br />
hg clone ssh://${USER}@hugin.hg.sourceforge.net/hgroot/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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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 />
</pre><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 />
=== 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 />
If the install quits with an error, it is likely because of missing folders. Run the following commands and retry: <br />
<pre><br />
sudo mkdir -p /usr/local/share/pixmaps<br />
sudo mkdir -p /usr/local/share/mime/packages<br />
sudo mkdir -p /usr/local/share/applications/<br />
sudo mkdir -p /usr/local/share/icons/gnome/48x48/mimetypes/<br />
sudo mkdir -p /usr/local/share/locale/en_GB/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/fr/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/zh_TW/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ru/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/bg/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/de/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ko/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/pt_BR/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/zh_CN/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ja/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/it/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/sl/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/sk/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/sv/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ca_ES/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/nl/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/fi/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/cs_CZ/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/uk/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/es/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/pl/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/hu/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/hugin/xrc/data/help_it_IT<br />
sudo mkdir -p /usr/local/share/hugin/xrc/data/help_en_EN<br />
sudo mkdir -p /usr/local/share/hugin/data/<br />
sudo mkdir -p /usr/local/lib/hugin<br />
sudo mkdir -p /usr/local/share/man/man1<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 />
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. [http://www.sno.phy.queensu.ca/~phil/exiftool/ Home Page].<br />
<br />
Usually the version distributed with Ubuntu (8.15 in Ubuntu 10.10 and 7.89 in Ubuntu 10.4) are good enough and you don't need to bother with the following instructions. However there were situations in the past and there might be situation in the future that are better supported in the latest versions. These situation are most likely due to your specific camera brand/model, and occur with 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.41.tar.gz<br />
tar -xzf Image-ExifTool-8.41.tar.gz<br />
cd Image-ExifTool-8.41<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 />
* The deb packages built by CMake (2.8.2) are broken by Debian standard. Better not distributing them. There are official updated recent packages at<br />
*:http://packages.debian.org/hugin<br />
*:http://packages.debian.org/hugin-tools<br />
*:http://packages.debian.org/hugin-data<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 />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12882Hugin Compiling Ubuntu2010-11-30T23:34:58Z<p>Drbeams: /* ExifTool */</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 10.10. 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]] 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 time, 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 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, and start understanding the building process. You will need deeper understanding of the building process if you want to:<br />
* develop code<br />
* translate the latest strings<br />
* document the latest features with manuals and tutorials<br />
* package for distribution<br />
That knowledge is out of scope for 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 />
CMake 2.8.2, as packaged in Ubuntu 10.10, contains a bug (http://public.kitware.com/Bug/view.php?id=11020) the prevents the created debs to install successfully, due to it not storing needed directories in the deb package.<br />
Installing the resulting debs will fail with a message error saying something like<br />
<br />
<pre><br />
unable to create `/usr/local/share/hugin/xrc/data/redo.png.dpkg-new' (while processing `./usr/local/share/hugin/xrc/data/redo.png'): No such file or directory<br />
</pre><br />
<br />
Commands to create the necessary folders have been documented below and may be added to the CMake build in the repository of Hugin, Libpano, Enblend. However it is possible that the lists are incomplete. If you bump in the above message, the solution is to create the full missing path and run dpkg -i again, recursively adding folders until the install succeed.<br />
<br />
<pre><br />
sudo mkdir -p /usr/local/share/hugin/xrc/data/<br />
</pre><br />
<br />
Another workaround is, to partially rebuild the deb package by hand:<br />
<br />
<pre><br />
mkdir unpacked<br />
cd unpacked/<br />
ar x ../hugin.build/hugin-2010.2.0-Linux.deb<br />
mkdir untarred<br />
cd untarred<br />
tar xzf ../data.tar.gz<br />
tar czf ../data.tar.gz .<br />
cd ..<br />
ar r ../hugin-2010.2.0-Linux.deb debian-binary control.tar.gz data.tar.gz<br />
</pre><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 follow religiously 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 you 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 autopano-sift-c panini<br />
</pre><br />
<br />
=== Unstable ===<br />
<br />
This will install you the latest unstable version of the tools that has been built as a binary. While they are likely to work in most cases, there is no guarantee and they are not recommended for 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 autopano-sift-c panini<br />
</pre><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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man texi2html texinfo fig2ps tidy gnuplot libxml-xpath-perl \<br />
imagemagick libplot-dev liblcms1-dev<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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<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 />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
If the install quits with an error, it is likely because of missing folders. Run the following commands and retry:<br />
<pre><br />
sudo mkdir -p /usr/local/share/man/man1<br />
sudo mkdir -p /usr/local/bin<br />
</pre><br />
<br />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
Set -DCMAKE_BUILD_TYPE=Debug if you want to help investigate/debug a problem and capture even more debugging information.<br />
<br />
If the install quits with an error, it is likely because of missing folders. Run the following commands and retry:<br />
<pre><br />
sudo mkdir -p /usr/local/include/pano13/<br />
sudo mkdir -p /usr/local/include/pano13/doc<br />
sudo mkdir -p /usr/local/lib/pkgconfig<br />
sudo mkdir -p /usr/local/share/man/man1<br />
sudo mkdir -p /usr/local/bin<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 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 />
The following command will install on your system all build time dependencies except libpano13.<br />
<pre><br />
sudo apt-get install libwxgtk2.8-dev libtiff4-dev libpng12-dev \<br />
libopenexr-dev libexiv2-dev libglut3-dev libglew-dev libboost-dev \<br />
boost-build libboost-thread-dev libboost-graph-dev libboost-regex-dev \<br />
libboost-iostreams-dev libboost-filesystem-dev gettext liblapack-dev \<br />
libxi-dev libxmu-dev libboost-signals-dev libboost-system-dev<br />
</pre><br />
<br />
You could install libpano13 on your system with the command below. However it is likely to be a version of libpano13 that is too old for the current Hugin. It is recommended that you first build your own libpano13 (above). Alternatively, there may be a recent enough version of libpano13 in the Hugin PPA.<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. You don't need this line if you follow the instructions on this page to build ExifTool, Enblend, Autopano-SIFT-C.<br />
<pre><br />
sudo apt-get install libimage-exiftool-perl enblend autopano-sift-c<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/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 />
<pre><br />
hg clone ssh://${USER}@hugin.hg.sourceforge.net/hgroot/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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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 />
</pre><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 />
=== 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 />
If the install quits with an error, it is likely because of missing folders. Run the following commands and retry: <br />
<pre><br />
sudo mkdir -p /usr/local/share/pixmaps<br />
sudo mkdir -p /usr/local/share/mime/packages<br />
sudo mkdir -p /usr/local/share/applications/<br />
sudo mkdir -p /usr/local/share/icons/gnome/48x48/mimetypes/<br />
sudo mkdir -p /usr/local/share/locale/en_GB/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/fr/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/zh_TW/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ru/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/bg/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/de/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ko/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/pt_BR/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/zh_CN/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ja/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/it/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/sl/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/sk/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/sv/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/ca_ES/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/nl/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/fi/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/cs_CZ/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/uk/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/es/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/pl/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/locale/hu/LC_MESSAGES/<br />
sudo mkdir -p /usr/local/share/hugin/xrc/data/help_it_IT<br />
sudo mkdir -p /usr/local/share/hugin/xrc/data/help_en_EN<br />
sudo mkdir -p /usr/local/share/hugin/data/<br />
sudo mkdir -p /usr/local/lib/hugin<br />
sudo mkdir -p /usr/local/share/man/man1<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 />
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. [http://www.sno.phy.queensu.ca/~phil/exiftool/ Home Page].<br />
<br />
Usually the version distributed with Ubuntu (8.15 in Ubuntu 10.10 and 7.89 in Ubuntu 10.4) are good enough and you don't need to bother with the following instructions. However there were situations in the past and there might be situation in the future that are better supported in the latest versions. These situation are most likely due to your specific camera brand/model, and occur with 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.40.tar.gz<br />
tar -xzf Image-ExifTool-8.40.tar.gz<br />
cd Image-ExifTool-8.40<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 />
* The deb packages built by CMake (2.8.2) are broken by Debian standard. Better not distributing them. There are official updated recent packages at<br />
*:http://packages.debian.org/hugin<br />
*:http://packages.debian.org/hugin-tools<br />
*:http://packages.debian.org/hugin-data<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 />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12727Hugin Compiling Ubuntu2010-10-14T17:22:26Z<p>Drbeams: /* Image-ExifTool */</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 all versions of Ubuntu/Kubuntu up until 10.10.<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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<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 />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
<br />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libexiv2-dev libimage-exiftool-perl libwxbase2.8-dev \<br />
libglew-dev libglut3-dev liblapack-dev libboost-regex-dev libboost-iostreams-dev \<br />
libboost-filesystem-dev wx-i18n<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/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 />
<pre><br />
hg clone ssh://${USER}@hugin.hg.sourceforge.net/hgroot/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 />
<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 />
<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 -p 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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 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 />
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 />
== Image-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. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.34.tar.gz<br />
tar -xzf Image-ExifTool-8.34.tar.gz<br />
cd Image-ExifTool-8.34<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* The deb packages built by CMake (2.8.2) are broken by Debian standard. Better not distributing them. There are official updated recent packages at<br />
*:http://packages.debian.org/hugin<br />
*:http://packages.debian.org/hugin-tools<br />
*:http://packages.debian.org/hugin-data<br />
* to get an updated ChangeLog from 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 />
* in Hugin<br />
* to update the ChangeLog in SVN repositories (Panotools)<br />
<pre><br />
svn up<br />
svn2cl<br />
svn ci<br />
</pre><br />
<br />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12726Hugin Compiling Ubuntu2010-10-14T15:59:54Z<p>Drbeams: /* Dependencies */</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 all versions of Ubuntu/Kubuntu up until 10.10.<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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<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 />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
<br />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libexiv2-dev libimage-exiftool-perl libwxbase2.8-dev \<br />
libglew-dev libglut3-dev liblapack-dev libboost-regex-dev libboost-iostreams-dev \<br />
libboost-filesystem-dev wx-i18n<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/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 />
<pre><br />
hg clone ssh://${USER}@hugin.hg.sourceforge.net/hgroot/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 />
<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 />
<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 -p 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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 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 />
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 />
== Image-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. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.30.tar.gz<br />
tar -xzf Image-ExifTool-8.30.tar.gz<br />
cd Image-ExifTool-8.30<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* The deb packages built by CMake (2.8.2) are broken by Debian standard. Better not distributing them. There are official updated recent packages at<br />
*:http://packages.debian.org/hugin<br />
*:http://packages.debian.org/hugin-tools<br />
*:http://packages.debian.org/hugin-data<br />
* to get an updated ChangeLog from 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 />
* in Hugin<br />
* to update the ChangeLog in SVN repositories (Panotools)<br />
<pre><br />
svn up<br />
svn2cl<br />
svn ci<br />
</pre><br />
<br />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12722Hugin Compiling Ubuntu2010-10-14T08:18:29Z<p>Drbeams: /* Dependencies */</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 all versions of Ubuntu/Kubuntu up until 10.10.<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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<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 />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
<br />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libexiv2-dev libimage-exiftool-perl libwxbase2.8-dev \<br />
libglew-dev libglut3-dev liblapack-dev libboost-regex-dev libboost-iostreams-dev \<br />
libboost-filesystem-dev <br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/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 />
<pre><br />
hg clone ssh://${USER}@hugin.hg.sourceforge.net/hgroot/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 />
<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 />
<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 -p 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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 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 />
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 />
== Image-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. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.30.tar.gz<br />
tar -xzf Image-ExifTool-8.30.tar.gz<br />
cd Image-ExifTool-8.30<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* The deb packages built by CMake (2.8.2) are broken by Debian standard. Better not distributing them. There are official updated recent packages at<br />
*:http://packages.debian.org/hugin<br />
*:http://packages.debian.org/hugin-tools<br />
*:http://packages.debian.org/hugin-data<br />
* to get an updated ChangeLog from 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 />
* in Hugin<br />
* to update the ChangeLog in SVN repositories (Panotools)<br />
<pre><br />
svn up<br />
svn2cl<br />
svn ci<br />
</pre><br />
<br />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12721Hugin Compiling Ubuntu2010-10-14T08:18:04Z<p>Drbeams: /* Dependencies */</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 all versions of Ubuntu/Kubuntu up until 10.10.<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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<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 />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
<br />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev libboost-regex-dev libboost-iostreams-dev \<br />
libboost-filesystem-dev libwxbase2.8-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/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 />
<pre><br />
hg clone ssh://${USER}@hugin.hg.sourceforge.net/hgroot/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 />
<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 />
<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 -p 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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 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 />
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 />
== Image-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. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.30.tar.gz<br />
tar -xzf Image-ExifTool-8.30.tar.gz<br />
cd Image-ExifTool-8.30<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* The deb packages built by CMake (2.8.2) are broken by Debian standard. Better not distributing them. There are official updated recent packages at<br />
*:http://packages.debian.org/hugin<br />
*:http://packages.debian.org/hugin-tools<br />
*:http://packages.debian.org/hugin-data<br />
* to get an updated ChangeLog from 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 />
* in Hugin<br />
* to update the ChangeLog in SVN repositories (Panotools)<br />
<pre><br />
svn up<br />
svn2cl<br />
svn ci<br />
</pre><br />
<br />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12720Hugin Compiling Ubuntu2010-10-14T08:17:10Z<p>Drbeams: /* Dependencies */</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 all versions of Ubuntu/Kubuntu up until 10.10.<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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<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 />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
<br />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev libboost-regex-dev libboost-iostreams-dev \<br />
libboost-filesystem-dev libwxbase2.8-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/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 />
<pre><br />
hg clone ssh://${USER}@hugin.hg.sourceforge.net/hgroot/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 />
<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 />
<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 -p 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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 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 />
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 />
== Image-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. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.30.tar.gz<br />
tar -xzf Image-ExifTool-8.30.tar.gz<br />
cd Image-ExifTool-8.30<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* The deb packages built by CMake (2.8.2) are broken by Debian standard. Better not distributing them. There are official updated recent packages at<br />
*:http://packages.debian.org/hugin<br />
*:http://packages.debian.org/hugin-tools<br />
*:http://packages.debian.org/hugin-data<br />
* to get an updated ChangeLog from 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 />
* in Hugin<br />
* to update the ChangeLog in SVN repositories (Panotools)<br />
<pre><br />
svn up<br />
svn2cl<br />
svn ci<br />
</pre><br />
<br />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12719Hugin Compiling Ubuntu2010-10-14T08:09:29Z<p>Drbeams: /* Configure the Build Environment */</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 all versions of Ubuntu/Kubuntu up until 10.10.<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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<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 />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
<br />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev libboost-regex-dev libboost-iostreams-dev \<br />
libboost-filesystem-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/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 />
<pre><br />
hg clone ssh://${USER}@hugin.hg.sourceforge.net/hgroot/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 />
<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 />
<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 -p 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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 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 />
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 />
== Image-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. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.30.tar.gz<br />
tar -xzf Image-ExifTool-8.30.tar.gz<br />
cd Image-ExifTool-8.30<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* The deb packages built by CMake (2.8.2) are broken by Debian standard. Better not distributing them. There are official updated recent packages at<br />
*:http://packages.debian.org/hugin<br />
*:http://packages.debian.org/hugin-tools<br />
*:http://packages.debian.org/hugin-data<br />
* to get an updated ChangeLog from 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 />
* in Hugin<br />
* to update the ChangeLog in SVN repositories (Panotools)<br />
<pre><br />
svn up<br />
svn2cl<br />
svn ci<br />
</pre><br />
<br />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12718Hugin Compiling Ubuntu2010-10-14T08:09:00Z<p>Drbeams: /* Configure the Build Environment */</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 all versions of Ubuntu/Kubuntu up until 10.10.<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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<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 />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
<br />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev libboost-regex-dev libboost-iostreams-dev \<br />
libboost-filesystem-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/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 />
<pre><br />
hg clone ssh://${USER}@hugin.hg.sourceforge.net/hgroot/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 />
<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 />
<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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 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 />
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 />
== Image-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. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.30.tar.gz<br />
tar -xzf Image-ExifTool-8.30.tar.gz<br />
cd Image-ExifTool-8.30<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* The deb packages built by CMake (2.8.2) are broken by Debian standard. Better not distributing them. There are official updated recent packages at<br />
*:http://packages.debian.org/hugin<br />
*:http://packages.debian.org/hugin-tools<br />
*:http://packages.debian.org/hugin-data<br />
* to get an updated ChangeLog from 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 />
* in Hugin<br />
* to update the ChangeLog in SVN repositories (Panotools)<br />
<pre><br />
svn up<br />
svn2cl<br />
svn ci<br />
</pre><br />
<br />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12628Hugin Compiling Ubuntu2010-09-15T17:23:00Z<p>Drbeams: /* Image-ExifTool */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 />
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 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 />
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 />
== Image-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. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.30.tar.gz<br />
tar -xzf Image-ExifTool-8.30.tar.gz<br />
cd Image-ExifTool-8.30<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12627Hugin Compiling Ubuntu2010-09-15T17:02:24Z<p>Drbeams: /* Pan-o-matic */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 />
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 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 />
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 />
== Image-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. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12583Hugin Compiling Ubuntu2010-09-01T02:23:41Z<p>Drbeams: /* Panoglview */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 />
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"<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 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 />
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 />
== Image-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. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12582Hugin Compiling Ubuntu2010-09-01T02:09:26Z<p>Drbeams: /* Exiftool */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 />
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"<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 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 />
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 />
== Image-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. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12581Hugin Compiling Ubuntu2010-09-01T01:44:51Z<p>Drbeams: /* Building environment */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 \<br />
cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12580Hugin Compiling Ubuntu2010-09-01T01:43:00Z<p>Drbeams: /* FreePV - DEPENDENCIES ARE BROKEN - FAILS TO BUILD */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 />
== Notes for Packagers ==<br />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12579Hugin Compiling Ubuntu2010-09-01T01:41:11Z<p>Drbeams: /* FreePV - DEPENDENCIES ARE BROKEN - FAILS TO BUILD */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 libjpeg-dev libxext-dev \<br />
libxmu-dev 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12578Hugin Compiling Ubuntu2010-09-01T01:38:37Z<p>Drbeams: /* Autopano-sift-C */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 />
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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12577Hugin Compiling Ubuntu2010-09-01T01:37:17Z<p>Drbeams: /* Configure the Build Environment */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12576Hugin Compiling Ubuntu2010-09-01T01:34:40Z<p>Drbeams: /* autotools */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12575Hugin Compiling Ubuntu2010-09-01T01:33:12Z<p>Drbeams: /* Dependencies */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 \<br />
libboost-graph-dev gettext libwxgtk2.8-dev libexiv2-dev libimage-exiftool-perl \<br />
libglew-dev libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12574Hugin Compiling Ubuntu2010-09-01T01:32:01Z<p>Drbeams: /* The old autotools way */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12573Hugin Compiling Ubuntu2010-09-01T01:31:19Z<p>Drbeams: /* Building Libpano13 */</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12572Hugin Compiling Ubuntu2010-09-01T01:30:37Z<p>Drbeams: /* Building Enblend */ format to fit 1280 display</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12571Hugin Compiling Ubuntu2010-09-01T01:24:55Z<p>Drbeams: /* The old autotools way */ format for 1280 display</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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 \<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 enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 \<br />
--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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12570Hugin Compiling Ubuntu2010-09-01T01:24:06Z<p>Drbeams: /* Building Libpano13 */ formated for 1280 display screen</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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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 \<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 enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 />
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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Talk:Hugin_Compiling_Ubuntu&diff=12563Talk:Hugin Compiling Ubuntu2010-08-31T21:04:27Z<p>Drbeams: /* autotools */ new section</p>
<hr />
<div>In paragraph:<br />
<br />
''In ubuntu 7.10 AMD64, replace lib64z1 and lib64z1-dev with zlib1g and zlib1g-dev in the above command. COULD SOMEBODY PLEASE DOUBLE-CHECK?<br />
''<br />
You probably meant "In 32bit ubuntu 7.10 systems, ..." And yes, I this works. [[User:Heikki|Heikki]] 12:10, 4 February 2008 (CET)<br />
<br />
<br />
This page being about the bleeding edge versioning system installation, it would be useful to note that enfuse adds one more dependency to hugin: exiftools. You need to run <code>sudo apt-get install libimage-exiftool-perl </code> before running it. Personally, I think exiftools is not a good choice for this. Use something that is smaller and more focused to just copying the EXIF data over. Why not use jhead that is already part of hugin distribution? [[User:Heikki|Heikki]] 12:18, 4 February 2008 (CET)<br />
<br />
== Folder naming convention to build ==<br />
<br />
I noticed libpano now uses cmake.<br />
cd build.libpano was missing. Fixed it.<br />
Wouldn't it better to use the same naming convention for hugin, like suggesting to create a build.hugin instead of hugin-build? <br />
[[User:Esby|esby]] 22:31, 3 October 2009 (UTC)<br />
<br />
== Error executing hugin ==<br />
<br />
I'm using ubuntu 9.10, and after compiling and installing hugin, when I try executing it I get:<br />
<br />
<code><br />
$ hugin<br><br />
hugin: error while loading shared libraries: libhuginbase.so.0.0: cannot open shared object file: No such file or directory<br><br />
$ which hugin<br><br />
/usr/local/bin/hugin<br />
</code><br />
<br />
The deb package installs everything in /usr/local, and libhuginbase.so.0.0 is in /usr/local/lib/.<br />
<br />
What am I wrong in? [[User:DonPaolo|donPaolo]] 22:01, 1 January 2010 (UTC)<br />
<br />
== autotools ==<br />
<br />
If autotools is not being used anymore, could we drop it from the compile list?</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12562Hugin Compiling Ubuntu2010-08-31T20:59:26Z<p>Drbeams: </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 all versions of Ubuntu/Kubuntu up until 10.04.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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 \<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 enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12561Hugin Compiling Ubuntu2010-08-31T20:56:10Z<p>Drbeams: </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 all versions of Ubuntu/Kubuntu up until 10.4.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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 \<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 enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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</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 pglv.hg<br />
cd pglv.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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12560Hugin Compiling Ubuntu2010-08-31T20:54:35Z<p>Drbeams: </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 all versions of Ubuntu/Kubuntu up until 10.4.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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 \<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 enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 />
== 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 January 2010 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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 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 pglv.hg<br />
cd pglv.hg<br />
hg update<br />
./bootstrap<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
== FreePV - INSTRUCTIONS 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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12559Hugin Compiling Ubuntu2010-08-31T17:55:21Z<p>Drbeams: /* Exiftool */</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 all versions of Ubuntu/Kubuntu up until 10.4.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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 \<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 enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 a platform-independent Perl library plus a command-line application for reading, writing and editing meta information in image, audio and video files. [http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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 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 pglv.hg<br />
cd pglv.hg<br />
hg update<br />
./bootstrap<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
== FreePV - INSTRUCTIONS 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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12558Hugin Compiling Ubuntu2010-08-31T17:55:02Z<p>Drbeams: /* Exiftool */</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 all versions of Ubuntu/Kubuntu up until 10.4.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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 \<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 enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 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 />
[http://www.sno.phy.queensu.ca/~phil/exiftool/=home Home Page]<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.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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 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 pglv.hg<br />
cd pglv.hg<br />
hg update<br />
./bootstrap<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
== FreePV - INSTRUCTIONS 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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12557Hugin Compiling Ubuntu2010-08-31T17:50:41Z<p>Drbeams: /* Exiftool */</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 all versions of Ubuntu/Kubuntu up until 10.4.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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 \<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 enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 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-8.29.tar.gz<br />
tar -xzf Image-ExifTool-8.29.tar.gz<br />
cd Image-ExifTool-8.29<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 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 pglv.hg<br />
cd pglv.hg<br />
hg update<br />
./bootstrap<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
== FreePV - INSTRUCTIONS 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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12556Hugin Compiling Ubuntu2010-08-31T17:48:11Z<p>Drbeams: /* FreePV */</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 all versions of Ubuntu/Kubuntu up until 10.4.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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 \<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 enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 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-8.26.tar.gz<br />
tar -xzf Image-ExifTool-8.26.tar.gz<br />
cd Image-ExifTool-8.22<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 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 pglv.hg<br />
cd pglv.hg<br />
hg update<br />
./bootstrap<br />
./configure<br />
make<br />
sudo make install<br />
</pre><br />
<br />
== FreePV - INSTRUCTIONS 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 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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12555Hugin Compiling Ubuntu2010-08-31T05:39:01Z<p>Drbeams: /* Building Libpano13 */</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 all versions of Ubuntu/Kubuntu up until 10.4.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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 \<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 enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<br />
svn up<br />
</pre><br />
<br />
Now start the building process.<br />
<br />
<pre><br />
cd ..<br />
mkdir libpano.build<br />
cd libpano.build<br />
cmake ../libpano13.svn -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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 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-8.26.tar.gz<br />
tar -xzf Image-ExifTool-8.26.tar.gz<br />
cd Image-ExifTool-8.22<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 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 pglv.hg<br />
cd pglv.hg<br />
hg update<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? freeglut3-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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12554Hugin Compiling Ubuntu2010-08-31T04:15:52Z<p>Drbeams: /* Building Enblend */</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 all versions of Ubuntu/Kubuntu up until 10.4.<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 libc6-dev libgcc1 cmake<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 />
Not necessary, but useful if you want to revisit configuration sets in ccmake<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 />
<pre><br />
cd<br />
mkdir -p src<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><br />
sudo apt-get install pkg-config libtiff4-dev libboost-graph-dev libboost-thread-dev \<br />
libboost-filesystem-dev liblcms1-dev libglew1.5-dev libplot-dev libglut3-dev libopenexr-dev \<br />
libxi-dev libxmu-dev help2man 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://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
<pre><br />
cd ..<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 \<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 enblend-4.1.1-Linux.deb<br />
</pre><br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<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.svn -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 libglut3-dev liblapack-dev<br />
</pre><br />
<br />
=== Fetch the Source Code with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<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 />
<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.hg-build<br />
cd hugin.hg-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<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 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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"<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 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 />
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 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-8.26.tar.gz<br />
tar -xzf Image-ExifTool-8.26.tar.gz<br />
cd Image-ExifTool-8.22<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 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 pglv.hg<br />
cd pglv.hg<br />
hg update<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? freeglut3-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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12509Hugin Compiling Ubuntu2010-07-28T23:46:52Z<p>Drbeams: /* Exiftool */</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 all versions of Ubuntu/Kubuntu up until 10.4.<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 libc6-dev libgcc1 cmake<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 />
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 />
<pre><br />
cd<br />
mkdir -p src<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 />
mkdir -p ~/src/enblend<br />
cd ~/src/enblend<br />
hg clone http://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
cd ..<br />
mkdir enblend.build<br />
cd enblend.build<br />
cmake ../enblend.hg -DCPACK_BINARY_DEB:BOOL=ON -DENABLE_GPU:BOOL=ON -DENABLE_IMAGECACHE:BOOL=OFF -DENABLE_OPENMP:BOOL=ON<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<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.svn -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 with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<pre><br />
hg update -C 2010.0 <br />
</pre><br />
<br />
'''Advanced Use - Multiple Source Trees''': 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 />
<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.hg-build<br />
cd hugin.hg-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<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 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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 />
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 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-8.26.tar.gz<br />
tar -xzf Image-ExifTool-8.26.tar.gz<br />
cd Image-ExifTool-8.22<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 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 pglv.hg<br />
cd pglv.hg<br />
hg update<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? freeglut3-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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12508Hugin Compiling Ubuntu2010-07-28T23:46:26Z<p>Drbeams: /* 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 all versions of Ubuntu/Kubuntu up until 10.4.<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 libc6-dev libgcc1 cmake<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 />
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 />
<pre><br />
cd<br />
mkdir -p src<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 />
mkdir -p ~/src/enblend<br />
cd ~/src/enblend<br />
hg clone http://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
cd ..<br />
mkdir enblend.build<br />
cd enblend.build<br />
cmake ../enblend.hg -DCPACK_BINARY_DEB:BOOL=ON -DENABLE_GPU:BOOL=ON -DENABLE_IMAGECACHE:BOOL=OFF -DENABLE_OPENMP:BOOL=ON<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<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.svn -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 with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<pre><br />
hg update -C 2010.0 <br />
</pre><br />
<br />
'''Advanced Use - Multiple Source Trees''': 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 />
<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.hg-build<br />
cd hugin.hg-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<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 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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 />
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 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-8.22.tar.gz<br />
tar -xzf Image-ExifTool-8.22.tar.gz<br />
cd Image-ExifTool-8.22<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 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 pglv.hg<br />
cd pglv.hg<br />
hg update<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? freeglut3-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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12504Hugin Compiling Ubuntu2010-07-28T07:19:15Z<p>Drbeams: /* FreePV */</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 all versions of Ubuntu/Kubuntu up until 10.4.<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 libc6-dev libgcc1 cmake<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 />
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 />
<pre><br />
cd<br />
mkdir -p src<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 />
mkdir -p ~/src/enblend<br />
cd ~/src/enblend<br />
hg clone http://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
cd ..<br />
mkdir enblend.build<br />
cd enblend.build<br />
cmake ../enblend.hg -DCPACK_BINARY_DEB:BOOL=ON -DENABLE_GPU:BOOL=ON -DENABLE_IMAGECACHE:BOOL=OFF -DENABLE_OPENMP:BOOL=ON<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<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.svn -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 with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<pre><br />
hg update -C 2010.0 <br />
</pre><br />
<br />
'''Advanced Use - Multiple Source Trees''': 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 />
<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.hg-build<br />
cd hugin.hg-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<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 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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 />
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: '''--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-8.22.tar.gz<br />
tar -xzf Image-ExifTool-8.22.tar.gz<br />
cd Image-ExifTool-8.22<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 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 pglv.hg<br />
cd pglv.hg<br />
hg update<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? freeglut3-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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12503Hugin Compiling Ubuntu2010-07-28T07:17:49Z<p>Drbeams: /* FreePV */</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 all versions of Ubuntu/Kubuntu up until 10.4.<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 libc6-dev libgcc1 cmake<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 />
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 />
<pre><br />
cd<br />
mkdir -p src<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 />
mkdir -p ~/src/enblend<br />
cd ~/src/enblend<br />
hg clone http://enblend.hg.sourceforge.net:8000/hgroot/enblend/enblend enblend.hg<br />
cd 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 />
<pre><br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Then create a build directory and build in there. And install the Package<br />
cd ..<br />
mkdir enblend.build<br />
cd enblend.build<br />
cmake ../enblend.hg -DCPACK_BINARY_DEB:BOOL=ON -DENABLE_GPU:BOOL=ON -DENABLE_IMAGECACHE:BOOL=OFF -DENABLE_OPENMP:BOOL=ON<br />
make package<br />
sudo dpkg -i enblend-4.1.1-Linux.deb<br />
<br />
The above options 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 />
===The old autotools way===<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 />
mkdir -p ~/src/libpano<br />
cd ~/src/libpano<br />
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13.svn<br />
cd libpano13.svn<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 ~/src/libpano/libpano13.svn<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.svn -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 with Mercurial ===<br />
<br />
In May 2010 the Hugin project migrated from Subversion (SVN) to Mercurial (hg). SVN-related instructions are generally outdated.<br />
<br />
First we clone the repository. Unlike SVN, we do not need to choose at this moment which version of Hugin to download/build yet.<br />
<br />
If you already have a repository clone, you only need to pull the latest changes and update the code with:<br />
<pre><br />
cd ~/src/hugin/hugin.hg<br />
hg pull<br />
hg update<br />
</pre><br />
<br />
Else, you need to clone the repository and decide which version/branch to build with:<br />
<pre><br />
mkdir -p ~/src/hugin<br />
cd ~/src/hugin<br />
hg clone http://hugin.hg.sourceforge.net:8000/hgroot/hugin/hugin hugin.hg<br />
cd hugin.hg<br />
hg branches<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 />
<pre><br />
hg update -C 2010.0 <br />
</pre><br />
<br />
'''Advanced Use - Multiple Source Trees''': 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 />
<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.hg-build<br />
cd hugin.hg-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<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 / May 2010: Currently the autopano-sift-C SVN trunk, as well as Hg default tip, is unstable, 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 -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 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 />
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 />
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: '''--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-8.22.tar.gz<br />
tar -xzf Image-ExifTool-8.22.tar.gz<br />
cd Image-ExifTool-8.22<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 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 pglv.hg<br />
cd pglv.hg<br />
hg update<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] freeglut3-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 />
* '''Outdated - need something equivalent with Hg''': 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12396Hugin Compiling Ubuntu2010-05-21T02:29:58Z<p>Drbeams: /* 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 />
sudo 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=12118Hugin Compiling Ubuntu2010-01-21T16:32:49Z<p>Drbeams: /* 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<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</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 [http://wiki.panotools.org/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 />
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 />
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 />
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 />
<pre><br />
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/autopano-sift-C/trunk/ autopano-sift-C<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]<br />
<br />
<pre><br />
tar xvfj panomatic-0.9.4-src.tar.bz2<br />
cd panomatic-0.9.4<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<br />
geometric blur and DAISY papers. To build that version of panomatic instead, follow these instructions:<br />
<br />
<pre><br />
sudo aptitude install libboost-python-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 3 -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>Drbeamshttps://wiki.panotools.org/index.php?title=SmartBlend&diff=11846SmartBlend2009-09-28T00:24:29Z<p>Drbeams: /* How it works */</p>
<hr />
<div>'''Smartblend''' is {{Glossary|an application for seamless image blending by Michael Norel|1}}. He can be reached at minorlogic{at}yahoo{dot}com<br />
<br />
The main goal of smartblend is panoramic image blending, though it can be used for other applications, such as creation of seamless textures, montage of photos or collage. Smartblend allows stitching of many problematic shots (parallaxed, with moving objects or with differing exposure).<br />
<br />
For example see the parallax picture below (from http://www.htu.at/~sascha/ptguide/01.htm described as "impossible to stitch" )<br />
[[Image:SB_Parallax.jpg|left]]{{clr}}<br />
<br />
Just put one picture into another and note the great difference.<br />
[[Image:SB_Parallax_overlapped.jpg|left]]{{clr}}<br />
<br />
Picture below is blended by smartblend.<br />
[[Image:SB_Blended.jpg|left]]{{clr}}<br />
Another smartblend example: http://www.photodan.com.au/misc/flamchen.htm<br />
<br />
If you don't know what is a "command line application" it can not be useful for you. But you still can use a frontend for smartblend:<br />
<br />
* [[PanoWizard]]<br />
* [[EnblendGUI]]<br />
* [[PTGui]]<br />
* [[PTAssembler]]<br />
<br />
Download SmartBlend, current version [[Media:Smartblend_1_2_5.zip|Smartblend_1_2_5.zip]]<br />
<br />
== How it works ==<br />
<br />
It finds the visual error on overlap region and searches for a seam line with minimal visual error. Than it blends pictures using an algorithm similar to a multiresolution spline.<br />
<br />
To study algorithms and options use “–SeamVerbose” and “-PyramidVerbose” commands.<br />
<br />
There is a [http://qtvr.by.ru/NewQTWR/sm/smartblend.htm good tutorial], but it's available only in Russian. Anyone to translate it?<br />
<br />
Translation by BableFish - [http://babelfish.yahoo.com/translate_url?doit=done&tt=url&intl=1&fr=bf-home&trurl=http%3A%2F%2Fqtvr.by.ru%2FNewQTWR%2Fsm%2Fsmartblend.htm&lp=ru_en&btnTrUrl=Translate Tutorial in English]<br />
<br />
Welcome to anyone who wants to improve this smartblend, write a tutorial and other.<br />
<br />
<small>(Text taken from original smartblend home page)</small><br />
<br />
[[Category:Software:Platform:Windows]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=SmartBlend&diff=11845SmartBlend2009-09-28T00:23:01Z<p>Drbeams: </p>
<hr />
<div>'''Smartblend''' is {{Glossary|an application for seamless image blending by Michael Norel|1}}. He can be reached at minorlogic{at}yahoo{dot}com<br />
<br />
The main goal of smartblend is panoramic image blending, though it can be used for other applications, such as creation of seamless textures, montage of photos or collage. Smartblend allows stitching of many problematic shots (parallaxed, with moving objects or with differing exposure).<br />
<br />
For example see the parallax picture below (from http://www.htu.at/~sascha/ptguide/01.htm described as "impossible to stitch" )<br />
[[Image:SB_Parallax.jpg|left]]{{clr}}<br />
<br />
Just put one picture into another and note the great difference.<br />
[[Image:SB_Parallax_overlapped.jpg|left]]{{clr}}<br />
<br />
Picture below is blended by smartblend.<br />
[[Image:SB_Blended.jpg|left]]{{clr}}<br />
Another smartblend example: http://www.photodan.com.au/misc/flamchen.htm<br />
<br />
If you don't know what is a "command line application" it can not be useful for you. But you still can use a frontend for smartblend:<br />
<br />
* [[PanoWizard]]<br />
* [[EnblendGUI]]<br />
* [[PTGui]]<br />
* [[PTAssembler]]<br />
<br />
Download SmartBlend, current version [[Media:Smartblend_1_2_5.zip|Smartblend_1_2_5.zip]]<br />
<br />
== How it works ==<br />
<br />
It finds the visual error on overlap region and searches for a seam line with minimal visual error. Than it blends pictures using an algorithm similar to a multiresolution spline.<br />
<br />
To study algorithms and options use “–SeamVerbose” and “-PyramidVerbose” commands.<br />
<br />
There is a [http://qtvr.by.ru/NewQTWR/sm/smartblend.htm good tutorial], but it's available only in Russian. Anyone to translate it?<br />
<br />
Translation by BableFish - [http://babelfish.yahoo.com/translate_url?doit=done&tt=url&intl=1&fr=bf-home&trurl=http%3A%2F%2Fqtvr.by.ru%2FNewQTWR%2Fsm%2Fsmartblend.htm&lp=ru_en&btnTrUrl=Translate]<br />
<br />
Welcome to anyone who wants to improve this smartblend, write a tutorial and other.<br />
<br />
<small>(Text taken from original smartblend home page)</small><br />
<br />
[[Category:Software:Platform:Windows]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=11786Hugin Compiling Ubuntu2009-09-13T06:13:50Z<p>Drbeams: /* Exiftool */</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.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 aptitude install line - aptitude 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 aptitude 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 aptitude search with a substring of the package required, e.g.<br />
<pre>aptitude 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 aptitude.<br />
In a terminal window (K menu -> System -> Konsole or Applications -> Accessories -> Terminal (in Kubuntu), Applications -> Accessories -> Terminal (in Ubuntu))<br />
<br />
<pre>sudo aptitude 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 aptitude install libc6-dev libgcc1<br />
</pre><br />
<br />
For older amd64 environments, the packages have a slightly different name:<br />
<pre>sudo aptitude install libc6-dev-amd64 lib64gcc1<br />
</pre><br />
<br />
To get the bleeding edge we'll need access to the SVN, Mercurial and Bazaar repositories, and for this we need the correct tools:<br />
<br />
<pre><br />
sudo aptitude install subversion mercurial bzr<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 aptitude 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 aptitude 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 />
</pre><br />
<br />
For Ubuntu systems prior to 8.10, you will also need<br />
<br />
<pre>sudo aptitude 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 />
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>sudo make install</pre><br />
<br />
== Building Libpano13 ==<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 />
<pre>sudo aptitude install zlib1g zlib1g-dev libpng12-dev libjpeg62-dev libtiff4-dev</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 />
<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 />
<pre><br />
./bootstrap<br />
</pre><br />
<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 />
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 />
<pre><br />
sudo aptitude 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 [http://wiki.panotools.org/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 />
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 />
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 />
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 />
ls *.deb<br />
sudo dpkg -i hugin-0000.00.0-Linux.deb<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 aptitude install libxml2-dev<br />
</pre><br />
<br />
To build<br />
<pre><br />
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/autopano-sift-C/trunk/ autopano-sift-C<br />
cd autopano-sift-C<br />
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .<br />
make<br />
sudo make install<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 aptitude 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 aptitude 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]<br />
<br />
<pre><br />
tar xvfj panomatic-0.9.4-src.tar.bz2<br />
cd panomatic-0.9.4<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 />
== 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 aptitude 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 aptitude 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 aptitude 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=11785Hugin Compiling Ubuntu2009-09-13T04:28:34Z<p>Drbeams: </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.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 aptitude install line - aptitude 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 aptitude 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 aptitude search with a substring of the package required, e.g.<br />
<pre>aptitude 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 aptitude.<br />
In a terminal window (K menu -> System -> Konsole or Applications -> Accessories -> Terminal (in Kubuntu), Applications -> Accessories -> Terminal (in Ubuntu))<br />
<br />
<pre>sudo aptitude 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 aptitude install libc6-dev libgcc1<br />
</pre><br />
<br />
For older amd64 environments, the packages have a slightly different name:<br />
<pre>sudo aptitude install libc6-dev-amd64 lib64gcc1<br />
</pre><br />
<br />
To get the bleeding edge we'll need access to the SVN, Mercurial and Bazaar repositories, and for this we need the correct tools:<br />
<br />
<pre><br />
sudo aptitude install subversion mercurial bzr<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 aptitude 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 aptitude 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 />
</pre><br />
<br />
For Ubuntu systems prior to 8.10, you will also need<br />
<br />
<pre>sudo aptitude 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 />
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>sudo make install</pre><br />
<br />
== Building Libpano13 ==<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 />
<pre>sudo aptitude install zlib1g zlib1g-dev libpng12-dev libjpeg62-dev libtiff4-dev</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 />
<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 />
<pre><br />
./bootstrap<br />
</pre><br />
<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 />
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 />
<pre><br />
sudo aptitude 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 [http://wiki.panotools.org/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 />
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 />
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 />
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 />
ls *.deb<br />
sudo dpkg -i hugin-0000.00.0-Linux.deb<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 aptitude install libxml2-dev<br />
</pre><br />
<br />
To build<br />
<pre><br />
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/autopano-sift-C/trunk/ autopano-sift-C<br />
cd autopano-sift-C<br />
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .<br />
make<br />
sudo make install<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 aptitude 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 aptitude 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]<br />
<br />
<pre><br />
tar xvfj panomatic-0.9.4-src.tar.bz2<br />
cd panomatic-0.9.4<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 />
== 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 aptitude purge libimage-exiftool-perl<br />
</pre><br />
<br />
<pre><br />
wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-7.83.tar.gz<br />
tar -xzf Image-ExifTool-7.83.tar.gz<br />
cd Image-ExifTool-7.83<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 aptitude 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 aptitude 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>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=11617Hugin Compiling Ubuntu2009-07-17T04:50:24Z<p>Drbeams: /* Exiftool */</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.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 />
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 CVS repositories, and for this we need the correct tools:<br />
<pre> sudo apt-get install subversion cvs<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 />
</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 from CVS (simply press ENTER when prompted for a password on the login command) and build it.<br />
<br />
<pre>cvs -d:pserver:anonymous@enblend.cvs.sourceforge.net:/cvsroot/enblend login<br />
cvs -z3 -d:pserver:anonymous@enblend.cvs.sourceforge.net:/cvsroot/enblend co -P enblend<br />
cd enblend</pre><br />
We are then ready to compile (the CXXFLAGS bit is a workaround for x86_64 systems, Feb 2009).<br />
<pre>make -f Makefile.cvs<br />
CXXFLAGS="--param inline-unit-growth=60" ./configure<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>sudo make install</pre><br />
<br />
== Building Libpano13 ==<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 />
<pre>sudo apt-get install zlib1g zlib1g-dev libpng12-dev libjpeg62-dev libtiff4-dev</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 />
<pre>svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13<br />
cd libpano13<br />
./bootstrap</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 />
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 />
Some additional libraries are needed. We need first to activate the <code>universe</code> repository (in adept package manager, or by editing the /etc/apt/sources.lst file for example). Also, since SVN revision 3479 (8-Oct-2008) a new dependency has been added to libglew.<br />
<pre>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<br />
</pre><br />
Hugin is downloaded from SVN, and built using cmake. 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. Finally, we use make and make install to complete the build.<br />
<br />
<pre><br />
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk/ hugin<br />
cd hugin<br />
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .<br />
make<br />
sudo make install<br />
sudo ldconfig<br />
</pre><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 aptitude install libxml2-dev<br />
</pre><br />
<br />
To build<br />
<pre><br />
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/autopano-sift-C/trunk/ autopano-sift-C<br />
cd autopano-sift-C<br />
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .<br />
make<br />
sudo make install<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]<br />
<br />
<pre><br />
tar xvfj panomatic-0.9.4-src.tar.bz2<br />
cd panomatic-0.9.4<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 />
== 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 aptitude purge libimage-exiftool-perl<br />
</pre><br />
<br />
<pre><br />
wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-7.83.tar.gz<br />
tar -xzf Image-ExifTool-7.83.tar.gz<br />
cd Image-ExifTool-7.83<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 aptitude 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 aptitude 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 />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=11425Hugin Compiling Ubuntu2009-05-13T17:14:50Z<p>Drbeams: /* Exiftool */</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 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 />
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 CVS repositories, and for this we need the correct tools:<br />
<pre> sudo apt-get install subversion cvs<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 />
</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 from CVS (simply press ENTER when prompted for a password on the login command) and build it.<br />
<br />
<pre>cvs -d:pserver:anonymous@enblend.cvs.sourceforge.net:/cvsroot/enblend login<br />
cvs -z3 -d:pserver:anonymous@enblend.cvs.sourceforge.net:/cvsroot/enblend co -P enblend<br />
cd enblend</pre><br />
We are then ready to compile (the CXXFLAGS bit is a workaround for x86_64 systems, Feb 2009).<br />
<pre>make -f Makefile.cvs<br />
CXXFLAGS="--param inline-unit-growth=60" ./configure<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>sudo make install</pre><br />
<br />
== Building Libpano13 ==<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 />
<pre>sudo apt-get install zlib1g zlib1g-dev libpng12-dev libjpeg62-dev libtiff4-dev</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 />
<pre>svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13<br />
cd libpano13<br />
./bootstrap</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 />
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 />
Some additional libraries are needed. We need first to activate the <code>universe</code> repository (in adept package manager, or by editing the /etc/apt/sources.lst file for example). Also, since SVN revision 3479 (8-Oct-2008) a new dependency has been added to libglew.<br />
<pre>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<br />
</pre><br />
Hugin is downloaded from SVN, and built using cmake. 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. Finally, we use make and make install to complete the build.<br />
<br />
<pre><br />
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk/ hugin<br />
cd hugin<br />
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .<br />
make<br />
sudo make install<br />
sudo ldconfig<br />
</pre><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 aptitude install libxml2-dev<br />
</pre><br />
<br />
To build<br />
<pre><br />
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/autopano-sift-C/trunk/ autopano-sift-C<br />
cd autopano-sift-C<br />
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .<br />
make<br />
sudo make install<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]<br />
<br />
<pre><br />
tar xvfj panomatic-0.9.4-src.tar.bz2<br />
cd panomatic-0.9.4<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 />
== 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 aptitude purge libimage-exiftool-perl<br />
</pre><br />
<br />
<pre><br />
wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-7.75.tar.gz<br />
tar -xzf Image-ExifTool-7.75.tar.gz<br />
cd Image-ExifTool-7.75<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 aptitude 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 aptitude 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 />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeamshttps://wiki.panotools.org/index.php?title=Hugin_Compiling_Ubuntu&diff=11405Hugin Compiling Ubuntu2009-04-25T06:30:04Z<p>Drbeams: /* Autopano-sift-C */</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 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 />
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 CVS repositories, and for this we need the correct tools:<br />
<pre> sudo apt-get install subversion cvs<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 />
</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 from CVS (simply press ENTER when prompted for a password on the login command) and build it.<br />
<br />
<pre>cvs -d:pserver:anonymous@enblend.cvs.sourceforge.net:/cvsroot/enblend login<br />
cvs -z3 -d:pserver:anonymous@enblend.cvs.sourceforge.net:/cvsroot/enblend co -P enblend<br />
cd enblend</pre><br />
We are then ready to compile (the CXXFLAGS bit is a workaround for x86_64 systems, Feb 2009).<br />
<pre>make -f Makefile.cvs<br />
CXXFLAGS="--param inline-unit-growth=60" ./configure<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>sudo make install</pre><br />
<br />
== Building Libpano13 ==<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 />
<pre>sudo apt-get install zlib1g zlib1g-dev libpng12-dev libjpeg62-dev libtiff4-dev</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 />
<pre>svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13<br />
cd libpano13<br />
./bootstrap</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 />
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 />
Some additional libraries are needed. We need first to activate the <code>universe</code> repository (in adept package manager, or by editing the /etc/apt/sources.lst file for example). Also, since SVN revision 3479 (8-Oct-2008) a new dependency has been added to libglew.<br />
<pre>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<br />
</pre><br />
Hugin is downloaded from SVN, and built using cmake. 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. Finally, we use make and make install to complete the build.<br />
<br />
<pre><br />
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk/ hugin<br />
cd hugin<br />
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .<br />
make<br />
sudo make install<br />
sudo ldconfig<br />
</pre><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 aptitude install libxml2-dev<br />
</pre><br />
<br />
To build<br />
<pre><br />
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/autopano-sift-C/trunk/ autopano-sift-C<br />
cd autopano-sift-C<br />
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .<br />
make<br />
sudo make install<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]<br />
<br />
<pre><br />
tar xvfj panomatic-0.9.4-src.tar.bz2<br />
cd panomatic-0.9.4<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 />
== 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 aptitude purge libimage-exiftool-perl<br />
</pre><br />
<br />
<pre><br />
wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-7.74.tar.gz<br />
tar -xzf Image-ExifTool-7.74.tar.gz<br />
cd Image-ExifTool-7.74<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 aptitude 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 aptitude 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 />
[[Category:Software:Hugin]]<br />
[[Category:Software:Platform:Linux]]</div>Drbeams