Difference between revisions of "Autopano-sift-C Compiling OSX"

From PanoTools.org Wiki
Jump to navigation Jump to search
(→‎Building environment: Check for Xcode installation first, 2nd choice Installation DVD, 3rd choice download)
(→‎Building environment: there is no DVD any more for Xcode)
 
(9 intermediate revisions by 6 users not shown)
Line 4: Line 4:
  
 
The very first thing you'll have to do is to set up the environment. Please follow the order in which items are presented:
 
The very first thing you'll have to do is to set up the environment. Please follow the order in which items are presented:
# Make sure you have Xcode installed: go to the Finder and type Apple+Shift+G (the shortcut for "go to folder..."). In the the dialog insert "/Developer/" (without the quotes).<br />If the folder ''Developer'' opens, Xcode is already installed on your system (it's in Developer/Applications/) and you can skip to the next point.<br />If not, look for the installation DVD of that system version and install Xcode.<br />If that option isn't available, [http://developer.apple.com/tools/download/ download] and install the Xcode Tools version for the operating system on the machine that you will use for the building job. A free registration is required. Be warned that the download is huge (>1 GB).
+
 
# [http://metissian.com/projects/macosx/subversion/ Download] and install subversion (latest stable). This is only needed if you don't use Mac OS X 10.5 Leopard.
+
# Make sure you have Xcode installed: go to the Finder and type Apple+Shift+G (the shortcut for "go to folder..."). In the the dialog insert "/Developer/" (without the quotes).<br />If the folder ''Developer'' opens, Xcode is already installed on your system (it's in Developer/Applications/) and you can proceed to the next step.<br />If not install Xcode.<br />If that option isn't available, [http://developer.apple.com/tools/download/ download] and install the Xcode Tools version for the operating system on the machine that you will use for the building job. A free registration is required. Be warned that the download is huge (>1 GB).
 +
# If you already use Mac OS X 10.5 (Leopard) you can skip this step, otherwise [http://metissian.com/projects/macosx/subversion/ download] and install subversion (latest stable). Follow the suggestions of the Readme file and tell your system to have a look at /usr/local/bin. If you don't know how to use terminal to edit these files directly just use [http://www.barebones.com/products/textwrangler/ TextWrangler]. In TextWrangler, make sure you selected "Install Command Line Tools..." from the ''Menu: TextWrangler''. Back in terminal type<pre>edit /etc/profile</pre>The file will now open in TextWrangler. Look for the line that starts with ''PATH'' and make sure it contains the string ":/usr/local/bin" (without the quotes). Save and close the file, and do the same with /etc/csh.login, i.e. type <pre>edit /etc/csh.login</pre> in the terminal. Save and restart the Mac. Again back in terminal to test the installation, type<pre>svn cat http://svn.collab.net/repos/svn/trunk/README</pre>This should show the README file directly from subversions server.
 
# [http://www.macports.org/install.php Download] and install MacPorts from the appropriate .dmg from those listed at the top.
 
# [http://www.macports.org/install.php Download] and install MacPorts from the appropriate .dmg from those listed at the top.
  
Line 16: Line 17:
 
This is gonna take a while, so grab a book and wait for macports to finish.
 
This is gonna take a while, so grab a book and wait for macports to finish.
  
== Building libpano ==  
+
== Building libpano from SVN==  
If you did everything right, the following should go smoothly:
+
If you did everything right, you need to perform the following steps:
 
<pre>cd /usr/
 
<pre>cd /usr/
 
mkdir src
 
mkdir src
 
cd src
 
cd src
 
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13
 
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13
cd libpano13
+
cd libpano13</pre>
./bootstrap
+
Currently the bootstrap script is based on libtoolize whereas OSX uses glibtoolize, so you need to edit the bootstrap script. Open bootstrap in your favorite editor and change LIBTOOLIZE=${LIBTOOLIZE:-libtoolize} to LIBTOOLIZE=${LIBTOOLIZE:-glibtoolize}.
./configure
+
Now you can build libpano with the following commands:
 +
<pre>./bootstrap
 +
./configure --with-jpeg=/opt/local/ --with-tiff=/opt/local/ --with-png=/opt/local/
 
make
 
make
 
sudo make install</pre>
 
sudo make install</pre>
Line 31: Line 34:
 
Now we can finally build autopano
 
Now we can finally build autopano
 
<pre>cd /usr/src/
 
