Skip to content

Getting OpenEXR in OS X

benjamin-heasly edited this page Dec 19, 2014 · 6 revisions

RenderToolbox3 uses the OpenEXR library for reading high-dynamic range, multi-channel exr images.

On OS X we used to recommend installing the OpenEXR using MacPorts. Several of us had problems with this installation under OS X 10.9 and above.

Homebrew seems to work better. As of December 2014, the build script for our MakeReadMultichannelEXR mex-function now favors the Homebrew installation location over MacPorts.

OpenEXR First-Time Install

If you are a new user, you are in luck. Just install Homebrew, then install OpenEXR:

brew install openexr

Then in Matlab you should be able to do:

MakeReadMultichannelEXR

And you're done.

OpenEXR Non-First-Time Install

If are a current user and you need to fix an existing installation of OpenEXR, perhaps installed by MacPorts, you might have to do a little extra work.

For me (Ben) I had to remove a bunch of existing symbolic links that Homebrew wanted to write over. The process went something like this:

brew install openexr

Install mostly works, but Homebrew fails to create links. OK, so show me the conflicting links:

brew link --overwrite --dry-run openexr

Now delete the conflicting links by hand (this might look a bit different on your machine):

sudo rm -rf /usr/local/include/OpenEXR/
sudo rm /usr/local/share/aclocal/openexr.m4
sudo rm /usr/local/lib/pkgconfig/OpenEXR.pc
sudo rm /usr/local/lib/libIlmImf.dylib 
sudo rm /usr/local/lib/libIlmImf.a

Now let Homebrew re-create those same links the way it wants:

brew link --overwrite openexr
brew link --overwrite ilmbase

Now it works!

MakeReadMultichannelEXR
Clone this wiki locally