I took GraphicsMagick-1.4.020140630.tar.bz2 and tried to compile it on an Redhat Enterprise Linux Client release 5.4 (Tikanga) system which runs a x86_64 kernel. It also has lots of 32-bit stuff installed on top.
I ran "configure --prefix=/usr/local --enable-shared". The make failed due to multiple "-L/usr/lib -L/usr/lib" in the generated Makefiles. I changed that to the correct "-L/usr/lib64" and then "make;make install" ran fine. The compile tries to build a 64-bit exe. This failed becaused it tried to link with 32-bit libs under /usr/lib".
--ldflags)
echo '-L/usr/local/lib -L/usr/lib64'
--libs)
echo '-lGraphicsMagickWand -lGraphicsMagick -llcms ...'
Otherwise the compile of TclMagick will fail.
configure \
--with-tcl=/usr/tcl/Linux/lib \
--with-tk=/usr/tcl/Linux/lib \
--with-magick=/usr/local/bin/GraphicsMagick-config
This produced a working libTclMagick.so.0.0.0, but libTkMagick.so.0.0.0
failed due to:
--
% load ./libTkMagick.so.0.0.0
couldn't load file "./libTkMagick.so.0.0.0": ./libTkMagick.so.0.0.0: undefined symbol: tkStubsPtr
Then I added /usr/tcl/Linux/lib/libtkstub8.5.a to the link.
But it still failed with:
--
load ./libTkMagick.so.0.0.0
couldn't load file "./libTkMagick.so.0.0.0": ./libTkMagick.so.0.0.0: undefined symbol: findMagickObj
Then I added /usr/tcl/Linux/lib/TclMagick0.46/libTclMagick.so.0.0.0 to link
and got a working libTkMagick.so.0.0.0.
Hope this info helps you to fix the compile and link process.
Best regards,
Reinhard
The problem with loading libTkMagick.so.0.0.0 is a known issue. It is due to some Linux systems not making symbols from previously loaded modules available to later modules by default.
The -L/usr/lib may be due to dealing with the freetype-config script. We are trying to improve configure so that it refers to the correct lib directory.
The TclMagick build has been completely redone (in 2024) such that there is no longer a direct library dependency from one shared library to another. The GraphicsMagick build is updated to detect and apply the necessary dependency libraries as reported by pkgconfig. This issue is believed to be fixed.