[IronPython] how to make zlib available?

Jeff Hardy jdhardy at gmail.com
Sat May 29 08:42:25 CEST 2010


I wrote IronPython.Zlib, so I'm sorry to hear you're having issues.

On Thu, May 27, 2010 at 6:25 PM, Brandon Craig Rhodes
<brandon at rhodesmill.org> wrote:
> There seems to be a Windows-specific version of "zlib" available here:
>
> http://bitbucket.org/jdhardy/ironpythonzlib/
Actually, it should work on Linux as well, but I've just never tried it.

>
> But I can't get it working either.  Its binary distribution's
> "IronPython.Zlib.dll" file gets completely ignored by IronPython, so far
> as I can tell, if I put it on my "sys.path" - but maybe that's because
> I'm using the most recent IronPython, "IronPython 2.6 for .NET 4.0" (as
> its "C:\Program Files" directory styles itself)?

You should place it in the 'DLLs' directory under C:\Program
Files\IronPython 2.6. This directory doesn't exist when IronPython is
installed, so you'll probably have to create it. IronPython will
automatically load any DLLs in that directory on startup.

One catch, however, is that I have yet to build it for .NET 4. That
could be a problem.

> I have then attempted
> to compile it myself, by installing Visual Studio Express and then
> finding and running the "msbuild" command like this:
>
> C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe IronPython.zlib.csproj

That should do the trick, or close enough. You could also try Visual
C# Express, but that's a bit of a download to build one small library.

>
> I mean, I'm not actually sure that command is meaningful, but I saw it
> somewhere on Stack Overflow and it at least looks like it tries to
> compile something.  But the result is an utter failure.  For one thing,
> it can't find absolutely anything mentioned in the "csproj" file, whose
> crazy "<HintPath>" paths are, well, crazy!  Who on earth has these
> libraries sitting in locations under a "Bin" directory?

I do :) That's where the IronPython build process places them when you
build it from the source, which I was doing up until 2.6 final was
released. Changing them to 'C:\Program Files\IronPython 2.6\...'
should do the trick. I'm not really sure of a better way to make them
useful for general consumption.

> So:
>
> 1. What do *you* guys do every day when you need "zlib"?

IronPython.Zlib. Duh :)

> 2. Should its binary distro work with .NET 4.0 and I'm not trying hard enough?

I'm not sure. I have a feeling it may require a special build for .NET 4.

> 3. If I need to compile it, how do I make the "csproj" file work on a
>   system where things are not located in exactly the same places they
>   are on jdhardy's system?

I'm going to have to figure this one out myself. My systems aren't
configured *that* strangely, but something still seems to be specific
to my machine.

All o that said, I just uploaded a .NET 4 binary to
http://bitbucket.org/jdhardy/ironpythonzlib/downloads - you want
IronPython.Zlib-2.6-clr4.zip. Let me know if this works better for
you, and anything else that could be improved to make the process
easier.

- Jeff



More information about the Ironpython-users mailing list