Compiling Libtiff on Ubuntu

libTIFF can be installed via the package repository in Ubuntu, however the most recent version is not currently available in the repository, and the packaged version is missing a key functionality– bigTIFF support which was not available until libTIFF version 4.0 .   Of note there is a quirk in the naming convention in that when you DO install the packaged version, it turns out that the libtiff4  package actually installed libtiff 3.9.2… which is of course a bit confusing..

apt-cache search libtiff # yields

libtiff-tools - TIFF manipulation and conversion tools
libtiff4 - Tag Image File Format (TIFF) library
libtiff4-dev - Tag Image File Format library (TIFF), development files
libtiffxx0c2 - Tag Image File Format (TIFF) library -- C++ interface
libtiff-opengl - TIFF manipulation and conversion tools

But when I run tiffinfo...
tiffinfo 
LIBTIFF, Version 3.9.2
Copyright (c) 1988-1996 Sam Leffler
Copyright (c) 1991-1996 Silicon Graphics, Inc.

So I had to compile from source.. which if your not a computer scientist (I am a Psychiatrist…) can be a bit of a headache.

Obtaining the latest version of libTIFF

These instructions are for an Ubuntu 12.04LTS system, although I have used a similar set of commands on earlier Ubuntu versions.  I am also installing some dependencies so I install libtiff with optional packages.  So I wanted PEG support, zlib support, etc..

NOTE: libtiff can be installed from certain repositories, altthough I occasionally still had issues with ldd not finding the libtiff.so version, of greater annoyance is that libtiff.so.4 != tiff 4.0…. the .so is not linked directly to the version of libtiff…

WITH BASE INSTALL… I only get this options:

Support for external codecs:
ZLIB support: no
Pixar log-format algorithm: no
JPEG support: no
Old JPEG support: no
JPEG 8/12 bit dual mode: no
ISO JBIG support: no
LZMA2 support: no

from the command line:

sudo apt-get install libjpeg-dev liblzma-dev liblz-dev zlib1g-dev
## without installing this the libtiff didn’t have JPEG support lzma
### also needed to install make
sudo apt-get install make g++


wget ftp://ftp.remotesensing.org/pub/libtiff/tiff-4.0.3.tar.gz
tar -zxvf tiff-4.0.3.tar.gz

cd tiff-4.0.3
./configure
## ./configure –prefix=/home/dgutman/ if you don’t have root you can specify where it should place the libraries
make
sudo make install
## after installation I had to run ldconfig manually for tiffinfo to work
sudo ldconfig

NEXT STEP: Build Openslide, IIPServr and VIPS