Trying to get PerlMagick to work

software development

#1

Does anyone have any suggestions on how to install PERL modules in our own webspace?

Clear back in May 2001, I asked Dreamhost how much they would charge me to install ImageMagick and PerlMagick on my server. William replied that they were already on the server.

But I can’t seem to use it to resize images.

When I try to use the resize function, I get a message that “Resize.al” cannot be found on the INC path. The problem isn’t the INC path, though, according to Nate. The problem is that I’m using a newer version of ImageMagick than they have on the server; I need to install my own version in my directory.

Fine. Except I can’t figure out how.

ImageMagick and PerlMagick are both included in the RPM for ImageMagick. However, RPM doesn’t work on Dreamhost’s servers.

I obtained a binary of ImageMagick and loaded it into my directory. Then I got PerlMagick from CPAN and tried to install it as well.

It warns that you have to be root to install PerlMagick, but there is a workaround in the Perl manual. Well, the workaround says that you have to set command line arguments for the installation directory and the man pages directory. Tried it. I got a few errors. Well, 36K worth of errors, to be exact.

I asked support what I was doing wrong. Nate says I need to install a newer version of ImageMagick in my own directory. And what, might I ask, do I need to do besides put the binary there to install it? There aren’t any instructions with the binary. And I can’t go through the installation procedure in the RPM because, as I mentioned, the Dreamhost servers don’t allow the use of RPMs.

Oh, yeah, and Nate says I’m supposed to tell PerlMagick to install against the newer version of ImageMagick instead of the one on the path. I had previously asked Nate about how you change the path, so that you could govern which executables were found first, and he said you need to do this within your perl scripts. But I haven’t got that far yet - I’m still trying to get the makefile to run.

OK, so scrap that idea. Let’s just use the existing version of ImageMagick. The ImageMagick Studio was able to do resizing back when DH2000 was released, and I was moved to my current server. Where can I find documentation for that version of PerlMagick.

Why, just type “man Image::Magick” on the command line.

Am I the only one who has trouble running man from a telnet session? All I can get is

[quote]Magick(3pm) User Contributed Perl Documentation Magick(3pm)

NAME
Image::Magick - Perl extension for calling >ImageMagick’s
libmagick routines

SYNOPSIS
use Image::Magick;
p = new Image::Magick;
p->Read(“imagefile”);
p->Set(attribute => value, …)
($a, …) = p->Get(“attribute”, …)
p->routine(parameter => value, …)
p->Mogrify(“Routine”, parameter => value, …)
p->Write(“filename”);

DESCRIPTION
This Perl extension allows the reading, manipulation and
writing of a large number of image file formats using the
magick library from ImageMagick by John Cristy
(magick@wizards.dupont.com). It was originally developed
to be used by CGI scripts for Web pages.

[/quote]

