KhronosGroup / KTX-Software

KTX (Khronos Texture) Library and Tools
Other
834 stars 222 forks source link

Running in docker container (GLIBC not found error) #897

Closed clever-giraffe closed 2 months ago

clever-giraffe commented 2 months ago

Intro

I make Docker container for converting jpg files to ktx2. As soon as I install the deb package in the image and try to run ktx I get the following messages:

root@converter:/# ktx
ktx: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ktx)
ktx: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ktx)
ktx: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ktx)
ktx: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/bin/../lib/libktx.so.4)
ktx: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/bin/../lib/libktx.so.4)
ktx: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /usr/bin/../lib/libktx.so.4)
ktx: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /usr/bin/../lib/libktx.so.4)

GLIBCXX I was able to install and that partially solved the problem, but not completely.

I get the following error in the current state:

ktx: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ktx)
ktx: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ktx)
ktx: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /usr/bin/../lib/libktx.so.4)
ktx: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /usr/bin/../lib/libktx.so.4)

I tried to install the missing libraries in the following way:

# Install GLIBC
mkdir /tmp/glibc-build
mkdir /tmp/glibc-links

cd /tmp/glibc-build

for version in 2.32 2.33 2.34; do
  wget https://ftp.gnu.org/gnu/glibc/glibc-${version}.tar.gz
  tar -xzf glibc-${version}.tar.gz
  cd glibc-${version} || exit

  mkdir build
  cd build || exit

  ../configure --prefix=/opt/glibc-${version}
  make -j$(nproc) && make install

  ln -s /opt/glibc-$version/lib/*.so.* /tmp/glibc-links/
  export LD_LIBRARY_PATH=/opt/glibc-${version}/lib:$LD_LIBRARY_PATH
  export PATH=/opt/glibc-${version}/bin:$PATH

  cd /tmp/glibc-build || exit
#  rm -rf glibc-${version}
done

When I try to create links using ln -s /opt/glibc-$version/lib/*.so.* /tmp/glibc-links/ I get a response that these files already exist. So I can only install one version of glibc on the system? What should I do about running ktx?

MarkCallow commented 2 months ago

The Linux CI builds are all done on Ubuntu 22.04 Jammy so all the libc, etc dependencies are based on what's found there. Can you base your Docker container on 22.04? IIRC we can no longer build KTX-Software on 20.04 Focal.

clever-giraffe commented 2 months ago

Thanks! Fine working in Ubuntu 22.04!!!