Cannot build with docs
Build following instructions in BUILDING.md with:
cd libjxl
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF ..
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_SYSTEM_PROCESSOR is i686
-- Performing Test CXX_FUZZERS_SUPPORTED
-- Performing Test CXX_FUZZERS_SUPPORTED - Failed
-- Performing Test CXX_MACRO_PREFIX_MAP
-- Performing Test CXX_MACRO_PREFIX_MAP - Success
-- Performing Test CXX_NO_RTTI_SUPPORTED
-- Performing Test CXX_NO_RTTI_SUPPORTED - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- Performing Test JXL_HWY_DISABLED_TARGETS_FORCED
-- Performing Test JXL_HWY_DISABLED_TARGETS_FORCED - Failed
-- Compiled IDs C:GNU, C++:GNU
-- Disabled AVX512 (set JPEGXL_ENABLE_AVX512 to enable it)
-- Disabled AVX512_SPR (set JPEGXL_ENABLE_AVX512_SPR to enable it)
-- Disabled AVX512_ZEN4 (set JPEGXL_ENABLE_AVX512_ZEN4 to enable it)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test ATOMICS_LOCK_FREE_INSTRUCTIONS
-- Performing Test ATOMICS_LOCK_FREE_INSTRUCTIONS - Success
-- Performing Test HWY_EMSCRIPTEN
-- Performing Test HWY_EMSCRIPTEN - Failed
-- Performing Test HWY_RISCV
-- Performing Test HWY_RISCV - Failed
-- Looking for sys/auxv.h
-- Looking for sys/auxv.h - found
-- Looking for asm/hwcap.h
-- Looking for asm/hwcap.h - not found
-- Build type is 'Release'
-- Performing Test BROTLI_EMSCRIPTEN
-- Performing Test BROTLI_EMSCRIPTEN - Failed
-- Compiler is not EMSCRIPTEN
-- Looking for log2
-- Looking for log2 - not found
-- Looking for log2
-- Looking for log2 - found
-- Found ZLIB: /usr/lib/i386-linux-gnu/libz.so (found version "1.2.11")
-- Found PNG: /usr/lib/i386-linux-gnu/libpng.so (found version "1.6.37")
-- Performing Test SJPEG_HAVE_FLAG___SSE2__
-- Performing Test SJPEG_HAVE_FLAG___SSE2__ - Failed
-- Performing Test SJPEG_HAVE_FLAG___SSE2__
-- Performing Test SJPEG_HAVE_FLAG___SSE2__ - Success
-- Performing Test SJPEG_HAVE_FLAG___ARM_NEON__
-- Performing Test SJPEG_HAVE_FLAG___ARM_NEON__ - Failed
-- Performing Test SJPEG_HAVE_FLAG___ARM_NEON__
-- Performing Test SJPEG_HAVE_FLAG___ARM_NEON__ - Failed
-- Found JPEG: /usr/lib/i386-linux-gnu/libjpeg.so (found version "62")
-- Found OpenGL: /usr/lib/i386-linux-gnu/libOpenGL.so
-- Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
-- Looking for GLIBCXX
-- Looking for GLIBCXX - found
-- Looking for _LIBCPP_VERSION
-- Looking for _LIBCPP_VERSION - not found
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Performing Test CXX_WPSABI_SUPPORTED
-- Performing Test CXX_WPSABI_SUPPORTED - Success
-- Performing Test LINKER_SUPPORT_EXCLUDE_LIBS
-- Performing Test LINKER_SUPPORT_EXCLUDE_LIBS - Success
-- Found GIF: /usr/lib/i386-linux-gnu/libgif.so (found suitable version "5.1.9", minimum required is "5.1")
-- Checking for module 'OpenEXR'
-- Found OpenEXR, version 2.5.4
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.1") found components: doxygen dot
CMake Warning at CMakeLists.txt:419 (message):
sphinx-build not found, skipping rtd documentation
-- Found Python3: /usr/bin/python3.9 (found version "3.9.2") found components: Interpreter -- Building with JPEGXL_VERSION=4a3b22d2 (auto-updated) -- Checking for module 'libwebp' -- Found libwebp, version 0.6.1 -- Checking for module 'libavif' -- Found libavif, version 0.8.4 -- Building tools: cjxl;djxl;jxlinfo;cjpegli;djpegli;benchmark_xl -- Configuring done -- Generating done -- Build files have been written to: /home/brent/git/libjxl/build
cmake --build . -- -j$(nproc) ... [ 4%] Building C object third_party/brotli/CMakeFiles/brotlicommon.dir/c/common/shared_dictionary.c.o a2x: ERROR: "xmllint" --nonet --noout --valid "/home/brent/git/libjxl/build/cjxl.xml" returned non-zero exit status 4
gmake[2]: *** [CMakeFiles/manpages.dir/build.make:81: cjxl.1] Error 1 gmake[2]: *** Waiting for unfinished jobs....
Environment Debian 11 (x86) tried both clang and gcc
Additional context The problem appears to be that the xmllint is passed the --nonet option, but line 2 of build/cjxl.xml is: DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" which is trying to fetch from the network.
The build succeeds without docs using: cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DJPEGXL_ENABLE_MANPAGES=0 ..
I'm having trouble reproducing this. Can you try to install
sudo apt-get install docbook
before running the build command. Perhaps this helps, if it does we should add it to our usual
```bash
sudo apt install cmake clang doxygen g++ extra-cmake-modules \
libgif-dev libjpeg-dev ninja-build libgoogle-perftools-dev \
graphviz
I built successfully with docs on a 64-bit AMD machine without incident. Of the new prerequisites you listed, the only package the 64-bit AMD machine had installed that was missing on the 32-bit x86 one was ninja-build. So, I installed that on the 32-bit x86 machine, but there was no change in the failure.
Again, the problem on the 32-bit x86 debian bookworm machine seems to be related to generating the cjxl.1 manpage. This is made clear when running make without the -j option:
[ 56%] Building CXX object CMakeFiles/decode_oneshot.dir/examples/decode_oneshot.cc.o [ 57%] Linking CXX executable decode_oneshot [ 57%] Built target decode_oneshot [ 59%] Generating cjxl.1 a2x: ERROR: "xmllint" --nonet --noout --valid "/home/brent/git/libjxl/build/cjxl.xml" returned non-zero exit status 4
I need to build jxl for a 32-bit ARM embedded Linux target in the coming weeks, so, I'll let you know when I figure out what the real issue is with this a2x/xmllint failure. A lot of this process will involve stripping out all unnecessary prerequisite packages.
Here is the verbose trace of the build command that should be outputting the cjxl.1 manpage:
/usr/bin/a2x --verbose --format manpage --destination-dir="/home/brent/git/libjxl/build" /home/brent/git/libjxl/doc/man/cjxl.txt a2x: args: ['--verbose', '--format', 'manpage', '--destination-dir=/home/brent/git/libjxl/build', '/home/brent/git/libjxl/doc/man/cjxl.txt'] a2x: resource files: [] a2x: resource directories: ['/etc/asciidoc/stylesheets'] a2x: executing: asciidoc [('--doctype', 'manpage'), ('--verbose',), ('--backend', 'docbook'), ('-a', 'a2x-format=manpage'), ('--out-file', '/home/brent/git/libjxl/build/cjxl.xml')] asciidoc: reading: /etc/asciidoc/asciidoc.conf asciidoc: reading: /home/brent/git/libjxl/doc/man/cjxl.txt asciidoc: reading: /etc/asciidoc/docbook45.conf asciidoc: reading: /etc/asciidoc/filters/latex/latex-filter.conf asciidoc: reading: /etc/asciidoc/filters/source/source-highlight-filter.conf asciidoc: reading: /etc/asciidoc/filters/graphviz/graphviz-filter.conf asciidoc: reading: /etc/asciidoc/filters/code/code-filter.conf asciidoc: reading: /etc/asciidoc/filters/music/music-filter.conf asciidoc: reading: /etc/asciidoc/lang-en.conf asciidoc: writing: /home/brent/git/libjxl/build/cjxl.xml a2x: executing: "xmllint" --nonet --noout --valid "/home/brent/git/libjxl/build/cjxl.xml"
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
/home/brent/git/libjxl/build/cjxl.xml:2: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
D DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
^
/home/brent/git/libjxl/build/cjxl.xml:5: validity error : Validation failed: no DTD found !
a2x: ERROR: "xmllint" --nonet --noout --valid "/home/brent/git/libjxl/build/cjxl.xml" returned non-zero exit status 4
This appears to be a problem with asciidoc. The version originally installed on the 32-bit x86 machine was 9.9.2 I updated it to the current bookworm version, but the problem persists. Finding a fix is not a high priority at this point. But, please let me know if you have an idea what might be wrong.
A quick fix for others unable to build the manpage is to edit CMakeCache.txt to disable it.
Change: ASCIIDOC:FILEPATH=/usr/bin/a2x to: ASCIIDOC:FILEPATH=