Maybe you call that documentation, but I can’t figure out how to resize images with that. Which of these calls would be right? Are any of them correct?
p->Set(x=200 y=300);
p->Set(height=200 width=300);
p->Set(“x”=200 “y”=300);
p->Set(“height”=200 “width”=300);
p->Set(down=200 across=300);
p->Set(“down”=200 “across”=300);
p->Set(rows=200 cols=300);
p->Set(“rows”=200 “cols”=300);
p->Mogrify(resize, x=200 y=300);
p->Mogrify(resize, “x”=200 “y”=300);
p->Mogrify(resize, height=200 width=300);
p->Mogrify(resize, “height”=200 “width”=300);
p->Mogrify(resize, down=200 across=300);
p->Mogrify(resize, “down”=200 “across”=300);
p->Mogrify(resize, rows=200 cols=300);
p->Mogrify(resize, “rows”=200 “cols”=300);
p->Mogrify(“resize”, x=200 y=300);
p->Mogrify(“resize”, “x”=200 “y”=300);
p->Mogrify(“resize”, height=200 width=300);
p->Mogrify(“resize”, “height”=200 “width”=300);
p->Mogrify(“resize”, down=200 across=300);
p->Mogrify(“resize”, “down”=200 “across”=300);
p->Mogrify(“resize”, rows=200 cols=300);
p->Mogrify(“resize”, “rows”=200 “cols”=300);
p->Mogrify(shrink, x=200 y=300);
p->Mogrify(shrink, “x”=200 “y”=300);
p->Mogrify(shrink, height=200 width=300);
p->Mogrify(shrink, “height”=200 “width”=300);
p->Mogrify(shrink, down=200 across=300);
p->Mogrify(shrink, “down”=200 “across”=300);
p->Mogrify(shrink, rows=200 cols=300);
p->Mogrify(shrink, “rows”=200 “cols”=300);
p->Mogrify(“shrink”, x=200 y=300);
p->Mogrify(“shrink”, “x”=200 “y”=300);
p->Mogrify(“shrink”, height=200 width=300);
p->Mogrify(“shrink”, “height”=200 “width”=300);
p->Mogrify(“shrink”, down=200 across=300);
p->Mogrify(“shrink”, “down”=200 “across”=300);
p->Mogrify(“shrink”, rows=200 cols=300);
p->Mogrify(“shrink”, “rows”=200 “cols”=300);

I’m getting awfully frustrated here. I don’t mind being told to RTFM, but there doesn’t seem to be an F manual…


#2

RPM stands for Redhat Package Manager. We don’t use Redhat. We use Debian. Debian is a way better distro than RH.

You say “the RPM for ImageMagick” like it’s a universal package system. If there’s anything universal for *nix, it’s a tarball. The RPM wouldn’t work anyway since it’s probably compiled against different shared libs which may not exist.

Very few things need to be root to be installed. No perl modules I’ve seen do. You pretty much just say ./configure --prefix=/home/youruser/some/dir and it’ll work with any automake software (which almost all Perl modules are).

Get the source for ImageMagick (which will include PerlMagick) here:

http://imagemagick.sourceforge.net/http/

Do a configure with --prefix set to somewhere in your user space. It’ll probably build PerlMagick automatically.

When you’re compiling something like PerlMagick, which builds against shared libraries, you need more than just a binary. You need headers and shared libs. Just get the source distro from the URL above and follow instructions for building and installing in user-space. This almost certainly means just supplying a --prefix

Well, I’m not sure what you want us to do, other than build and install some custom software for you. You can’t reasonably expect us to document how to use every piece of software installed on our servers…we’ve installed the man pages that come with it, I’m not sure what else you’d like us to do?

nate.


#3

[quote]You say “the RPM for ImageMagick” like it’s a
universal package system. If there’s anything
universal for *nix, it’s a tarball.

[/quote]

Isn’t a tarball a tar.gz file? Ain’t none of them on the page you mentioned. There are tar.gz.tar and there are tar.bz2.tar Try to google for instructions on unpacking a tar.bz2.tar. I finally had to use tar -Ixvf to get it to come apart. What does -I do? I have no idea. Googling on “man tar”, I can’t find any documentation on that flag.

[quote]Very few things need to be root to be installed.
No perl modules I’ve seen do. You pretty much just
say ./configure --prefix=/home/youruser/some/dir
and it’ll work with any automake software (which
almost all Perl modules are).

[/quote]

I guess it’s my own fault for reading the documentation that comes with PerlMagick.

[quote]When you’re compiling something like PerlMagick,
which builds against shared libraries, you need
more than just a binary.

[/quote]

Again, I got fouled up reading the documentation, which suggests that one gets the binaries.

Well, I’m not sure what you want us to do, other
than build and install some custom software for
you. You can’t reasonably expect us to document
how to use every piece of software installed on
our servers…we’ve installed the man pages that
come with it, I’m not sure what else you’d like us
to do?

[/quote]

Nate, have you ever tried to use man pages with telnet? They are worthless. You can’t read anything except the first 24 lines.

