Difference between revisions of "Hugin Compiling Fedora"

From PanoTools.org Wiki
Jump to navigation Jump to search
(Some compilation instructions)
(some better compilation instructions)
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Binary packages ==
 
== Binary packages ==
  
The [[hugin]] and [[enblend]] stable releases are part of default fedora, available via the ''Add/Remove Software'' menu.  Note that there is no [[autopano-sift]] in fedora due to patent issues, but [[autopano-sift-C]] can be found in the [http://rpmfusion.org/ RPM Fusion] 3rd party package repository.
+
The [[hugin]] and [[enblend]] stable releases are part of default fedora, available via the ''Add/Remove Software'' menu.
  
Otherwise, recent-ish hugin snapshots and other panorama-related software can usually be found at the [http://bugbear.postle.net/~bruno/apt/fedora/linux/ fedora panorama repository].  To subscribe just follow this [http://bugbear.postle.net/~bruno/apt/fedora/linux/11/i386/RPMS.panorama/panorama-release-8-1.fc11.noarch.rpm panorama release] link, use the ''Package Installer'' option, and each time you do a ''Software Update'' hugin will be upgraded to the latest snapshot.
+
Otherwise, recent-ish hugin snapshots and other panorama-related software can usually be found at the [http://repos.fedorapeople.org/repos/bpostle/panorama/ fedora panorama repository].  To subscribe just follow this [http://repos.fedorapeople.org/repos/bpostle/panorama/fedora-19/i386/panorama-release-8-2.fc19.noarch.rpm panorama release] link, use the ''Package Installer'' option, and each time you do a ''Software Update'' hugin will be upgraded to the latest snapshot.
  
 
== Compiling ==
 
== Compiling ==
  
If you want to compile hugin yourself, just follow the instructions in the '''INSTALL_cmake''' file, you will need these development packages (October 2009):
+
If you want to compile hugin yourself, just follow the instructions in the '''INSTALL_cmake''' file, you will need these development RPM packages (April 2013):
  
 
   libpano13-devel zlib-devel libtiff-devel libjpeg-devel
 
   libpano13-devel zlib-devel libtiff-devel libjpeg-devel
Line 13: Line 13:
 
   cmake desktop-file-utils OpenEXR-devel gcc-c++ exiv2-devel glew-devel
 
   cmake desktop-file-utils OpenEXR-devel gcc-c++ exiv2-devel glew-devel
 
   freeglut-devel mesa-libGLU-devel libXmu-devel
 
   freeglut-devel mesa-libGLU-devel libXmu-devel
 +
  wxPython tclap-devel python-devel swig flann-devel lensfun-devel
 +
  perl-podlators (needed for fedora 19 and above)
  
To actually use hugin you also need [[enblend]] 3.2 and perl-Image-ExifTool packages.  [[autopano-sift-C]] or [[panomatic]] are useful to automatically generate control points.
+
To actually use hugin you also need make, shared-mime-info, [[enblend]] and perl-Image-ExifTool RPM packages.  [[autopano-sift-C]] or [[panomatic]] are optional now that Hugin has a built-in control point generator.
  
 
Basic compilation instructions are:
 
Basic compilation instructions are:
  
   tar -zxvf hugin-2009.2.0.tar.gz
+
   tar -bxvf hugin-2010.4.0.tar.bz2
   cd hugin-2009.2.0
+
   cd hugin-2010.4.0
 
   mkdir BUILD
 
   mkdir BUILD
 
   cd BUILD
 
   cd BUILD
Line 26: Line 28:
 
   sudo make install
 
   sudo make install
  
This will install Hugin and its libraries to /usr/local, this is the preferred location for any software installed without a package manager. Note that Fedora isn't configured to look in /usr/local for libraries by default, so you may need to add a ''/usr/local/lib'' or ''/usr/local/lib64'' line to the ''/etc/ld.so.conf'' dynamic linker configuration file. Run ''/sbin/ldconfig'' afterwards to update the system.
+
This will install Hugin and its libraries to /usr/local, this is the preferred location for any software installed without a package manager. Note that your fedora system may not actually be configured to make use of the Hugin libraries installed here, so if you get runtime library errors you need to reconfigure your system like so:
  
 +
  sudo echo /usr/local/lib >> /etc/ld.so.conf.d/local.conf
 +
  sudo echo /usr/local/lib64 >> /etc/ld.so.conf.d/local.conf
 +
  sudo ldconfig
  
 +
To build a snapshot of the latest development version from the Mercurial repository the process is similar:
 +
 +
  hg clone http://hugin.hg.sourceforge.net/hgroot/hugin/hugin
 +
  cd hugin
 +
  mkdir BUILD
 +
  cd BUILD
 +
  cmake ..
 +
  make
 +
  sudo make install
  
 
== rpm building instructions ==
 
== rpm building instructions ==
Line 47: Line 61:
 
=== Get a source tarball of hugin ===
 
=== Get a source tarball of hugin ===
  
Either download the current stable .tar.gz file from sourceforge or get the latest from the subversion trunk:
+
Either [http://sourceforge.net/projects/hugin/files/ download the current stable .tar.gz (or tar.bz2) file] from sourceforge or [http://wiki.panotools.org/Hugin_Compiling_Ubuntu#Fetch_the_Source_Code_with_Mercurial get the latest from Mercurial].
 
 
  svn co https://hugin.svn.sourceforge.net/svnroot/hugin/hugin/trunk
 
  cd trunk
 
  cmake .
 
  make package_source
 
  
In future, you only need to update the source tree rather than checking out again:
+
If you have fetched the code via Mercurial you can now create a tarball like so:
  
  cd trunk
+
mkdir BUILD
  svn up
+
cd BUILD
  cmake .
+
cmake ..
  make package_source
+
make package_source
  
'package_source' is a Makefile target, targets are things like 'all' or 'clean' or 'install', this one just creates a tarball.
+
('package_source' is a ''make'' target, targets are things like 'all' or 'clean' or 'install', this one just creates a tarball)
  
 
=== Get a hugin.spec file ===
 
=== Get a hugin.spec file ===
  
Download an existing hugin .src.rpm file and extract the hugin.spec file file by running this command as a normal user:
+
Download an existing hugin .src.rpm file and extract the ''hugin.spec'' file by running this command as a normal user:
  
   rpm -ivh hugin-0.8.0-1.src.rpm
+
   rpm -ivh hugin-2010.2.0-1.src.rpm
  
 
This should put the .spec file where rpmbuild expects to find it.
 
This should put the .spec file where rpmbuild expects to find it.
Line 73: Line 82:
 
   ~/rpmbuild/SPECS/hugin.spec
 
   ~/rpmbuild/SPECS/hugin.spec
  
The next step is to put the .tar.gz where rpmbuild expects to find it:
+
The next step is to put the .tar.bz2 file where rpmbuild expects to find it:
  
   ~/rpmbuild/SOURCES/hugin-2009.1.0.tar.gz
+
   ~/rpmbuild/SOURCES/hugin-2010.4.0.tar.bz2
  
 
..and run rpmbuild to create both the SRPM and RPMS at the same time:
 
..and run rpmbuild to create both the SRPM and RPMS at the same time:
Line 81: Line 90:
 
   rpmbuild -ba ~/rpmbuild/SPECS/hugin.spec
 
   rpmbuild -ba ~/rpmbuild/SPECS/hugin.spec
  
This will fail, probably.  You need to edit the .spec file to change the 'Version' entry to match the current number, add dependencies such as 'freeglut-devel' to the list of 'BuildRequires' that are missing, install any missing build dependency rpms, and try again.
+
This will fail, probably.  You need to edit the .spec file to change the 'Version:' entry to match the number of the tarball, install any missing build dependency rpms, and try again.
  
 
== Building with mock ==
 
== Building with mock ==
Line 104: Line 113:
 
[[Category:Software:Platform:Linux]]
 
[[Category:Software:Platform:Linux]]
 
[[Category:Software:Hugin]]
 
[[Category:Software:Hugin]]
 +
[[Category:Software:Hugin:Compiling]]

Revision as of 21:45, 29 April 2013

Binary packages

The hugin and enblend stable releases are part of default fedora, available via the Add/Remove Software menu.

Otherwise, recent-ish hugin snapshots and other panorama-related software can usually be found at the fedora panorama repository. To subscribe just follow this panorama release link, use the Package Installer option, and each time you do a Software Update hugin will be upgraded to the latest snapshot.

Compiling

If you want to compile hugin yourself, just follow the instructions in the INSTALL_cmake file, you will need these development RPM packages (April 2013):

 libpano13-devel zlib-devel libtiff-devel libjpeg-devel
 libpng-devel gettext-devel wxGTK-devel boost-devel
 cmake desktop-file-utils OpenEXR-devel gcc-c++ exiv2-devel glew-devel
 freeglut-devel mesa-libGLU-devel libXmu-devel
 wxPython tclap-devel python-devel swig flann-devel lensfun-devel
 perl-podlators (needed for fedora 19 and above)

To actually use hugin you also need make, shared-mime-info, enblend and perl-Image-ExifTool RPM packages. autopano-sift-C or panomatic are optional now that Hugin has a built-in control point generator.

Basic compilation instructions are:

 tar -bxvf hugin-2010.4.0.tar.bz2
 cd hugin-2010.4.0
 mkdir BUILD
 cd BUILD
 cmake ..
 make
 sudo make install

This will install Hugin and its libraries to /usr/local, this is the preferred location for any software installed without a package manager. Note that your fedora system may not actually be configured to make use of the Hugin libraries installed here, so if you get runtime library errors you need to reconfigure your system like so:

 sudo echo /usr/local/lib >> /etc/ld.so.conf.d/local.conf
 sudo echo /usr/local/lib64 >> /etc/ld.so.conf.d/local.conf
 sudo ldconfig

To build a snapshot of the latest development version from the Mercurial repository the process is similar:

 hg clone http://hugin.hg.sourceforge.net/hgroot/hugin/hugin
 cd hugin
 mkdir BUILD
 cd BUILD
 cmake ..
 make
 sudo make install

rpm building instructions

The source RPM package contains an hugin.spec file which is both the build documentation and the script for an automated build (other linux packaging systems work basically the same way).

fedora configuration

First set up your fedora system for building rpms, install some packages (as root):

 yum groupinstall "Development Tools"
 yum install rpmdevtools

Using a normal user account create a build tree, by default this is ~/rpmbuild:

 rpmdev-setuptree

Get a source tarball of hugin

Either download the current stable .tar.gz (or tar.bz2) file from sourceforge or get the latest from Mercurial.

If you have fetched the code via Mercurial you can now create a tarball like so:

mkdir BUILD
cd BUILD
cmake ..
make package_source

('package_source' is a make target, targets are things like 'all' or 'clean' or 'install', this one just creates a tarball)

Get a hugin.spec file

Download an existing hugin .src.rpm file and extract the hugin.spec file by running this command as a normal user:

 rpm -ivh hugin-2010.2.0-1.src.rpm

This should put the .spec file where rpmbuild expects to find it.

 ~/rpmbuild/SPECS/hugin.spec

The next step is to put the .tar.bz2 file where rpmbuild expects to find it:

 ~/rpmbuild/SOURCES/hugin-2010.4.0.tar.bz2

..and run rpmbuild to create both the SRPM and RPMS at the same time:

 rpmbuild -ba ~/rpmbuild/SPECS/hugin.spec

This will fail, probably. You need to edit the .spec file to change the 'Version:' entry to match the number of the tarball, install any missing build dependency rpms, and try again.

Building with mock

'mock' is a more sophisticated system for creating RPMS, it is possible to build multiple architectures and create packages for different releases of fedora and redhat enterprise linux on a single fedora system.

Install mock as root and add yourself to the 'mock' group (use your user name, not 'myusername'):

 yum install mock
 usermod -a -G mock myusername

Follow the instructions above for creating rpms, but just create the source rpm instead:

 rpmbuild -bs ~/rpmbuild/SPECS/hugin.spec

Then you can build rpms from this src.rpm with mock like so:

 mock -r fedora-11-i386 rebuild ~/rpmbuild/SRPMS/hugin-2009.1.0-0.src.rpm

The first time you do this it will take a very long time while it downloads and assembles a 'virtual' machine, but subsequent builds will only take a few minutes.