<pre>cd /usr/src/
svn co https://hugin.svn.sourceforge.net/svnroot/hugin/autopano-sift-C/trunk/ autopano-sift-C
+
hg clone http://hugin.hg.sourceforge.net/hgweb/hugin/autopano-sift-C autopano-sift-C
cd autopano-sift-C
+
mkdir autopano-sift-C-build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local
+
cd autopano-sift-C-build
 +
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../autopano-sift-C
 
make
 
make
 
sudo make install</pre>
 
sudo make install</pre>
 +
 +
If your build fails on Snow Leopard with this error (might happen only after upgrade from Leopard):
 +
<blockquote>
 +
<pre>
 +
Linking C executable autopano
 +
ld: library not found for -lcrt1.10.6.o
 +
</pre>
 +
</blockquote>
 +
try this before <code>make</code>:
 +
<blockquote>
 +
<pre>
 +
export MACOSX_DEPLOYMENT_TARGET=10.5
 +
</pre>
 +
</blockquote>
 +
 +
[[Category:Software:Platform:Mac OS X]]

Latest revision as of 11:54, 6 December 2022

Building environment

Important note: before you begin, a little note of warning. Be advised that even if the procedures described here are all (somehow) verified, nobody can assure you that everything will go fine, especially that the compiled software will behave perfectly, since it's an in-development version.

The very first thing you'll have to do is to set up the environment. Please follow the order in which items are presented:

  1. Make sure you have Xcode installed: go to the Finder and type Apple+Shift+G (the shortcut for "go to folder..."). In the the dialog insert "/Developer/" (without the quotes).
    If the folder Developer opens, Xcode is already installed on your system (it's in Developer/Applications/) and you can proceed to the next step.
    If not install Xcode.
    If that option isn't available, download and install the Xcode Tools version for the operating system on the machine that you will use for the building job. A free registration is required. Be warned that the download is huge (>1 GB).
  2. If you already use Mac OS X 10.5 (Leopard) you can skip this step, otherwise download and install subversion (latest stable). Follow the suggestions of the Readme file and tell your system to have a look at /usr/local/bin. If you don't know how to use terminal to edit these files directly just use TextWrangler. In TextWrangler, make sure you selected "Install Command Line Tools..." from the Menu: TextWrangler. Back in terminal type
    edit /etc/profile
    The file will now open in TextWrangler. Look for the line that starts with PATH and make sure it contains the string ":/usr/local/bin" (without the quotes). Save and close the file, and do the same with /etc/csh.login, i.e. type
    edit /etc/csh.login
    in the terminal. Save and restart the Mac. Again back in terminal to test the installation, type
    svn cat http://svn.collab.net/repos/svn/trunk/README
    This should show the README file directly from subversions server.
  3. Download and install MacPorts from the appropriate .dmg from those listed at the top.

Getting the dependencies

Open a terminal window (you can find terminal.app inside Applications/utilities)

  1. First we'll update the ports (you will be asked for your password)
sudo port -d sync
  1. Then we make macports fetch, compile and install all the necessary stuff for libpano/autopano.
sudo port install cmake libtool jpeg tiff libpng

This is gonna take a while, so grab a book and wait for macports to finish.

Building libpano from SVN

If you did everything right, you need to perform the following steps:

cd /usr/
mkdir src
cd src
svn co https://panotools.svn.sourceforge.net/svnroot/panotools/trunk/libpano libpano13
cd libpano13

Currently the bootstrap script is based on libtoolize whereas OSX uses glibtoolize, so you need to edit the bootstrap script. Open bootstrap in your favorite editor and change LIBTOOLIZE=${LIBTOOLIZE:-libtoolize} to LIBTOOLIZE=${LIBTOOLIZE:-glibtoolize}. Now you can build libpano with the following commands:

./bootstrap
./configure --with-jpeg=/opt/local/ --with-tiff=/opt/local/ --with-png=/opt/local/
make
sudo make install

Building autopano-sift-c

Now we can finally build autopano

cd /usr/src/
hg clone http://hugin.hg.sourceforge.net/hgweb/hugin/autopano-sift-C autopano-sift-C
mkdir autopano-sift-C-build
cd autopano-sift-C-build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../autopano-sift-C
make
sudo make install

If your build fails on Snow Leopard with this error (might happen only after upgrade from Leopard):

Linking C executable autopano
ld: library not found for -lcrt1.10.6.o

try this before make:

export MACOSX_DEPLOYMENT_TARGET=10.5