libpng12.so.0 no version information available

18 Feb 2010
Posted by colby

On our 10.1 opensuse hosts, an annoying message is printed out at the start of running programs that are part of a MIRIAD install. This appears to be related to an improperly built rpm for libpng that was distributed by many different linux distributions, including opensuse.

colby@peridot ~ % imfit
imfit: /usr/lib64/libpng12.so.0: no version information available (required by /hcro/miriad/build/lib/libpgplot.so.0)
ImFit: version 1.0 28-mar-03
### Fatal Error [imfit]:  The object keyword must be set

It does not keep the programs from running, but, I've been wanting to fix this for a while and with a small amount of googling, came to the conclusion that the easiest fix would be to do a custom build of libpng.

After downloading the version I needed (libpng 1.2.x) the default build steps of,

./configure --prefix=/usr
make
make install

built and installed the libraries into /usr/lib. Note that this is changing the libraries system wide, and requires root access to the host. This does not create libraries for /usr/lib64 (for 64bit hosts), and you should not copy the 32-bit versions from /usr/lib/*png* into /usr/lib64, else you will see an error like:

error while loading shared libraries: libpng12.so.0: wrong ELF class: ELFCLASS32

Here's what you can do to install 64-bit versions,

export CFLAGS="-m64"
export LDFLAGS="-m64"
./configure --prefix=/usr --libdir=/usr/lib64
make
make install

et voila, no more annoying message about the libpng library!

colby@peridot ~ % imfit
ImFit: version 1.0 28-mar-03
### Fatal Error [imfit]:  The object keyword must be set
Tags: