gs: /MATLAB/ /bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib/libgs.so.9)

When I use in Matlab

!epstopdf "output.eps" --outfile=output.pdf

then I get one of the following message:

gs: /opt/MATLAB/R2016b/bin/glnxa64/libtiff.so.5: no version information available  (required by /usr/lib/libgs.so.9)
gs: /opt/sw/x86_64/generic/Matlab/R2016b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib64/libgs.so.9)
gs: /opt/sw/x86_64/generic/Matlab/R2017b/bin/glnxa64/libtiff.so.5: no version information available (required by /usr/lib64/libgs.so.9)

I am using Ghostscript 9.18 (default version of Ubuntu 16.04). (Same Problem with Ghostscript 9.07)

Asked By: JoKalliauer

||

no version information available means that you have an old version (of Ghostscript) see:
https://stackoverflow.com/a/156387/6747994

Therefore you have to update to Ghostscript 9.23 (or newer):
https://askubuntu.com/a/942995/676490

Due to the fact that Ubuntu 16.04 offers Ghostscript 9.18 and Ubuntu 18.04 offers Ghostscript 9.26 (earlier it was 9.22), you have to

Answered By: JoKalliauer

On my system (Linux Mint 21 Vanessa 64-bit), the problem lies in the incompatibility of the libraries libtiff.so.5 and libstdc++.so.6 installed with the system and those shipped with Matlab.

System:

  • /usr/lib/x86_64-linux-gnu/libstdc++.so.6 is a symlink to /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30
  • /usr/lib/x86_64-linux-gnu/libtiff.so.5 is a symlink to /usr/lib/x86_64-linux-gnu/libtiff.so.5.7.0

shipped with the Matlab distribution:

  • R2022b/sys/os/glnxa64/libstdc++.so.6 is a symlink to R2022b/sys/os/glnxa64/libstdc++.so.6.0.28
  • R2022b/bin/glnxa64/libtiff.so.5 is a symlink to R2022b/bin/glnxa64/libtiff.so.5.8.0

To overcome this problem, you need to ensure that the relevant symlinks in the Matlab’s library folders point to the system library files rather than those shipped with Matlab. That is:

  • R2022b/sys/os/glnxa64/libstdc++.so.6 must be a symlink to /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30
  • R2022b/bin/glnxa64/libtiff.so.5 must be a symlink to /usr/lib/x86_64-linux-gnu/libtiff.so.5.7.0

This has been an issue for many years, and the above approach always worked. For a particular version of Matlab and your system, you simply need to use the Matlab folder and system libraries that are appropriate for your system (in the above example: R2022b and whatever versions are in the /usr/lib/x86_64-linux-gnu/ folder).

Answered By: Lubos Polerecky

When I use the mex command to compile opencv c++ files or when I use mex files, i get an similar error message like this:

MATLAB/bin/glnxa64/libtiff.so.5: version `LIBTIFF_4.0′ not found (required by *)

or

"Invalid MEX-file ‘.mexa64’: libtiff.so.5: version ‘LIBTIFF_4.0’ not found"(required by /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4)

I solved it in the following way, please refer to.

sudo rm -rf /usr/local/MATLAB/R2017a/bin/glnxa64/libtiff.so.5
sudo ln -s /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.4 /usr/local/MATLAB/R2017a/bin/glnxa64/libtiff.so.5

The first line of the command removes the libtiff.xo.5 file from its original path. The second command is to link /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.4 to /usr/local/MATLAB/R2017a/bin/glnxa64/libtiff.so.5. This way the two file versions correspond and the problem is solved.

Execute the command locate libtiff.so.5.2.4
You will find this file in the /usr/local/MATLAB/R2017a/bin/glnxa64/ directory.
/usr/lib/x86_64-linux-gnu/libtiff.so.5.2.4

Note that the matlab version path above should be the one belonging to you.

Answered By: xing cui