UPDATE
Since this answer was originally posted, The Foundry have made their modified OpenEXR source code available for download, including the custom namespace and some interface extensions. This should make it easy to write and successfully build custom plugins that link against the distributed OpenEXR libraries.
Links to compiled bonaries and source files can be found at: https://www.thefoundry.co.uk/products/nuke/developers/
They also have an open pull request for these changes to be merged into the main OpenEXR project, which can be found here: https://github.com/openexr/openexr/pull/141
Original Answer
Unfortunately this type of issue is hard to nail down without knowing everything about your build and runtime environment, but here's some information and ideas that will hopefully help put you on the right track.
To summarize, I think it's likely one of four things:
- Symbol namespace issue
- Binary compatibility issue (due to the library version mismatch)
- Library load issue
- Compiler version issue
Symbol Namespaces
Nuke 8 ships with its own EXR 2 libraries (specifically, version 2.0.1), which you can find in the installation directory. If you look at the exported symbols (using nm -D
), you can see that not only are the symbols in a custom namespace, but the library version is different than the one you are linking against.
$ nm -D "/usr/local/Nuke8.0v5/libImath-2_0_1_Foundry.so.10" | grep Rand | c++filt
0000000000012590 T Imath_2_0_1_Foundry::Rand32::nextf()
As you can see, the EXR 2 symbols in Nuke are in the namespace Imath_2_0_1_Foundry
, while your library is looking for the Imath_2_1
namespace. This would seem to indicate a library loading issue (either due to it not being found, or to Nuke not being able to load it).
Library Loading
Something that's always important to keep in mind is that the libraries that are resolved by ldd
aren't necessarily going to be the same ones Nuke finds. The easiest way to examine what actually happens in Nuke is to run it through strace
using something like the this:
$ strace -fqo /var/tmp/nuke_strace_output.txt Nuke
Note that you may need to use the full path to the Nuke
binary, depending on your shell environment. You should try and start Nuke with no other custom code running (other than whatever is required to get your plugin onto the plugin path), and without opening any Nuke scripts, in order to prevent anything else from loading the Imath
library.
Once you have your empty Nuke session running, just attempt to create an instance of your node and then quit Nuke. Now you can grep
through nuke_strace_output.txt
and find the point where your plugin is loaded, which should look something like this:
open("/path/to/MyPlugin.so", O_RDONLY|O_CLOEXEC) = 50
After that, if you scroll through the strace
output, you'll see what steps Nuke takes when it tries to load the libraries your plugin depends on that have not yet been loaded (which names it tries, where it looks, etc.), which should include libImath
(and I'm guessing libfftw3f
).
Binary Compatibility
If possible, I would recommend trying to use the same version of OpenEXR that Nuke ships with, so you can just piggy-back on its libraries. You'll need to get your own headers in order to compile your plugin, but that's trivial for something like Imath.
As far as compilers go, you should be using GCC 4.1.2. If you don't, you're very likely going to run into binary compatibility issues at some point.
Anyway, I know this is jumping around into a lot of different areas, but I hope it helps some.