We are living as nomad in Mexico !!

Install LibTIFF

You can see the following
  • What is the overview of LibTIFF
  • How to install LibTIFF

Table of contents

Overview

TIFF is Tag Image File Format, which is used for storing image data.
LibTIFF supports for reading and writing TIFF.

Official Website http://www.libtiff.org
Mirror Download Site https://download.osgeo.org/libtiff/
Windows Binarie https://gnuwin32.sourceforge.net/packages/tiff.htm

Install LibTIFF on CentOS / Ubuntu

console
> sudo apt update -y
> sudo sudo install -y libtiff-dev libtiff-tools
> apt list --installed 'libtiff*'
Listing... Done
libtiff-dev/jammy-updates,jammy-security,now 4.3.0-6ubuntu0.5 amd64 [installed]
libtiff-tools/jammy-updates,jammy-security,now 4.3.0-6ubuntu0.5 amd64 [installed]
libtiff5/jammy-updates,jammy-security,now 4.3.0-6ubuntu0.5 amd64 [installed,automatic]
libtiffxx5/jammy-updates,jammy-security,now 4.3.0-6ubuntu0.5 amd64 [installed,automatic]

Install LibTIFF on MacOS

console
> brew install libtiff
> brew list libtiff
/usr/local/Cellar/libtiff/4.5.1/bin/fax2ps
/usr/local/Cellar/libtiff/4.5.1/bin/fax2tiff
/usr/local/Cellar/libtiff/4.5.1/bin/pal2rgb
/usr/local/Cellar/libtiff/4.5.1/bin/ppm2tiff
/usr/local/Cellar/libtiff/4.5.1/bin/raw2tiff
/usr/local/Cellar/libtiff/4.5.1/bin/tiff2bw
/usr/local/Cellar/libtiff/4.5.1/bin/tiff2pdf
/usr/local/Cellar/libtiff/4.5.1/bin/tiff2ps
/usr/local/Cellar/libtiff/4.5.1/bin/tiff2rgba
/usr/local/Cellar/libtiff/4.5.1/bin/tiffcmp
/usr/local/Cellar/libtiff/4.5.1/bin/tiffcp
/usr/local/Cellar/libtiff/4.5.1/bin/tiffcrop
/usr/local/Cellar/libtiff/4.5.1/bin/tiffdither
/usr/local/Cellar/libtiff/4.5.1/bin/tiffdump
/usr/local/Cellar/libtiff/4.5.1/bin/tiffinfo
/usr/local/Cellar/libtiff/4.5.1/bin/tiffmedian
/usr/local/Cellar/libtiff/4.5.1/bin/tiffset
/usr/local/Cellar/libtiff/4.5.1/bin/tiffsplit
/usr/local/Cellar/libtiff/4.5.1/include/ (5 files)
/usr/local/Cellar/libtiff/4.5.1/lib/libtiff.6.dylib
/usr/local/Cellar/libtiff/4.5.1/lib/libtiffxx.6.dylib
/usr/local/Cellar/libtiff/4.5.1/lib/pkgconfig/libtiff-4.pc
/usr/local/Cellar/libtiff/4.5.1/lib/ (4 other files)
/usr/local/Cellar/libtiff/4.5.1/share/doc/ (358 files)
/usr/local/Cellar/libtiff/4.5.1/share/man/ (79 files)

Install LibTIFF from source code

Configure Option

--prefix=PREFIX install architecture-independent files in PREFIX

Build for CentOS / Ubuntu / MacOS

* When installing version 4.4.0

console
> cd /usr/local/src
> wget https://download.osgeo.org/libtiff/tiff-4.4.0.tar.gz
> tar xvfz tiff-4.4.0.tar.gz
> cd tiff-4.4.0
> sudo ./configure --prefix=/usr/local/libtiff/4_4_0
> sudo make
> sudo make install
> ls /usr/local/libtiff/4_4_0/
bin  include  lib  share

Create Symbolic Link

Create symbolic links into "/usr/local/bin".

console
> ln -s /usr/local/libtiff/4_4_0/bin/fax2ps /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/fax2tiff /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/pal2rgb /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/ppm2tiff /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/raw2tiff /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiff2bw /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiff2pdf /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiff2ps /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiff2rgba /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiffcmp /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiffcp /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiffcrop /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiffdither /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiffdump /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiffinfo /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiffmedian /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiffset /usr/local/bin/
> ln -s /usr/local/libtiff/4_4_0/bin/tiffsplit /usr/local/bin/

Create symbolic links into "/usr/local/include".

console
> ln -s /usr/local/libtiff/4_4_0/include/tiff.h /usr/local/include/
> ln -s /usr/local/libtiff/4_4_0/include/tiffconf.h /usr/local/include/
> ln -s /usr/local/libtiff/4_4_0/include/tiffio.h /usr/local/include/
> ln -s /usr/local/libtiff/4_4_0/include/tiffio.hxx /usr/local/include/
> ln -s /usr/local/libtiff/4_4_0/include/tiffvers.h /usr/local/include/

Create symbolic links into "/usr/local/lib".

console
> ln -s /usr/local/libtiff/4_4_0/lib/libtiff.a /usr/local/lib/
> ln -s /usr/local/libtiff/4_4_0/lib/libtiff.la /usr/local/lib/
> ln -s /usr/local/libtiff/4_4_0/lib/libtiff.so /usr/local/lib/
> ln -s /usr/local/libtiff/4_4_0/lib/libtiff.so.5 /usr/local/lib/
> ln -s /usr/local/libtiff/4_4_0/lib/libtiff.so.5.8.0 /usr/local/lib/
> ln -s /usr/local/libtiff/4_4_0/lib/libtiffxx.a /usr/local/lib/
> ln -s /usr/local/libtiff/4_4_0/lib/libtiffxx.la /usr/local/lib/
> ln -s /usr/local/libtiff/4_4_0/lib/libtiffxx.so /usr/local/lib/
> ln -s /usr/local/libtiff/4_4_0/lib/libtiffxx.so.5 /usr/local/lib/
> ln -s /usr/local/libtiff/4_4_0/lib/libtiffxx.so.5.8.0 /usr/local/lib/

Create symbolic links into "/usr/local/pkgconfig".

console
> ln -s /usr/local/libtiff/4_4_0/lib/pkgconfig/libtiff-4.pc /usr/local/lib/pkgconfig/

Set Environment Variable

Setting LD_LIBRARY_PATH and PKG_CONFIG_PATH variables is useful when building or executing other sources.
When copying or creating a symbolic link the library installed under /usr/local, it is recommended to set it.

console
> vim ~/.bash_profile
.bash_profile
...
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
...

If you want to load shared libraries in the system, create a file which is wrote "/usr/local/lib" under /etc/ld.so.conf.d.

console
> sudo echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf
> sudo ldconfig
> sudo ldconfig -v
/usr/local/lib: (from /etc/ld.so.conf.d/libc.conf:2)
        libtiff.so.5 -> libtiff.so.5.8.0
        libtiffxx.so.5 -> libtiffxx.so.5.8.0

🌟The author of this article is:🌟

Kakeru profile

Kakeru Sato

Software Developer

Full stack engineer