Page 1 of 1

ImageMagick Compilation Question : Shared Vs Static

Posted: 2007-11-08T11:57:42-07:00
by venaish
Hi,

I compiled Tiff library as static and shared.
I compiled ImagMagick as static and shared.

So when I used imagemagick to convert a jpeg to tiff, then which library will be used, is it static or shared library.

Thanks.

Regards,
Venkatesh.

Re: ImageMagick Compilation Question : Shared Vs Static

Posted: 2007-11-22T17:58:57-07:00
by anthony
A static library is compiled into the final executable. no library is needed at the final runtime of the command, but the command file size can be huge.

A dynamic library is read at runtime and as such the same file (and memory usage) is shared amongst all the different executable that use the library. The executable file size is small, and the memory usage is also smaller when different commands using the same library run simultaneously. You can also separatally update the library, without needing to update the command (as long as the library is version compatible). However you need BOTH the executable and shared/dynamic library to be avaiable on the machine to run.

The ldd /path/to/program/or/library command can be used to see what runtime shared librarys are used and ensure they and all 'symbols' are found.

This is the basic difference, and now that you know prehaps you should be about to answer your own question. None of it is IM specific.