0

We ship ImageMagick with our product. It needs quite a few libraries.

libtiff libICE libdl
libfreetype libX11 libglib-2.0
libjpeg libbz2 libxml2
libpng librsvg-2 libz
libfontconfig libgdk_pixbuf-2.0 libm
libXext libm libgomp
libXt libgobject-.0 libpthread
libSM libgmodule-2.0 

Is there a standard way to check if these libraries are already present on the host RedHat operating system?

Searching on the SO and google lead to commands like

pkg-config, locate and which

Has anybody successfully used them?

3 Answers 3

1

Try the ldd command:

ldd ImageMagick

prints out the dynamic, shared object, libraries that the ImageMagick program references and whether or not the libraries were found.

0

you can just use yum to install and it will show the missing dependencies.

if you just want to know what is missing, you can install yum-downloadonly plugin, then you can

yum install -y ImageMagick --downloadonly

this will just download all the missing dependencies without installing them.

to find dependencies before you install an rpm

rpm -qpR something.rpm

will list all the dependecies, and you can then search to see if these exist, but that sounds too complicated. probably yum --downloadonly will be enough.

0

I suggest you use autoconf; there are tools inside which will automatically check for libraries that exist, by attempting to compile a dummy program against the library. http://www.gnu.org/software/autoconf/manual/ An example:

AC_CHECK_LIB(MagickWand, GetMagickModule)

This would attempt to compile a simple program that would call GetMagickModule() - it does not attempt to run the program, only to compile it.

The autoconf program generates a configure program that would be called to check for the libraries. It's primary purpose is to eventually generate a Makefile, but that doesn't have to be its goal; the configure program could just check for libraries and return an error if they do not exist.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .