OpenImageIO
OpenImageIO copied to clipboard
[BUILD] Build fails when enabling libjxl support
I'm trying to build OpenImageIO 3.0.1.0 with libjxl support, but the build fails with the following error:
[ 62%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/jpegxl.imageio/jxlinput.cpp.o
[ 62%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/jpegxl.imageio/jxloutput.cpp.o
[ 62%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/null.imageio/nullimageio.cpp.o
[ 63%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/openexr.imageio/exrinput.cpp.o
[ 63%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/openexr.imageio/exroutput.cpp.o
/foo/source/OpenImageIO/src/jpegxl.imageio/jxlinput.cpp: In member function ‘virtual bool OpenImageIO_v3_0::JxlInput::open(const string&, OpenImageIO_v3_0::ImageSpec&)’:
/foo/source/OpenImageIO/src/jpegxl.imageio/jxlinput.cpp:285:48: error: cannot convert ‘JxlColorProfileTarget’ to ‘const JxlPixelFormat*’
285 | JXL_COLOR_PROFILE_TARGET_DATA,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| JxlColorProfileTarget
In file included from /foo/source/OpenImageIO/src/jpegxl.imageio/jxlinput.cpp:24:
/usr/include/jxl/decode.h:794:50: note: initializing argument 2 of ‘JxlDecoderStatus JxlDecoderGetICCProfileSize(const JxlDecoder*, const JxlPixelFormat*, JxlColorProfileTarget, size_t*)’
794 | const JxlDecoder* dec, const JxlPixelFormat* unused_format,
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/foo/source/OpenImageIO/src/jpegxl.imageio/jxlinput.cpp:293:51: error: cannot convert ‘JxlColorProfileTarget’ to ‘const JxlPixelFormat*’
293 | JXL_COLOR_PROFILE_TARGET_DATA,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| JxlColorProfileTarget
In file included from /foo/source/OpenImageIO/src/jpegxl.imageio/jxlinput.cpp:24:
/usr/include/jxl/decode.h:814:50: note: initializing argument 2 of ‘JxlDecoderStatus JxlDecoderGetColorAsICCProfile(const JxlDecoder*, const JxlPixelFormat*, JxlColorProfileTarget, uint8_t*, size_t)’
814 | const JxlDecoder* dec, const JxlPixelFormat* unused_format,
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
[ 64%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/openexr.imageio/exrinput_c.cpp.o
/foo/source/OpenImageIO/src/jpegxl.imageio/jxloutput.cpp: In member function ‘virtual bool OpenImageIO_v3_0::JxlOutput::open(const string&, const OpenImageIO_v3_0::ImageSpec&, OpenImageIO_v3_0::ImageOutput::OpenMode)’:
/foo/source/OpenImageIO/src/jpegxl.imageio/jxloutput.cpp:134:5: error: ‘JxlEncoderAllowExpertOptions’ was not declared in this scope
134 | JxlEncoderAllowExpertOptions(m_encoder.get());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 64%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/openvdb.imageio/openvdbinput.cpp.o
[ 65%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/png.imageio/pnginput.cpp.o
make[2]: *** [src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/build.make:1168: src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/jpegxl.imageio/jxlinput.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/build.make:1182: src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/jpegxl.imageio/jxloutput.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2297: src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 65%] Linking CXX executable ../../bin/strutil_test
[ 65%] Built target strutil_test
make: *** [Makefile:166: all] Error 2
I had the same error when building OIIO 3.0.0.3
I'm using libjxl v0.11.1 GCC: 11.4.1 cmake: 3.27.8 OS: Rocky Linux 9.4
There's no mention of a supported version of libxl in the installation instruction, so maybe the issue is that the version I'm using is not supported?
Thanks for your help in advance, Cheers