Skip to content

Installation on various platforms

stanislaw edited this page Aug 19, 2012 · 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

Mac OS X Lion

libvips - brew vs macports vs native OS X distributed packages.

The key problem when compiling the latest libvips on Mac OS X is that it very often doesn't pick up the right packages you need for build, especially native OS X packages. For example, libvips ./configure finishes with PNG support disabled and attempt to brew install libpng gives the following output:

$ brew install libpng
Error: No available formula for libpng
Apple distributes libpng with OS X, you can find it in /usr/X11/lib.
However not all build scripts look here, so you may need to call ENV.x11
in your formula's install function.

Possible solution for libpng in this case: download official libpng .dmg package, and then continue configuring vips with png support enabled.

Here is the list of packages which are known to cause problems:

  • libpng - can be resolved by installing libpng .dmg package from official site.
  • gettext - libvips can somehow do not recognize gettext brew installation. So the following addition to libvips configuration may be needed:
LDFLAGS=-L/usr/local/Cellar/gettext/0.18.1.1/lib CPPFLAGS=-I/usr/local/Cellar/gettext/0.18.1.1/include ./configure
  • pangoft2 - freetype, fontconfig should be installed and recognized. /usr/X11/lib/pkgconfig should be included into $PKG_CONFIG_PATH see ('Common for all systems section').

  • Strange Segmentation fault [BUG], two similar reports on https://github.com/jcupitt/ruby-vips/issues/17 - disappeared after switching to brew (almost completely, ~10 macports core packages were left: like perl5, libtool, libffi, zlib).

History of resolving these or similar problems can be found among the closed issues on ruby-vips tracker: #24 and others.

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.

Clone this wiki locally