Compile issues with github version
IIPImage is an advanced high-performance image server and client
Brought to you by:
denis_pitzalis,
ruven
We try to compile the github version on kubernetes container with gcc version 10.2.1 20210110 (Debian 10.2.1-6) with Kakadu support
Our Docker looks like this
FROM gcc:4.9 as build
RUN mkdir /iipimage
RUN mkdir /kakadu
COPY docker/iipimage /iipimage/
COPY docker/kakadu /kakadu/
WORKDIR /iipimage
RUN sh ./autogen.sh
RUN ./configure --with-kakadu=/kakadu/v6_4_1-01203N
Compilations fails with this log:
Automatically preparing build ... Warning: autoreconf failed
libtoolize being run by autoreconf is not creating ltmain.sh in the auxiliary directory like it should
Attempting to run the preparation steps individually
Preparing build ... configure.ac:312: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '_CPPFLAGS')
configure.ac:312: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '_CPPFLAGS')
configure.ac:312: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '_CPPFLAGS')
configure.ac:312: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '_CPPFLAGS')
configure.ac:312: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '_CPPFLAGS')
src/Makefile.am:20: error: ENABLE_PNG does not appear in AM_CONDITIONAL
src/Makefile.am:24: error: ENABLE_WEBP does not appear in AM_CONDITIONAL
src/Makefile.am:6: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '_CPPFLAGS')
ERROR: automake failed
The command '/bin/sh -c sh ./autogen.sh' returned a non-zero code: 2
Error: Process completed with exit code 2.
Fyi: version 1.1. compiles without a problem
Maybe you need to make sure the necessary autoconf tools such as libtool is installed?
RUN apt-get install libtoolI guess it works with version 1.1 because that is a full release and you don't have to run autogen.sh before ./configure
We have overcome the libtool issue but next is a failure in the kakadu.
I'm not sure which versions are supported but we use version v6_4_1-01203N which is off course an old one. It does serve our purposes for many years so we hope it can live on for a while....
This is the errror in the log
DHAVE_STRERROR=1 -I. -fopenmp -I/kakadu/v6_4_1-01203N/managed/all_includes/ -I. -I../fcgi/include -I../fcgi -std=gnu++0x -g -O2 -MT KakaduImage.o -MD -MP -MF .deps/KakaduImage.Tpo -c -o KakaduImage.o KakaduImage.cc
KakaduImage.cc: In member function 'virtual void KakaduImage::loadImageInfo(int, int)':
KakaduImage.cc:396:30: error: 'class jpx_metanode' has no member named 'get_next_descendant'
jpx_metanode node = root.get_next_descendant( NULL, 0, NULL);
^
KakaduImage.cc:398:59: error: 'class jpx_metanode' has no member named 'is_xmp_uuid'
if( node.open_existing( box ) && box.exists() && node.is_xmp_uuid() ){
^
make[1]: *** [KakaduImage.o] Error 1
Makefile:471: recipe for target 'KakaduImage.o' failed
make[1]: Leaving directory '/iipimage/src'
Makefile:396: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
The command '/bin/sh -c make' returned a non-zero code: 2
Yes, that's kinda an old version. From over 10 years ago I think! The metadata XMP code won't work with your version of Kakadu, so to make sure it compiles I've just committed a fix that adds an extra version check. If you check out the latest version, it should now work.
Very nice. I can check it next week and let you know
Fetched the code from git and looks like the xmp version is fixed. But another issues arises that may not be related to kakadu as far as I can see.
MT WebPCompressor.o -MD -MP -MF .deps/WebPCompressor.Tpo -c -o WebPCompressor.o WebPCompressor.cc
WebPCompressor.cc: In member function 'virtual unsigned int WebPCompressor::Compress(RawTile&)':
WebPCompressor.cc:183:34: error: 'WebPMemoryWriterClear' was not declared in this scope
WebPMemoryWriterClear( &writer );
^
Makefile:471: recipe for target 'WebPCompressor.o' failed
make[1]: Leaving directory '/iipimage/src'
make[1]: *** [WebPCompressor.o] Error 1
make: *** [all-recursive] Error 1
Makefile:396: recipe for target 'all-recursive' failed
The command '/bin/sh -c make' returned a non-zero code: 2
Looks like a problem with libwebp. Can you give me the output of the ./configure command? Did you install libwebp-dev? It should, in any case, disactivate WebP support if the libraries are not there. Or is your version of libwep also 10 years old!
Although I think it is not needed I added
RUN apt-get install libwebp-dev
But that didn't make any difference.
The complete build log is attached and as you can see is libwebp the latest version
From your build log, it looks like you are running Debian Jessie, which was released in 2015, so it is indeed rather old! Your version of libwep will be equally old, so if you don't need WebP support, just disable it by adding
--disable-webpto the end of the ./configure command or uninstalling the libwebp-dev package.This solved the webp issue and it compiles. But the server won't start with the message
./iipsrv.fcgi -v error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory. Looks like we're missing something.
Last edit: Edu Hackenitz 2023-02-13
Is libpng not installed in a standard location? What is the output of ldd on the iipsrv.fcgi binary:
ldd iipsrv.fcgiOtherwise, just disable png as you did with libwebp:
--disable-pngWe have %>libpng-config --version shows 1.6.37
Looks like the libraries are in /usr/lib/x86_64-linux-gnu/ with a version 16 number like
libpng16.so -> libpng16.so.16.37.0 etcetera
The ldd shows a not found off course
ldd iipsrv.fcgi
linux-vdso.so.1 (0x00007ffd2050e000)
libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007fbb94c02000)
libpng12.so.0 => not found
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fbb94be5000)
libkdu_v64R.so => /lib64/libkdu_v64R.so (0x00007fbb94922000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fbb94900000)
libjpeg.so.62 => /usr/lib/x86_64-linux-gnu/libjpeg.so.62 (0x00007fbb9487c000)
libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007fbb947f4000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fbb94627000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fbb944e3000)
libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007fbb944a3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fbb94489000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbb942c4000)
/lib64/ld-linux-x86-64.so.2 (0x00007fbb94c25000)
libwebp.so.6 => /usr/lib/x86_64-linux-gnu/libwebp.so.6 (0x00007fbb94259000)
libzstd.so.1 => /usr/lib/x86_64-linux-gnu/libzstd.so.1 (0x00007fbb9417e000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fbb94156000)
libjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007fbb93f48000)
libdeflate.so.0 => /usr/lib/x86_64-linux-gnu/libdeflate.so.0 (0x00007fbb93f2c000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fbb93f26000)
Last edit: Edu Hackenitz 2023-02-14
Strange. Try explicitly installing libpng-dev then re-running ./configure and make:
RUN apt-get install libpng-devIf it still doesn't work, what is the full output of iipsrv's configure script.
We also applied --disable-png and now we have IIPImage Server Version 1.2 so that's fine with us. But if there is a solution for the libpng problem that would be nice. Some suggest that we should install the libpng12 seperately besides the 16 version.
Tried again with the RUN apt-get install libpng-dev but the result is the same. Looks like the package is already present with the latest version 1.6.37
Attached the build logs.
Also the ldd shows libpng12.so.0 => not found
I am not an expert but the libs on Debian Bullseye have names like libpng16.so.0 ....perhaps is that the cause that the linked library is not found ?
It looks like it's because in your Docker file you do an apt-get update after building iipsrv. iipsrv's configure occurs at step 10 and then later on you do this:
This bumps libpng-dev up to version 1.6 as you can see later in your build log:
So the solution is simply to change the build order and move down the configure and compilation of iipsrv to after this (or move step 39 to earlier).
I'm a little bit confused. We build the iipimage on a pre-stage container with the official gcc docker image so we think this independent on what is following. Or am I wrong about that?
This in the docker file of the pre-stage container
FROM gcc:4.9 as build
RUN mkdir /iipimage
RUN mkdir /kakadu
COPY docker/iipimage /iipimage/
COPY docker/kakadu /kakadu/
WORKDIR /iipimage
RUN apt-get update
RUN apt-get install libtool
RUN apt-get install libpng-dev
RUN sh ./autogen.sh
RUN ./configure --with-kakadu=/kakadu/v6_4_1-01203N --disable-webp
RUN make
In this container libpng is version 1.6.x
From the log
Step 7/125 : RUN apt-get update
Step 8/125 : RUN apt-get install libpng-dev
Step 9/125 : RUN sh ./autogen.sh
Step 10/125 : RUN ./configure --with-kakadu=/kakadu/v6_4_1-01203N --disable-webp
Now we pull the binary and copy that to the final application where libpng16 lives instead of libpng12
Bit I will try you suggestion (next week)
We are not succeeding in our effort to compile iipimage against libpng12.so
We tried several constructs and finally removed all the stuff that could possible interfere with the libpng version. But the ldd still shows libpng12.so.0 => not found in our minimal setup.
Attached the build log.
For the moment we go for the build with --disable-png so we can continue.
But is there a way to compile iipimage against libpng16 instead of libpng12?
Maybe it's because you're targeting specifically the gcc-4.9 docker build? This is very very old which will run inside an old version of Debian. Try targeting something more recent.
Indeed, is there a reason to build this in a gcc docker environment? Why not just compile in a normal Debian or Ubuntu docker that matches the one you are using for your production environment?
Ok, will try with newer version. Perhaps I was mislead by an old example. Will let you know what the outcome is (but first a short holiday)