And I did offer to pay to get the software installed, some time ago, and Dreamhost declined.

We’re not talking about “custom software”, Nate. We’re talking about something you supposedly already have on the servers. If the version you have doesn’t work with the documentation that’s available on the web, is it that unreasonable that you post the web pages that came with the version you have, so that users can figure out how to actually use the software?

And is it that unreasonable that the KnowledgeBase should explain how to install a package in our own disk space?

Maybe the problem is with the support request form. Are you aware that users are asked to select between

  • Please explain everything to me very carefully.
  • I do know some stuff, but please don’t assume too much.
  • Overall I know my stuff, but I’m a little shaky in this area.
  • I have a good understanding of this stuff.
  • Not to be rude, but I probably know more about this than you!

If you don’t have the information in the KnowledgeBase, and you’re not willing to provide a URL elsewhere where the user can find the information needed, perhaps you should explain everything very carefully.

But I really think the information needs to be in the KnowledgeBase. It’s wasteful to in explain things repeatedly - and it’s expensive to lose customers to another web host because the software on their server comes with documentation.

Only one customer in 20 complains, Nate. The other 19 simply walk away.

Oh, and by the way, your current instructions for installing ImageMagick/PerlMagick still don’t work.

“collect2: ld terminated with signal 9 [Killed], core dumped”

Happy, happy, joy, joy!


#4

[quote]Googling on “man tar”, I can’t find any documentation on that flag

[/quote]

GNU tar seems to change its arguments all the time - so read the man page that’s actually on the server (man tar).

tar xvjf blah.tar.bz2
or:
tar xvIf blah.tar.bz2
(depending on the version of GNU tar) should do it. To add to the confusion, FreeBSD’s tar accepts either ‘-j’ or ‘-y’ for bzip2 / bunzip2.

[quote]Nate, have you ever tried to use man pages with telnet? They are
worthless. You can’t read anything except the first 24 lines.

[/quote]

Sounds like you’re using a bad terminal client and / or an improper setting of TERM. Can you explain how exactly you’re only able to read the first 24 lines? Try using putty or some other decent terminal client. We don’t use telnet (we generally use ssh), but we certainly do read man pages remotely on a regular basis.


#5

What settings are you supposed to use with Win98’s telnet? I’ve always used it on the default VT100/ANSI. We’re supposed to use VT52?

Signal 9 is SIGKILL. What do I need to do to keep the make process from being killed?


#6

I don’t know much about your other question, but windows telnet is about the worst application that I’ve ever used. A better one (that supports SSH so your data is encrypted) is puTTY. I won’t be without it on my windows machines. You can find/download it here:
http://www.chiark.greenend.org.uk/~sgtatham/putty/

The only settings required are your domain name, and to select SSH as the connection type.

Best Regards,
David


#7

I found that by simply running make over and over and over and over, I could get ImageMagick to compile.

However, it won’t install, because it can’t find gdbm. I’m not sure why it needs a database manager, but from googling, I am given to understand it demands it because the Perl executable was compiled against gdbm.

I retrieved gdbm and got it to compile. However, when I try to install it, I get the message

[quote]To link against installed libraries in a given
directory, LIBDIR, you must use the `-LLIBDIR’
flag during linking.
You will also need to do one of the following:

  • add LIBDIR to the `LD_RUN_PATH’
    environment variable during linking

[/quote]

There are a lot of *.mak files. Any suggestions on how to figure out which files I need to edit?

I also get:

[quote]/usr/bin/install -c -m 644 -o bin -g bin gdbm.h /home/–user–/gdbm/include/gdbm.h
/usr/bin/install: /home/–user–/gdbm/include/gdbm.h: Operation not permitted

[/quote]

Is this a permissions problem? The include directory was created by make with 775 permissions, and when I changed it to 777 permissions, I still get the “Operation not permitted”


#8

Try asking support to install the libgdbmg1-dev package… this should have the include files you need.