Page 1 of 2
Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-14T09:50:12-07:00
by stevepugh
Hi all,
Longtime IM fan and user, first time build-from-scratch-to-allow-EXR-support compiler here. I know the broad strokes of what I need to do in order to get IM working with EXR sequences (enable HDRI support and build IM with the OpenEXR delegate installed). However, that last bit trips me up. It seems like things are very simple on Linux, apt-get puts everything where it is supposed to be.
On the Windows side, can anyone give me the Explain It Like I'm Five rundown on delegate library installation? I have the compiled binaries for OpenEXR 1.4, which include a number of .dll, .ilk, .map files and the like. It includes a subdir called, sweetly enough, "OpenEXR". Is it enough to copy this folder into my ImageMagick-6.8.9 folder? Should it instead be placed in the VisualMagick subdirectory therein, or perhaps somewhere else?
Help me, you Many Who Have Traveled This Road, any insight would be much appreciated.
Thanks,
Steve
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-14T11:24:42-07:00
by snibgo
I compile IM under Windows, but don't mess with delegates.
The answer will depend on how you compile: with Visual Studio, Cygwin, or something else. I don't know the answer, but would be interested to know.
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-14T21:43:49-07:00
by stevepugh
Thanks, I'm a VS person for those playing along at home.
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-15T07:07:13-07:00
by magick
Place the delegate library in the ImageMagick top-level folder, such as ImageMagick-6.9.0/OpenEXR. Next, put the build configuration folder in the VisualMagick folder. Use one of the other delegate libraries (e.g. webp) as a template. Finally, add your delegate library in configure.cpp. Use one of the other delegate libraries as a template. Now compile the configure program and run it. It should generate VisualStudio build files that will compile and link your new delegate library.
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-15T08:11:01-07:00
by stevepugh
Thank you kindly, Magick! I've put the delegate library into the top level directory (i.e., the OpenEXR folder which contains loads of header files), but it appears that my OpenEXR1.4 directory does not have a build configuration folder similar to that of the webp or openjpg delegates (i.e., no .vcproj files or .rc files).
Does this mean that I'm back to square one with building OpenEXR from source? If so, that'll be my project for the day - I'm just not very good around a complex IDE, spending most of my time in Notepad++ writing Python scripts
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-15T16:07:13-07:00
by magick
You don't need a VS workspaces for OpenEXR. If you put the proper calls in configure.cpp (see the template for WebP for example), then rebuild and rerun the configure program, it generates ImageMagick VS workspaces that should include the build for OpenEXR. Just make sure the appropriate LIBRARY.TXT and folders are set up in the VisualMagick folder (again, use WebP as a template for your OpenEXR configuration.
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-18T06:45:31-07:00
by stevepugh
Hi Magick, thanks again for the reply! I believe that I am setting things up properly (or, rather, CLOSER to properly), and this evening has been progressive but not 100% productive yet. I don't know that I have built configure.exe correctly, here's why -
- My resultant VS project includes IM_MOD_exr (good), which has all empty subdirs except for src (contains exr.c)
- It also contains CORE_OpenEXR, which contains empty include,resource, and src folders. I suspect that this is bad, as other delegates (webp, openjpeg) mostly have stuff in their folders.
Building the whole kit does produce executables, but openexr is not listed among the delegates. I rather expected that based on the empty folder thing.
I constructed my VisualMagick folders similarly to the other delegates, mirroring the folder structure within my Imagemagick-6.8.9 top-level folder. The difference is that the Visualmagick subdirs are empty except for LIBRARY.txt files. In the Openexr's LIBRARY.txt file, I took a page from the openjpg and pango delegate folders and tried adding an INCLUDE = ..\..\openexr\src line as well, to no avail.
I feel like I'm getting closer, but still smacking my head against a brick wall. If I were to capture my folder structure, do you think someone wiser than I in the ways of IM compilation might recognize what I'm doing wrong?
Best,
Steve
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-18T07:34:49-07:00
by magick
The fellow that would be most helpful, Dirk, is away on work / vacation for 1 month. He's a Windows guy, whereas, I'm a Linux guy.
Don't forget to add any folders that might have build files to the VisualMagick/openEXR folder so the configure program will inspect the folder for source. If you need to exclude a particular file from building, add EXCLUDE= to the LIBRARY.TXT file.
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-18T08:25:21-07:00
by stevepugh
Oh Dirk, how can you vacation in my hour of darkest need?
[/dramatic mode]
Believe me, I wish I were running a Linux environment right now, but such is life.
I was able to get my solution file to see OpenEXR source files by digging a little deeper into configure.cpp and copying a couple of other openjpg entries into their openexr counterparts. I'm currently rebuilding configure.exe after moving the OpenEXR header files into one central folder (it only found a few of them the last time).
That should hopefully make my numerous "cannot find include file" errors go away. At that point I'll see if the error regarding CODERS_DB are also sorted. You might yet hear from me again, but I look forward to it being either a different plea from farther down the build chain, or a resounding cheer. Certainly one or the other.
Best,
Steve
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-19T08:05:28-07:00
by stevepugh
Good morning Magick,
I wanted to let you know that I got things sorted out this morning, some hair-pulling linker issues but I'm able to identify.exe -verbose on an EXR image and get a whole host of delicious information. Thank you again for your support, and hopefully I can collect my thoughts and draft a list of my pitfalls for the next guy in my shoes.
Thanks again for your help!
Steve
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-19T08:57:04-07:00
by magick
Create a zip of your OpenEXR mods and post a URL here. We'll download it and looks toward including OpenEXR support in the next point release of ImageMagick.
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-20T08:07:05-07:00
by stevepugh
How about this -- I compiled with OpenEXR 1.4 because that was the last version of OpenEXR for which I could get binaries (having failed building OpenEXR 2.0). The project I'm on right now wraps up next week, maybe I can take another stab then or post up the 1.4 project?
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-20T08:42:50-07:00
by dlemstra
We always build the delegate from source. I will try to get it working with the 2.2 version of OpenEXR when I get back home behind a normal computer instead of a cellphone.
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-11-20T12:00:02-07:00
by snibgo
I'll mention, probably not very usefully, that OpenEXR 2.2 builds successfully under Cygwin's bash on Windows 8.1. It took me two days to discover that the trick was that for both ilmbase-2.2.0 and openexr-2.2.0, each ./configure file needed opening with Windows Wordpad, and saving with no changes. This converts the line ends from Unix to Windows. (In each ./configure, only one line-end is critical, I think.)
Having built OpenEXR, building IM tries to link against it. Sadly, it fails, with:
Code: Select all
*** Warning: This system can not link to static lib archive /usr/local/lib/libIlmImf.la.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
coders/.libs/magick_libMagickCore_6_Q32HDRI_la-exr.o: In function `WriteEXRImage':
/home/Alan/ImageMagick-6.8.9-6/coders/exr.c:392: undefined reference to `ImfNewHeader'
I haven't solved this. Suggestions would be welcomed.
Re: Windows - Delegate Library Location (OpenEXR)
Posted: 2014-12-03T17:45:14-07:00
by roelandsch
Hi,
I could compile openEXR 2.1 on Windows with the Visual Studio compiler.
I first tried to follow the instructions in README.win32 for a while (which use the visual studio project files) but gave up on that. I used the
CMake file instead with the visual studio generator.
If wanted, use the
-DCMAKE_INSTALL_PREFIX=<path> argument to control where the libraries and headers will be installed.
For example: a static 64-bit library with Visual Studio 2010:
cmake -DBUILD_SHARED_LIBS=Off -G "Visual Studio 10 Win64" <path>
I made some notes along the way:
- In some places, it is assumed that PLATFORM_WINDOWS is defined, which is not the case. Possible fix: find/replace PLATFORM_WINDOWS with _WIN32.
- std::isDigits requires the <cctype> header
- ZLib is easy to build, but make sure you build with the multithreaded DLL run-time library (/MD option).
- In both the IlmBase and openEXR projects, build the INSTALL project after compiling the libraries.
- When running cmake for the openEXR folder, add some extra arguments so it finds the other libraries and headers: -DILMBASE_PACKAGE_PREFIX=<path> -DZLIB_LIBRARY=<path> -DZLIB_INCLUDE_DIR=<path>.
I didn't figure out how to add it to the VisualMagick configuration though. I cheated and made some modifications to the IM_MOD_exr project so it finds the openEXR headers and libraries, and the result is an ImageMagick build which can read and write EXR image files.
--
Roeland