Page 1 of 1

Compiling for Open EXR on windows 7

Posted: 2011-12-02T12:57:08-07:00
by alok1974
Hi,

I know there are lot of threads already on this issue, I went through most of them.

To build IM for Open EXR, I found this viewtopic.php?f=2&t=17883&p=67813&hilit=exr#p67813 to be most useful. But was not still able to get the .exr read / wrtie to work.

I followed all the steps, in fact at one point(I don't which because I tried a lot of combinations), I was able to build successfully with no errors, but still do not have EXR lister in format list.

Also in the above thread, I only get the IM_MOD_EXR project in my workspace only if I choose Dynamic build option from the Configure.

Is there something I am missing ?

Re: Compiling for Open EXR on windows 7

Posted: 2011-12-02T13:45:12-07:00
by alok1974
Just to mention :

I did all of the following in order:

0. Copied the ImageMagick-6.7.3 to my c:\temp folder.

1. Created a new folder 'exr' in root ImageMagick-6.7.3 folder.

2. Extracted all files from openexr-1.4.0-vs2005 that I downloaded from Open EXR in this newly created 'exr' folder.

3. Ran ImageMagick-6.7.3\VisualMagick\configure\configure.exe.

4. Selected this options in the Configure.exe window:
-- Dynamic Multithreaded DLL runtimes
--Unchecked USE X11 Stubs
--Build Options - Build 64 Distribution
--Build Options - Generate Visual Studio 7 Format

In the Edit :magick-config.h used this options:
#undef MAGICKCORE_X11_DELEGATE
#define MAGICKCORE_HDRI_SUPPORT
#define MAGICKCORE_OPENEXR_DELEGATE

5. Started Visual Studio 2008 in the amd64 mode.

6. Selected the All project as the startup project.

7. Did the following modifications in the IM_MOD_EXR project properties:
-- In the c\c++\general section added "C:\temp\ImageMagick-6.7.3\exr\openexr-1.4.0-vs2005\include\OpenEXR"the Additional Includes directory
-- In the Linker\General section added C:\temp\ImageMagick-6.7.3\exr\openexr-1.4.0-vs2005\lib" to the Addtional Liraries Directory
-- In the Linker\Input Additional Dependancy section added:
Half.lib
Iex.lib
IlmImf.lib
IlmThread.lib
Imath.lib
zlib.lib

When I tried to build only the IM_MOD_EXR project, got this error and a few similar errors : exr.obj : error LNK2019: unresolved external symbol ImfHalfToFloat referenced in function ReadEXRImage

But at one point of time, I was able to successfully build the IM_MOD_EXR project (I think when I cleaned and build the whole project once), even then, was not able to see the EXR in the identify -list format

Also If I select Static Multithreaded Runtimes from the Configure.exe, I found no IM_MOD_EXR in the solution explorer, in fact a whole bunch of all IM_MOD_XXX projects are not there.

Any help is appreciated.

Thanks.

Re: Compiling for Open EXR on windows 7

Posted: 2011-12-05T14:12:48-07:00
by alok1974
Yay, finally, I was able to compile successfully !!

It was more complex than I assumed. All the steps that I wrote before are to be followed exactly, but it works for me only on 32 bit build(no big deal). The only change is that in the Open EXR Source files from from ILM, in the Lib folder, I had to copy paste some files:

Copy All files
1. From : ..\ImageMagick-6.7.3\exr\openexr-1.4.0-vs2005\lib\IexRelease to ..\ImageMagick-6.7.3\exr\openexr-1.4.0-vs2005\lib\
2. From : ..\ImageMagick-6.7.3\exr\openexr-1.4.0-vs2005\lib\IlmImfRelease to ..\ImageMagick-6.7.3\exr\openexr-1.4.0-vs2005\lib\
3. From : ..\ImageMagick-6.7.3\exr\openexr-1.4.0-vs2005\lib\IlmThreadRelease to ..\ImageMagick-6.7.3\exr\openexr-1.4.0-vs2005\lib\

Where "..\ImageMagick-6.7.3" is your root IM folder

Also:
In the properties for IM_MOD_exr project in your workspace, add all of these in Linker\Input\Additional Dependancies:

Half.lib
Half_d.lib
Half_dll.lib
Half_dll_d.lib
Iex.lib
Iex_d.lib
Iex_dll.lib
Iex_dll_d.lib
IlmImf.lib
IlmImf_d.lib
IlmImf_dll.lib
IlmImf_dll_d.lib
IlmThread.lib
IlmThread_d.lib
IlmThread_dll.lib
IlmThread_dll_d.lib
Imath.lib
Imath_d.lib
Imath_dll.lib
Imath_dll_d.lib
zlib.lib
zlib1.lib
zlib1d.lib
zlibd.lib

Clean solution and build.

That should do it :)