Site Tools


software:osx:scantailor

This is an old revision of the document!


Building scantailor on Mac OSX

This page describes how to install scantailor on Max OSX

Installation of MacPorts on os 10.5.8

If you haven't done so, start reading here: http://guide.macports.org/. The installation of Macports requires the following:

  • Install Xcode tools from your osx installation dvd
  • Install X11 User from the osx installation dvd
  • Download and install MacPorts (1.8.1 - 10.5 Leopard)

Test your installation with

sudo port -v selfupdate

Install qt4-mac

Installing qt4-mac right away gave threw this error:

Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_dbus/work/dbus-1.2.16" && /usr/bin/make -j1 all " returned error 2
Command output: /usr/bin/make  all-recursive
Making all in dbus
/usr/bin/make  all-am
/bin/sh ../libtool --tag=CC   --mode=compile /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I.. -I.. -I..  -fPIC -DDBUS_COMPILATION -DDBUS_MACHINE_UUID_FILE=\""/opt/local/var/lib/dbus/machine-id"\" -DDBUS_SYSTEM_CONFIG_FILE=\""/opt/local/etc/dbus-1/system.conf"\" -DDBUS_SESSION_CONFIG_FILE=\""/opt/local/etc/dbus-1/session.conf"\"  -I/opt/local/include  -O2 -arch ppc -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wdeclaration-after-statement -fno-common -Wno-unused -Wno-sign-compare -Wno-pointer-sign -Wno-format -fno-strict-aliasing -MT dbus-address.lo -MD -MP -MF .deps/dbus-address.Tpo -c -o dbus-address.lo dbus-address.c
../libtool: line 460: CDPATH: command not found
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_dbus/work/dbus-1.2.16/libtool: line 460: CDPATH: command not found
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_dbus/work/dbus-1.2.16/libtool: line 1138: func_opt_split: command not found
libtool: Version mismatch error.  This is libtool 2.2.6, but the
libtool: definition of this LT_INIT comes from an older release.
libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6
libtool: and run autoconf again.
make[3]: *** [dbus-address.lo] Error 63
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: The following dependencies failed to build: dbus jpeg libmng autoconf help2man gettext libiconv gperf ncurses ncursesw p5-locale-gettext perl5 perl5.8 m4 automake lcms tiff zlib libtool libpng openssl sqlite3 readline
Error: Status 1 encountered during processing.

After some google search, I read somewhere that I should install dbus1). So trying to install dbus first:

sudo port install libtool && sudo port clean dbus && sudo port install dbus

When almost finished, the following text appears:

#################################################################################################
# Startup items have been generated that will aid in
# starting dbus with launchd. They are disabled
# by default. Execute the following command to start them,
# and to cause it to launch at startup:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
# launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
##################################################################################################

Then try installing qt4-mac:

sudo port install qt4-mac

Unfortunately this fails due to an old Xcode version:

--->  Verifying checksum(s) for tiff
--->  Extracting tiff
On Mac OS X 10.5, tiff 3.9.1 requires Xcode 3.1 or later but you have Xcode 3.0.
Error: Target org.macports.extract returned: incompatible Xcode version
Error: The following dependencies failed to build: libmng lcms tiff libpng openssl sqlite3 readline
Error: Status 1 encountered during processing.

This Xcode version was installed per default from the original OSX installation dvd. Download the newest Xcode version and install it (It automatically updates the current version). The 10.5 compatible Xcode is a bit hidden away. In the Mac Dev Center → Member Site (in right column); it requires another login. Member Site → Downloads. Download → Developer Tools (In right column).

After having installed Xcode 3.1, continue with qt4-mac. First do a clean:

sudo port clean qt4-mac

Then continue with installing:

sudo port install qt4-mac

During the next 6 hours version 4.5.3_0 will be installed successfully.

Install cmake

sudo port install cmake

After about 20 minutes, version 2.6.4_1 is successfully installed. sudo

Install scantailor

Make a directory:

/Users/Shared/scantailor

Browse into this directory with:

cd /Users/Shared

In that directory in your favorite shell make a local copy of scantailor sources with svn, by entering the svn command to check out the sources2):

svn co https://scantailor.svn.sourceforge.net/svnroot/scantailor scantailor

For now, ignore the fingerprint warning. Just enter t (temporarily)

On a linux machine you would probably do:

cd scantailor
mkdir -p builds/macosx
cd builds/macosx

The process now differs with MacPorts.
With MacPorts type the following:

cmake -G "Unix Makefiles" ../../trunk

This says: use the “Unix Makefiles” generator of cmake. It should say:

  -- Configuring done
  -- Generating done
  -- Build files have been written to: /Users/Shared/scantailor/scantailor/builds/macosx

If you installed Qt using MacPorts, then you may see an error reporting that “Qt4 could not be found”. This is because MacPorts installs qmake with the filename 'qmake-mac'. You can solve this error by creating a symlink:
cd to /opt/local/bin (or wherever you have told MacPorts to install to), then:

sudo ln -s qmake-mac qmake

Go back to your build/macosx directory and try cmake again as above. It should now find qmake.

libboost1.35-dev error #1

Skip this, continue reading to #2.
If you receive an error about missing package named libboost1.35-dev or similarly:

CMake Error at CMakeLists.txt:159 (MESSAGE):
  Could not find boost headers or libraries.

  You may need to install a package named libboost1.35-dev or similarly.

Try to install libsdl with the following command:

sudo port install libsdl

It installed libsdl 1.2.14_8.

libboost1.35-dev error #2

Try to install boost3) with the following command:

sudo port install boost

It installed boost 1.40.0_1+powerpc

Now, if you are not there, go back to your build/macosx directory and try cmake again as above. It should build fine now.

build scantailer

Then perform the build of scantailer with three steps:

make
make install
make macosx_bundle

Now up in /Users/Shared/scantailor, you ought to see a scantailor.app, ready to run.

Packaging scantailor

(See http://www.stellarium.org/wiki/index.php/Compilation_on_Macosx for general info about compiling and packaging for osx) The macosx_bundle target includes a perl script that makes use of otool and install_name_tool to:

  1. read the link dependencies of scantailor.app/Contents/MacOS/scantailor
  2. copy those dependencies into the app (.frameworks and .dylibs)
  3. recurse on those copied-in dependencies, stopping at a point where system libraries are called for

This seems to work for making a relocatable scantailor.app. Making a universal build from here is a matter of taking an intel and a ppc and merging them appropriately.

I've found that making a universal app directly via cmake to not work, even the better mac-supporting 2.6. Any insights appreciated!

To get CMake to do all the packaging and linking above (to take better advantage of cmake 2.6), we need to re-arrange the CMAke properties a bit across all the ports, and this is a somewhat larger undertaking.

Universal Binary

Updating sources

You can check to see if the source code has been updated on the server at any time by going in a terminal window to:

/Users/Shared/scantailor/trunk

And enter the command

svn -u status

Any file that it mentions is either changed locally, or changed on the server (svn help status for details of the output of this command). Unless you are working on the source code yourself, anything mentioned is an update. You can update from this directory also with:

svn update

IMPORTANT: you should delete or move aside the old /Users/Shared/scantailor/scantailor.app before each new build.

software/osx/scantailor.1256154596.txt.gz · Last modified: 2009/10/21 21:49 by admin