26 December 2011

OpenEXR with MinGW

I'm planning on updating my largest compile endeavor of err GTKGraphics Suite 2.0 however inkscape 0.49 seems take a bit more time (they are waiting for cairo 1.10.3?) obviously I'm reluctant to make inkscape 0.48.x build as it was the slowest before 0.49 (refactoring release). Then I'm thrilled that nip2 finally can directly open exr without crashing (no need to manually convert into .v image first).

However I wonder why openexr can't use pthreads under MinGW (note: I'm using pthread-win32 2.9) which I follow this build guide previously. Have a look at the following headers on IlmBase 1.0.1 (also in 1.0.2):
IlmThread.h, IlmThreadMutex.h, IlmThread and IlmThreadSemaphore.h

Clearly there is #ifdefs discrepancies..
Since openexr assume there is no pthread in win32/win64 platform but MinGW have it and automatically enabled during configure. Here is my patch for that issue, we also might need to add include string.h in some source files but that depends on which w32api version.

then for b44ExpLogTable issue we can add this line in our buildscript after make clean and before make install:

cd IlmImf
g++ $CFLAGS $(pkg-config --cflags
IlmBase) b44ExpLogTable.cpp -o b44ExpLogTable $(pkg-config --libs IlmBase)
cd $SRCS/openexr


For openexr 1.7.0 we need to commenting out #define ZLIB_WINAPI in ImfZipCompressor.cpp & ImfPxr24Compressor.cpp, version 1.6.1 doesn't have this yet.

In the end when we do make check, we should be able to pass all tests like my logs here

And as usual I use my own MinGW toolchains :-)

0 comments:

Post a Comment