Re: Compiling GM statically and the magic.mgk config file

Bob Friesenhahn <[email protected]> Fri, 2 Mar 2007 10:00:09 -0600 (CST)
Newsgroups gmane.comp.video.graphicsmagick.tools
Message-ID <[email protected]>
On Fri, 2 Mar 2007, simon wrote:

> Hello,
>
>
> it's me again ;)

I am astonished that you found my first response useful since I 
answered it as if you were a Microsoft Windows user. :-)

> the gm i compiled works on my PC, but it doesn't seem to be statically
> compiled, because i the following message on the (non-root) server:
>
> ./gm: error while loading shared libraries: libjasper-1.701.so.1: cannot
> open shared object file: No such file or directory
>
> I know how to compile stuff the regular way, but i have no clue on how
> to compile a static version.

You have a bit of work in order to accomplish what you are looking 
for.  The problem is that the system linker will automatically select 
shared libraries if they are available and it seems that shared 
libraries are installed on your system.  There are options to 
circumvent this behavior but the options must be delivered at just the 
right points, and libtool may reorder the options so that the request 
does not work.

A work-around is to create a special development tree which is 
populated with the installed headers and static libraries (including 
the .la files).  If you use existing binaries, you may need to 
manually edit the .la files so that the internal paths are correct. 
If you build the 'delegate' packages from source code then you can use 
configure options to ensure that they are built as static only, and 
use an alternate installation prefix so that they install into your 
special development tree.  When you configure GraphicsMagick, specify 
CPPFLAGS and LDFLAGS so that your libraries are used, as well as use a 
--prefix option so that GraphicsMagick would be installed in the same 
tree.

If you are using your own computer, you could take the easy way out 
and move the problem .so files to new names until you have created 
your successful static link.  Take care since you may find that your 
windowing system suddenly stops working. ;-)

Use the command

   ldd utilities/gm

to reveal the dependencies of the built executable.

> I found a static verison of graphicsmagick 1.1.6 here:
> http://typo3.sunsite.dk/software/linux/graphicsmagick-1.1.6_i386-static-2.tar.gz
> Unfortunately, when I try to convert between RGB and CMYK colorspace
> using ICCs (ICM) I get:
> LCMS encoding not supportet
>
> does this mean that it was compiled without lcms support?
> I'll also try to contact the author, to get an answer....

I am not sure.  GraphicsMagick source code does not produce this 
message.

Bob
======================================
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV