Skip to content

Installation on various platforms

John Cupitt edited this page May 20, 2013 · 13 revisions

Installation on various platforms

Common for all systems

libvips

libvips relies on pkg-config, so it likes to be aware of every possible pkg-config path you have. Unfortunately, $PKG_CONFIG_PATH variable has almost never been seen to be set automatically on a bunch of Linux systems and Mac OS X. Workaround here is to add the following line into $/.bash_profile:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig

This hack works perfect, though any solutions from more sysadmin-skilled people would be appreciated.

If you have some alternative paths for pkg_config of libvips or its dependencies, the following commands are your friends:

pkg-config --list-all |grep -i vips
pkg-config --libs vips

Installing libvips to a custom directory for experimental use (install/uninstall easily)

Install to a prefix in your home directory, like this:

./configure --prefix=/home/john/vips
make 
make install

Set these environment variables in your .bashrc:

export VIPSHOME=/home/john/vips
export PATH=$VIPSHOME/bin:$PATH
export LD_LIBRARY_PATH=$VIPSHOME/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$VIPSHOME/lib/pkgconfig:$PKG_CONFIG_PATH

Then if you ever want wipe it and try again:

rm -rf ~/vips

i.e. no uninstalling to do.

See also: https://github.com/jcupitt/libvips/wiki/Install-to-private-prefix

Mac OS X Mountain Lion

Homebrew is the simplest way to install libvips. The ruby-vips README has notes on this.

$ brew tap homebrew/science
$ brew install vips

This will give you a very bare-bones vips, missing things like imagemagick loading, openslide support, FFTs, and so on. To get a list of all the optional dependencies, try:

$ brew info vips

For a full-fat version, try:

$ brew install vips --with-cfitsio --with-fftw --with-imagemagick \
    --with-libexif --with-liboil --with-libtiff --with-little-cms \
    --with-openexr --with-openslide --with-pango

If you want to build things outside homebrew which depend on vips, such as ruby-vips, your pkg-config will need to be working. You need to point pkg-config at the homebrew area, and, additionally, at homebrew's libxml2 area:

In your .profile, add something like:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig

To verify that your vips install is correct and working, try:

$ vips --version
vips-7.32.1-Mon May 20 10:01:38 BST 2013

To verify that your pkg-config is working correctly with vips, try:

$ pkg-config vips --libs
-L/usr/local/Cellar/vips/7.32.1/lib ... a lot of stuff

CentOS 5.5

libvips

Note: The biggest problem of installing latest vips on CentOS5 is that it depends on glib2 of much higher versions than available in CentOS5 repo. Recently John added support for CentOS5 - he took off libvips dependency on higher versions of glib2 - now libvips can be installed without need to upgrade glib2, using just repo's 2.12.3 version.

If you are trying to compile <7.28.8 version, you additionally need to upgrade glib2 to this version - 2.21.6 - I couldn't manage to compile libvips using following glib versions: 2.16, 2.17, 2.32, I advice you version that worked for me (see compilation steps right below)

# For libvips < 7.28.8
wget http://ftp.acc.umu.se/pub/gnome/sources/glib/2.21/glib-2.21.6.tar.gz
tar zxvf glib-2.21.6.tar.gz
cd glib-2.21.6/
./configure
make
make install

And finally

wget -c http://www.vips.ecs.soton.ac.uk/supported/current/vips-7.28.8.tar.gz
tar xzvf vips-7.28.8.tar.gz
cd vips-7.28.8
./configure && make && make install

ruby-vips gem

gem install ruby-vips

Possible problems

Following EXPORT is needed if you will have problems like described here: https://github.com/jcupitt/libvips/issues/20

# https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=VIPSIP;db1e4401.0706
# To run 'gem install vips' once
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
# or for constant use
$ echo "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" >> ~/.bash_profile

If you will see:

1.9.3-p194 :001 > require 'vips'
LoadError: libvips.so.32: cannot open shared object file: No such file or directory

Do this:

$ echo "/usr/local/lib/" >> /etc/ld.so.conf.d/local.conf
$ /sbin/ldconfig

Gentoo

If you are trying to compile the latest vips source from official site, see "Possible problems" section from instructions for CentOS 5.5.