I'm trying to do the same (avoid 'installing' openexr into the OS directories).
I like to extract the source for each package on my file server, each in a separate dir, so I can build them on various platforms. I like to build them in such a way that they do NOT install themselves onto my build machines, cluttering up the OS, and making it hard to keep multiple versions of packages separate. I prefer these packages install into their own dir on my file server so that the files don't spread out all over the operating system, and stay contained in the same dir as the source code. Then, when building higher level packages, refer them to these directories to find the libs.
The key appears to be
'pkg-config', a tool that both openexr and IM appear to make use of when it exists, which they use to both register themselves (so other packages can link against them) and to find other packages.
For instance, both openexr and IM use pkg-config to register themselves (ie. the compiler flags/lib flags one would need to build against them).
Also, IM uses pkg-config to
find openexr so that it can build against it.
Since Macs don't appear to come with pkg-config, it helps to install pkg-config first, then build the other packages so that they can register themselves and inquire about each other.
So if you build openexr with special flags to install itself
in its own dir, it will tell pkg-config this info. Later when you build IM, it asks pkg-config where openexr is, and it will pass all the correct build info so that IM can find it in the locations you setup.
Without pkg-config, you're kind of 'on your own' to try to figure out what environment variables to set to get the build to fly.. which can be tricky.
As an example, I did the following to build IM with openexr. Note the use of
--prefix `pwd` to ensure the 'make install' doesn't put files outside the build dir. (Note: I first downloaded/installed pkg-info.. I let it install itself into the OS, since it's a global tool.)
1) Download openexr, ilmbase, and IM in separate dirs on my file server (/net/tmp/xxx)
2) Build ilmbase first:
Code: Select all
cd /net/tmp/ilmbase-1.0.1
./configure --prefix `pwd`
make
make install
3) Build openexr next:
Code: Select all
cd /net/tmp/openexr-1.7.0
./configure --prefix=`pwd` --with-ilmbase-prefix=/net/tmp/ilmbase-1.0.1
make
make install
4) Build IM next:
Code: Select all
cd /net/tmp/ImageMagick-6.6.3-9
./configure --prefix=`pwd` --with-openexr=yes
make
make install
This will get you the happy result during IM's configure output:
Code: Select all
..
OpenEXR --with-openexr=yes >> yes <<
..
..which means IM found openexr.