Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

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. 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.