Building 3.6.0 with libraries on Ubuntu 22.04 gives compiler error about OpenImageIO

Hello everyone,

I’m trying to build Blender as a python module on Ubuntu 22.04. First of all, the command suggested in the wiki for installing dependencies does not work properly (apt complains about not finding libshaderc-dev).

I resorted to running the make command multiple times and installing manually all the dependencies that came up, but now the build fails around 50% with the following compiler error:

blender/imbuf/intern/oiio/openimageio_support.cc:297:95: error: no matching function for call to ‘OpenImageIO_v2_2::ImageBuf::ImageBuf(const OpenImageIO_v2_2::ImageSpec&, uchar* const&, const stride_t&, long int, const stride_t&)’
  297 |   ImageBuf orig_buf(ctx.mem_spec, ctx.mem_start, ctx.mem_xstride, -ctx.mem_ystride, AutoStride);
      |                                                                                               ^
In file included from /home/filippo/Downloads/blender-with-libraries-3.6.0/blender-3.6.0/source/blender/imbuf/intern/oiio/openimageio_support.cc:4:
/usr/include/OpenImageIO/imagebuf.h:199:5: note: candidate: ‘OpenImageIO_v2_2::ImageBuf::ImageBuf(OpenImageIO_v2_2::ImageBuf&&)’
  199 |     ImageBuf(ImageBuf&& src);
      |     ^~~~~~~~
/usr/include/OpenImageIO/imagebuf.h:199:5: note:   candidate expects 1 argument, 5 provided
/usr/include/OpenImageIO/imagebuf.h:196:5: note: candidate: ‘OpenImageIO_v2_2::ImageBuf::ImageBuf(const OpenImageIO_v2_2::ImageBuf&)’
  196 |     ImageBuf(const ImageBuf& src);
      |     ^~~~~~~~
/usr/include/OpenImageIO/imagebuf.h:196:5: note:   candidate expects 1 argument, 5 provided
/usr/include/OpenImageIO/imagebuf.h:193:5: note: candidate: ‘OpenImageIO_v2_2::ImageBuf::ImageBuf(OpenImageIO_v2_2::string_view, const OpenImageIO_v2_2::ImageSpec&, void*)’
  193 |     ImageBuf(string_view name, const ImageSpec& spec, void* buffer);
      |     ^~~~~~~~
/usr/include/OpenImageIO/imagebuf.h:193:5: note:   candidate expects 3 arguments, 5 provided
/usr/include/OpenImageIO/imagebuf.h:189:5: note: candidate: ‘OpenImageIO_v2_2::ImageBuf::ImageBuf(const OpenImageIO_v2_2::ImageSpec&, void*)’
  189 |     ImageBuf(const ImageSpec& spec, void* buffer);
      |     ^~~~~~~~
/usr/include/OpenImageIO/imagebuf.h:189:5: note:   candidate expects 2 arguments, 5 provided
/usr/include/OpenImageIO/imagebuf.h:168:5: note: candidate: ‘OpenImageIO_v2_2::ImageBuf::ImageBuf(OpenImageIO_v2_2::string_view, const OpenImageIO_v2_2::ImageSpec&, OpenImageIO_v2_2::InitializePixels)’
  168 |     ImageBuf(string_view name, const ImageSpec& spec,
      |     ^~~~~~~~
/usr/include/OpenImageIO/imagebuf.h:168:5: note:   candidate expects 3 arguments, 5 provided
/usr/include/OpenImageIO/imagebuf.h:163:14: note: candidate: ‘OpenImageIO_v2_2::ImageBuf::ImageBuf(const OpenImageIO_v2_2::ImageSpec&, OpenImageIO_v2_2::InitializePixels)’
  163 |     explicit ImageBuf(const ImageSpec& spec,
      |              ^~~~~~~~
/usr/include/OpenImageIO/imagebuf.h:163:14: note:   candidate expects 2 arguments, 5 provided
/usr/include/OpenImageIO/imagebuf.h:138:5: note: candidate: ‘OpenImageIO_v2_2::ImageBuf::ImageBuf(OpenImageIO_v2_2::string_view, OpenImageIO_v2_2::ImageCache*)’
  138 |     ImageBuf(string_view name, ImageCache* imagecache);
      |     ^~~~~~~~
/usr/include/OpenImageIO/imagebuf.h:138:5: note:   candidate expects 2 arguments, 5 provided
/usr/include/OpenImageIO/imagebuf.h:132:14: note: candidate: ‘OpenImageIO_v2_2::ImageBuf::ImageBuf(OpenImageIO_v2_2::string_view, int, int, OpenImageIO_v2_2::ImageCache*, const OpenImageIO_v2_2::ImageSpec*, OpenImageIO_v2_2::Filesystem::IOProxy*)’
  132 |     explicit ImageBuf(string_view name, int subimage = 0, int miplevel = 0,
      |              ^~~~~~~~
/usr/include/OpenImageIO/imagebuf.h:132:35: note:   no known conversion for argument 1 from ‘const OpenImageIO_v2_2::ImageSpec’ to ‘OpenImageIO_v2_2::string_view’
  132 |     explicit ImageBuf(string_view name, int subimage = 0, int miplevel = 0,
      |                       ~~~~~~~~~~~~^~~~
/usr/include/OpenImageIO/imagebuf.h:95:5: note: candidate: ‘OpenImageIO_v2_2::ImageBuf::ImageBuf()’
   95 |     ImageBuf();
      |     ^~~~~~~~
/usr/include/OpenImageIO/imagebuf.h:95:5: note:   candidate expects 0 arguments, 5 provided
make[3]: *** [source/blender/imbuf/intern/oiio/CMakeFiles/bf_imbuf_openimageio.dir/build.make:90: source/blender/imbuf/intern/oiio/CMakeFiles/bf_imbuf_openimageio.dir/openimageio_support.cc.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:5717: source/blender/imbuf/intern/oiio/CMakeFiles/bf_imbuf_openimageio.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....

Any suggestion about what might be wrong? I only found a similar topic on the forum: it mentions the issue might be with Wayland, but the fix they propose is not applicable to 3.6.0

EDIT I forgot to mention that I also modified the CMakeLists.txt turning OFF precompiled libraries but the result has been similar

If you got an error with libshaderc-dev, I think that means you tried to use the steps from “Advanced Setup” in the build instructions. Any reason you didn’t follow the “Quick Setup” with precompiled libraries? It has a higher chance of success, and will result in a build that is closer to the official releases.

The error here happens because the OpenImageIO version is too old.

Hello and thank you for the answer!

I had downloaded the .tar.xz package with the stable release from blender.org (version “with libraries”) so I thought they were already included and ready to be compiled by the cmake script!

I had missed (it’s not documented in the wiki) the make deps preliminary command.

Anyhow, even then I had to download some of the libraries manually, since the python script would systematically fail, and make deps did not succeed (cmake complained about the hash of usd-v23.05).

Solution: I downloaded the .tar.xz file without libs and followed the instructions from the wiki to checkout the prebuilt libraries from SVN.

Thank you for your help!

On USD : USD released 23.05 and then renamed them selves to OpenUSD which caused a folder change inside their tarball which wasn’t great, but they promised it was a one time thing only. Hash is fixed in 4.0 and a backport is scheduled for 3.6.1

3 Likes