Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TclMagick on win7x64

78 views
Skip to first unread message

Dave

unread,
Apr 13, 2017, 6:16:15 PM4/13/17
to
I've been looking at several packages such as TclFltk. I've decided that
one is not for me, but as part of that exploration I looked at some
other graphics extensions. I re-discovered TclMagick at the
GraphicsMagic site.

The last time I played with it was for v0.45 in 2006. I built it on
FreeBSD at the time. It's since been moved to the GraphicsMagick site
and the version bumped to 0.46. I suspect that not much has been done
with it and the documentation is pretty sparse. GraphicsMagick (and
ImageMagick) are very capable though so I thought TclMagick would be a
very useful Tcl extension.

I could not find a binary distribution...

So I've managed to compile TclMagick for Tcl 8.6.6 on win7x64 using
Msys2's 64-bit MinGw gcc tool chain. It was a pain -- TclMagick does not
come with the GraphicsMagick windows installer and I suspect that not
much work has gone into maintaining the extension. I had to replace the
tcl.m4 and regenerate the autoconf stuff for TclMagick. At least with
this, libtool (how I hate libtool!) managed to compile but cannot create
the DLL's and issues a nonsense error. At least it does not terminate
the build.

For the build, I've got the following 64-bit libraries installed:
mingw-w64-x86_64-freetype (needed to build but final DLLs use
included version)
mingw-w64-x86_64-libjpeg-turbo
mingw-w64-x86_64-libpng
mingw-w64-x86_64-libtiff
mingw-w64-x86_64-zlib

As I wanted DLLs that do not depend on and Msys2's DLLs, I built
statically linked versions. That required a build of freetype (which is
supplied in the source tree).

Anyway, I'm certainly willing to share my script that builds the whole
thing. I noticed the wiki page http://wiki.tcl.tk/9775 but it seems
rather obsolete -- for instance, I had to redo the first example. I've
got a resource file and made an .ICO from one of the images in the
GraphicsMagick distribution so I cannot just put them on a wiki page.

--
computerjock AT mail DOT com

Keith Nash

unread,
Apr 25, 2017, 7:18:09 AM4/25/17
to
Dave wrote:

> (snip)
>
> So I've managed to compile TclMagick for Tcl 8.6.6 on win7x64 using
> Msys2's 64-bit MinGw gcc tool chain. It was a pain -- TclMagick does not
> come with the GraphicsMagick windows installer and I suspect that not
> much work has gone into maintaining the extension. I had to replace the
> tcl.m4 and regenerate the autoconf stuff for TclMagick. At least with
> this, libtool (how I hate libtool!) managed to compile but cannot create
> the DLL's and issues a nonsense error. At least it does not terminate
> the build.
>
> (snip)
>
> Anyway, I'm certainly willing to share my script that builds the whole
> thing. I noticed the wiki page http://wiki.tcl.tk/9775 but it seems
> rather obsolete -- for instance, I had to redo the first example. I've
> got a resource file and made an .ICO from one of the images in the
> GraphicsMagick distribution so I cannot just put them on a wiki page.

Please do share! I expect you've found the Wiki page on MSYS2 at:
http://wiki.tcl.tk/48291

I am currently using MSYS2 with MinGW-W64 to build Tcl/Tk and a number of
packages.

If the MinGW-W64 tools are giving trouble, it is worth trying a different
version.

I found that binaries built with the official version of MinGW-W64 seem to
pick up fewer pointless MSYS2/MinGW dependencies than those built with the
MinGW-W64 version available from the MSYS2 project. If you install the
former to a separate directory, you can use it from MSYS2 by mounting it at
/mingw32 (or /mingw64) - there is no need to uninstall the MSYS2/MinGW-W64
tools.

Add a line to /etc/fstab and restart:

C:/mingw-w64/i686-6.3.0-win32-dwarf-rt_v5-rev2/mingw32 /mingw32 ntfs
binary,noacl,posix=0,auto 0 0


Keith.

Dave

unread,
Apr 26, 2017, 3:01:20 PM4/26/17
to
On 4/25/2017 6:18 AM, Keith Nash wrote:
> Dave wrote:
>
>> (snip)
>>
>> So I've managed to compile TclMagick for Tcl 8.6.6 on win7x64 using
>> Msys2's 64-bit MinGw gcc tool chain. It was a pain -- TclMagick does not
>> come with the GraphicsMagick windows installer and I suspect that not
>> much work has gone into maintaining the extension. I had to replace the
>> tcl.m4 and regenerate the autoconf stuff for TclMagick. At least with
>> this, libtool (how I hate libtool!) managed to compile but cannot create
>> the DLL's and issues a nonsense error. At least it does not terminate
>> the build.
>>
>> (snip)
>>
>> Anyway, I'm certainly willing to share my script that builds the whole
>> thing. I noticed the wiki page http://wiki.tcl.tk/9775 but it seems
>> rather obsolete -- for instance, I had to redo the first example. I've
>> got a resource file and made an .ICO from one of the images in the
>> GraphicsMagick distribution so I cannot just put them on a wiki page.
>
> Please do share! I expect you've found the Wiki page on MSYS2 at:
> http://wiki.tcl.tk/48291

? That's for building Tcl/Tk... I've had no problems with that

>
> I am currently using MSYS2 with MinGW-W64 to build Tcl/Tk and a number of
> packages.
>
> If the MinGW-W64 tools are giving trouble, it is worth trying a different
> version.

The issues with TclMagick are a) real bugs, b) faulty build scripts for
windows, and c) possibly a mis-built static library in the dependency
chain for freetype.

>
> I found that binaries built with the official version of MinGW-W64 seem to
> pick up fewer pointless MSYS2/MinGW dependencies than those built with the
> MinGW-W64 version available from the MSYS2 project. If you install the
> former to a separate directory, you can use it from MSYS2 by mounting it at
> /mingw32 (or /mingw64) - there is no need to uninstall the MSYS2/MinGW-W64
> tools.
>

I've tried gcc from sourceforge.net/projects/mingw-w64/ and have not
noticed any differences from the MSYS2 gcc

I've submitted my bugs to the GM sourceforge site. I get the impression
-- and that's all it is: my impression -- the the folks behind
GraphicsMagick are much more unix orientated. A bug I noticed (but
probably did not make a ticket) from 2006 was still in the TclMagick
code (it causes a segfault when encountered). So it seems that TclMagick
had >very< few users -- quite possibly because there was no easy way to
get binaries for windows.

That's too bad since Graphics/ImageMagick already do most if not all of
what people want with image manipulation in Tcl: resize, rotate,
superimpose text, etc. etc. As a Tcl extension it makes all that
directly accessible rather than doing 'exec's.
0 new messages