ImageMagick Compilation Question : Shared Vs Static

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
venaish

ImageMagick Compilation Question : Shared Vs Static

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: ImageMagick Compilation Question : Shared Vs Static

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply