[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Openexr-devel] notes: OpenEXR-1.0.6 + OSX + ProjectBuilder
From: |
Scott Frankel |
Subject: |
[Openexr-devel] notes: OpenEXR-1.0.6 + OSX + ProjectBuilder |
Date: |
Sun, 19 Oct 2003 20:30:37 -0700 |
These notes were taken from my experiences with OpenEXR on MacOSX,
using Apple's ProjectBuilder IDE. I'm sure there are more elegant
solutions to the various issues addressed below. Nontheless, these
steps yielded a successful build of the example program.
Happy exring -
Scott
Versions
MacOSX v10.2.6
OpenEXR 1.0.6
ProjectBuilder v2.1
GCC v3.1
Build & Install OpenEXR libraries and header files
- as root:
% ./configure --enable-osx-istream-hack --enable-shared=no
% make
% make install
- API header hacks: disable win32 compatibility
Comment-out the win32 compatibility term, "restrict," from
ImathMatrix.h; i.e.:
[near line 2356]
#if defined (PLATFORM_WIN32)
#define restrict
#endif
/*
register const T * restrict ap = &a.x[0][0];
register const T * restrict bp = &b.x[0][0];
register T * restrict cp = &c.x[0][0];
*/
register const T * ap = &a.x[0][0];
register const T * bp = &b.x[0][0];
register T * cp = &c.x[0][0];
register T a0, a1, a2, a3;
- example program header hacks: explicit casts to float
<no matching function for call to 'max(float, double)'>
Explicitly cast 2nd arg to float in drawImage.cpp:
[line 92]
void
sp (Array2D<Rgba> &px, int w, int h,
float xc, float yc, float rc,
float rd, float gn, float bl, float lm)
{
int x1 = int (max (floor (xc - rc), float (0.0) ));
int x2 = int (min (ceil (xc + rc), float (w - 1.0) ));
int y1 = int (max (floor (yc - rc), float (0.0) ));
int y2 = int (min (ceil (yc + rc), float (h - 1.0) ));
[and line 138]
void
zsp (Array2D<half> &gpx, Array2D<float> &zpx, int w, int h,
float xc, float yc, float zc, float rc, float gn)
{
int x1 = int (max (floor (xc - rc), float (0.0) ));
int x2 = int (min (ceil (xc + rc), float (w - 1.0) ));
int y1 = int (max (floor (yc - rc), float (0.0) ));
int y2 = int (min (ceil (yc + rc), float (h - 1.0) ));
For ProjectBuilder
- In a shell window, make a symbolic link to /usr/ in the project's
working directory. The MacOSX file Open|Save browser can't find
BSD-specific directories. The symlink lets you navigate to
/usr/lib
and /usr/local/OpenEXR from the cwd to import headers and lib
files.
% ln -s /usr/ yoozer
- To prevent ImathMath.h float variable errors, this string must be
added
to the Target's GCC Compiler Settings tab's "Other C Compiler
Flags"
field. Note that the "-" is significant.
-DPLATFORM_DARWIN_PPC
- prevent undefined symbol errors, "_compress" & "_uncompress"
Add /usr/lib/libz.dylib to the project's External Frameworks and
Libraries group.
- prevent undefined symbol errors
Set the link order of the library files so that libz is linked
before
liblex.
- [Openexr-devel] notes: OpenEXR-1.0.6 + OSX + ProjectBuilder,
Scott Frankel <=