Hi Etienne,
Can you check if iv is linking against both libIlmImf.a AND libIlmThread.a?


IlmImf is dependent on IlmThread (meaning it uses symbols from it, like the
Mutex ones listed).  If you build a dynamic IlmImf library that statically
links against IlmThread, then those symbols will be contained within
libIlmImf.so.  However, if you build IlmImf statically, it won't contain
those symbols, even if IlmThread is static.  To see the symbols in a
library, use the nm command (-C flag will use human-readable names for the
symbols).  If the symbol has a U next to it, then it's undefined.  For
dynamic libraries, that means the lib expects to find the symbol at
runtime, usually enforced via the links visible using the ldd command.  If
the library is static, it means those symbols need to be present when
linking, which is your case.

A static lib is just an archive of the compiled .o files, so in order for
libIlmImf.a to contain the symbols from libIlmThread.a, the .o files from
that archive would first need to be extracted so that they could be added
along with the newly compiled object files into libIlmImf.a.  While this is
possible, in practice it seems that it is not done very often (for example,
cmake does not "honor" target_link_libraries when the target is a static
library, it's just ignored).  Confusing, huh?

All of this is to say that when linking against libIlmImf.a, you must also
link against libIlmThread.a.  This may or may not be your problem, but I
thought I'd explain some of what's going on.  The problem may also relate
to namespaces used when compiling Ilmbase and OpenEXR.

One thing that I've done to get around some of these problem is to build a
dynamic OIIO library, but use static linking for all the dependencies that
might conflict with other applications (tiff, jpeg, ocio, exr, etc).  I
made some changes to oiio's cmake to make this possible, which you can find
here:  https://github.com/LumaPictures/oiio/tree/static_link

Hope that helps.

chad.
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to