Build on OS X

From VipsWiki
Jump to: navigation, search


We've been using gtk-osx to make the OS X binaries in the VIPS supported download area.

We have a OS X build system based on jhbuild that automates the whole process. Check the README.


VIPS is on homebrew. Install homebrew and type:

$ brew tap homebrew/science
$ brew install vips

To verify your vips install, try:

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

This is a good way to get libvips on your system, not so great for nip2.

This will give you a vips with just the basic optional packages, missing things like imagemagick loading, openslide support, 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-imagemagick --with-openexr --with-openslide --with-webp

vips will also work with graphicsmagick, which you may prefer. Swap --with-imagemagick for --with-graphicsmagick to use that library.

If you want to build things outside homebrew which depend on vips, such as ruby-vips, you will need to get your pkg-config 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

To verify that 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


VIPS and nip2 are available via Fink. To install the nip2 end user program, type

fink install nip2

To use VIPS outside of Fink, you'll need the development package libvips31-dev (for VIPS version 7.34.2). The VIPS tools are in libvips-tools. To verify your vips install, try:

$ vips --version
vips-7.34.2-Tue Oct  1 19:42:09 EDT 2013

In order for your project to find the library, add /sw/lib/pkgconfig (replace "/sw" as appropriate for your Fink install root) to the environment variable PKG_CONFIG_PATH:

export PKG_CONFIG_PATH=/sw/lib/pkgconfig:$PKG_CONFIG_PATH

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

$ pkg-config vips --libs
-L/sw/lib -lvips ... a lot of stuff


VIPS and nip2 are in Macports. Follow the install instructions, then:

$ sudo port install vips
$ sudo port install nip2

That will make a nip2 which uses X11 for display. You can make a nip2 that uses the native OS X backend like this:

$ sudo port install nip2 +no_x11 +quartz