AcademySoftwareFoundation / OpenColorIO

A color management framework for visual effects and animation.
https://opencolorio.org
BSD 3-Clause "New" or "Revised" License
1.8k stars 460 forks source link

ocioconvert: symbol lookup error: /usr/bin/../lib64/libOpenImageIO.so.2.2: undefined symbol: _ZN7Imf_3_16HeaderaSEOS0_ #1620

Closed tdbe closed 2 years ago

tdbe commented 2 years ago

I spent all day trying to get opencolorio to work. First I tried compiling it for windows which resulted in a roadblock dependency which is a tool that no longer exists on the internet, then I tried in wsl/ubuntu, then I finally installed a fedora virtualbox, installed opencolorio from yum and wanted to just do one simple ocioconvert CustomerImage.exr linear out.png srgb.

The result is this and I have absolutely no idea wtf ocioconvert: symbol lookup error: /usr/bin/../lib64/libOpenImageIO.so.2.2: undefined symbol: _ZN7Imf_3_16HeaderaSEOS0_

Does anyone have any idea wtf? Thanks. :)


PS: there are absolutely no docs anywhere on the internet that explain the parameters that ocioconvert takes. Luckily I found the ocioconvert [input] [in colorspace] [output] [out color space] pattern while searching through the Issues on github :|

Looking at the docs here: https://opencolorio.readthedocs.io/en/latest/guides/using_ocio/using_ocio.html#overview-ocioconvert or here in the pdf: https://opencolorio.readthedocs.io/_/downloads/en/v2.0.0/pdf/ it is impossible to tell how the heck you actually run the ocioconvert command.

carolalynn commented 2 years ago

Hi @tdbe - first, apologies for all of the headache. Hopefully I can give a bit of context and background on the intent of the OCIO command line utilities, and also point you in the right direction.

First - the set of command line utilities that ship with OCIO were always meant just to be helper/tester tools to be used to verify functionality. ocioconvert is definitely not a tool I'd suggest for everyday image conversion in a production environment. For that, I would instead suggest oiiotool ( https://openimageio.readthedocs.io/en/latest/oiiotool.html) which is the command line utility for the image manipulation library OpenImageIO - it uses OCIO under the hood!

Second - your error. ocioconvert uses OpenImageIO to handle file format types/writing - so my first ask would be to make sure you have also installed OpenImageIO... though I bet you have, and actually your issue likely lies somewhere in....

A bit of a circular build dependency issue we've been battling for a bit now. OCIO depends on OIIO, but only for the command line utilities. However, OCIO is a required component to build core OIIO functionality. It's been a bit of a mess for awhile, more info in this issue: https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/1233

Lastly, I very much hear you on the documentation issue. We are constantly working to make our documentation better, and we'll put this on the list. Quick question - does running ocioconvert -h yield any more information? It's been a long time since I used it last :)

tdbe commented 2 years ago

Ah thanks a lot for the explanation! Some context form me:

Anyway, long story short, what I was really looking for was to apply an ocio profile in one of your tools, and then to somehow obtain / output the shader for that transformation, so I can see how it's done under the hood so I can replicate that transform in my glsl shader. ^__^ But I was probably not on the right track

I guess for now I will try oiio to at least see how the results are supposed to look; I also see I can actually find windows exes for it

PS: `[tdbe@fedora ~]$ ocioconvert -help

ocioconvert: symbol lookup error: /usr/bin/../lib64/libOpenImageIO.so.2.2: undefined symbol: _ZN7Imf_316HeaderaSEOS0

`

remia commented 2 years ago

Looks like there is some issue with OpenImageIO / OpenEXR from your load error, maybe ldd would give more clues.

The CI and Analysis workflows show some ways you can compile on Windows, though I agree sometimes it can be frustrating dealing with unexpected build issues and I also faced that.

To dump the shader code used by OCIO, you can use --gpu (or --gpulegacy if the software you want to emulate use OCIO v1) and --gpuinfo arguments for ocioconvert.

ocioconvert -- apply colorspace transform to an image

usage: ocioconvert [options]  inputimage inputcolorspace outputimage outputcolorspace
   or: ocioconvert [options] --lut lutfile inputimage outputimage
   or: ocioconvert [options] --view inputimage inputcolorspace outputimage displayname viewname

Options:
    --lut                  Convert using a LUT rather than a config file
    --view                 Convert to a (display,view) pair rather than to an output color space
    --gpu                  Use GPU color processing instead of CPU (CPU is the default)
    --gpulegacy            Use the legacy (i.e. baked) GPU color processing instead of the CPU one (--gpu is ignored)
    --gpuinfo              Output the OCIO shader program
    --help                 Print help message
    -v                     Display general information

OpenImageIO options:
    --float-attribute %L   "name=float" pair defining OIIO float attribute for outputimage
    --int-attribute %L     "name=int" pair defining OIIO int attribute for outputimage
    --string-attribute %L  "name=string" pair defining OIIO string attribute for outputimage
    --croptofull           Crop or pad to make pixel data region match the "full" region
    --ch %s                Select channels (e.g., "2,3,4")

It may be nice to add a simple way to check OCIO transforms, same as ociochecklut does but for arbitrary colorspace or display/view conversions. Maybe ociochecklut could be extended to support that.