Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

This branch is 11 commits behind nickrasmussen:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


OpenEXR: CodeWarrior for Macintosh                                   3-11-2003

This document describes how to use the accompanying CodeWarrior
projects and supporting files to build the OpenEXR project using
CodeWarrior for the Macintosh.  CodeWarrior Pro 8.3 was the
development environment used.

The CodeWarrior projects are distributed separately from the OpenEXR
source code due to their size.  Before building, make sure the
OpenEXR_MacCodeWarrior/ directory containing these projects lives in
the same directory as the top-level OpenEXR/ directory, i.e. your
directory listing should look something like this:

% ls
OpenEXR_MacCodeWarrior/  OpenEXR/

The CodeWarrior projects, and this document, were created by Paul
Schneider (  If you have questions, please post them to
the OpenEXR developer's mailing list (; your
question and its answer will reach the most people this way.

NOTE: this release does not contain a project for building the
"exrdisplay" sample application with CodeWarrior.

Step 1: Automatically Generated Header Files

The Half module of OpenEXR supplies two header files, eLut.h and
toFloat.h, whose contents vary based on machine and compiler.
Therefore, these files are automatically generated as part of the
build process.

When using the make system, this happens automatically.  With
CodeWarrior, this step must currently be done manually.  It may be
possible to automate this step using nested subprojects and the "shell
tool" postlinker, but this has not been researched at this time.

1) navigate to OpenEXR_MacCodeWarrior/AutoHeaders/eLut
2) open eLut.mcp in CodeWarrior
3) choose your target.

If you will be using the Metrowerks Mach-O compiler:

4) choose the "Mach-O C++ Console Debug" target
5) build the project (Cmd-M)
6) from the shell, run the resulting executable (eLut_macho) and pipe
   the output into the file "eLut.h".  For example:
   unix> cd OpenEXR_MacCodeWarrior/AutoHeaders/eLut
   unix> ./eLut_macho > ../../../OpenEXR/Half/eLut.h
If you will be using the Metrowerks CFM compiler:

4) choose the "Carbon C++ Console Debug" target
5) build and run the project (Cmd-R)
6) after the program has run, save the output (File->Save As...) as

7) repeat steps 1-6 with the toFloat project.  Save the output as "toFloat.h".

NOTE: the Carbon and Mach-O targets currently produce identical
output; however, this may change in the future, so to be safe use the
compiler which you plan to use to build your own code.

Step 2: Building Confidence Tests

OpenEXR comes with "confidence tests"; standalone programs which put
the OpenEXR library through its paces and make sure everything is
working as expected.

The confidence tests project is set up to build all projects which it
depends on, including the OpenEXR libraries.  The easiest way to build
everything you need for developing with OpenEXR is just to build the
confidence tests.

1) navigate to OpenEXR_MacCodeWarrior/ConfidenceTests
2) open "ExrTests.mcp"
3) select either "Build All Carbon" or "Build All Mach-O", depending
   on your needs 
4) build the project (Cmd-M)

As part of the build process, one of the following libraries will be


This is the static library you should link into your own code.

Step 3: Running Confidence Tests

Now that you've built the confidence tests, you'll want to run them to
make sure everything is working as expected.  There are 3 confidence
tests: IexTest, IlmImfTest, and ImathTest.  These programs are
installed in the following directories:


Simply run the three programs (from the terminal if you built with
Mach-O, or by double-clicking in the Finder if you built with Carbon):
if they do not die with an assertion, the tests have passed.

Integrating OpenEXR with your code

Your target settings need to be set pretty much exactly like the
projects for the exrlib and confidence test projects.  In particular,
you'll want to copy the access paths to the core EXR headers, and turn
"Always Search User Paths" on (or alternatively, add these paths to
your system paths).  You will also want to include the ExrLib.prefix
file as part of your prefix file.  If you get in trouble, refer to the
confidence test projects.

Open Issues

The following are some areas where this install could be improved.

- AutoHeaders require manual compiling.  As mentioned before, it may
  be possible to automate this process, perhaps with the shell-script
  postlinker or some other custom postlinker.
- Template definitions are included in the headers.  This makes it
  necessary to turn off linker warnings about multiply-defined
  symbols.  It could be that the "ISO C++ Template Parser" option in
  Pro 8 fixes this.
- The EXR libraries are built as static libraries.  It's probably
  possible to create shared libraries, for those who prefer to work
  that way.


OpenEXR uses the free software zlib to compress image files.  When
targeting Mach-O, these projects use the copy of zlib that comes with
OS X.  When targeting Carbon, you will need to build a copy of zlib
using CodeWarrior.  The zlib source is not included with OpenEXR for
licensing reasons, but a CodeWarrior project has been provided to
build the library.  Simply download the zlib source from and install it in the
OpenEXR_MacCodeWarrior/zlib folder.  

Something went wrong with that request. Please try again.