[magick-users] local (no root privileges) ImageMagick building and installation cheatsheet

Sergei Steshenko sergstesh at yahoo.com
Mon Oct 10 09:58:54 PDT 2005


Hello All,

it took some effort from me to figure out how to build and install ImageMagick
locally, i.e. not using root privileges.

I summarized my experience in a cheatsheet to be found as attachment.

I suggest to include the cheatsheet into ImageMagick documentation or, at
least, to give a link to it (it will be in the list archives) from the
documentation page.

Regards,
  Sergei.


	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
-------------- next part --------------
Local (non-root) ImageMagick building and installation cheatsheet.
-----------------------------------------------------------------

The command lines below are given in csh/tcsh syntax.


1) Choose or create a directory for downloads - it will be called
<downloads_dir>, for example:

mkdir ~/downloads;



2) Change directory to <downloads_dir>, for example:

cd downloads/



3) Download ImageMagick source tarball, for example:

wget -t0 ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.2.5-1.tar.gz



4) Unpackage the above downloaded tarball, for example:

tar -zxvf ImageMagick-6.2.5-1.tar.gz
.

The above 'tar' command will produce ImageMagick-X.Y.Z directory - it will
be called <version_dir>, for example ImageMagick-6.2.5.



5) Change directory to <version_dir>, for example:

cd ImageMagick-6.2.5
.


6) Run the 'configure' script using the command line below:

./configure \
--enable-shared \
--with-modules \
--with-quantum-depth=16 \
--prefix=`pwd` \
--exec-prefix=`pwd` \
--with-perl-options=PREFIX=`pwd` \
--disable-installed \
--enable-delegate-build


The command line is meant to have binaries installed under

<downloads_dir>/<version_dir>/bin
.

Adjust the command line if you want some other location, components,
quantum depth.

However, pay attention to the relationship between '--prefix=...',
'--exec-prefix=...', '--with-perl-options=PREFIX=...' - I strongly suggest
to keep it the same.

If you find out that some sources on which the selected ImageMagick
configuration depends are missing, install them and rerun 'configure'.

Screen output of 'configure' is pretty self-explanatory.



7) Run make:

make


8) If the above step is successful, install ImageMagick - as said before, binaries
will be under <downloads_dir>/<version_dir>/bin, libraries - under
<downloads_dir>/<version_dir>/lib, etc.:

make install


9) Test ImageMagick's 'convert', for that you'll need to set MAGICK_HOME
environment variable to be <downloads_dir>/<version_dir>, for example:

(setenv MAGICK_HOME ~/downloads/ImageMagick-6.2.5 ; $MAGICK_HOME/bin/convert -debug All screenshot.png screenshot.jpg)
.
The above command line assumes input and output screenshot.* images reside
in current working directory.

Analyze screen output of the command and make sure locally installed
ImageMagick components have been used.


10) Test the Perl stuff - for this a simple script is suggested
(test_PerlMagick.pl):


#!/usr/bin/perl -w

use Image::Magick;

use strict;

foreach my $item(sort keys %INC)
  {
  warn "$item => $INC{$item}\n";
  }

warn "\@ARGV=@ARGV";

my ($_input_file, $_output_file) = @ARGV;


my $_image = Image::Magick->new;

warn "\$_image=$_image";

my $_read_result = $_image->Read($_input_file);
warn "\$_read_result=$_read_result";

my $_write_result = $_image->Write($_output_file);
warn "\$_write_result=$_write_result";
# End of script


As before, MAGICK_HOME should be <downloads_dir>/<version_dir>, for example:

(setenv MAGICK_HOME ~/downloads/ImageMagick-6.2.5 ; perl -w -I$MAGICK_HOME/lib/perl5/site_perl/5.8.6/i386-linux test_PerlMagick.pl screenshot.png screenshot.jpg)
.

Analyze screen (STDERR) output of the script, in my case it was:

AutoLoader.pm => /usr/lib/perl5/5.8.6/AutoLoader.pm
Carp.pm => /usr/lib/perl5/5.8.6/Carp.pm
Config.pm => /usr/lib/perl5/5.8.6/i386-linux/Config.pm
DynaLoader.pm => /usr/lib/perl5/5.8.6/i386-linux/DynaLoader.pm
Exporter.pm => /usr/lib/perl5/5.8.6/Exporter.pm
Image/Magick.pm => /home/imtester/downloads/ImageMagick-6.2.5/lib/perl5/site_perl/5.8.6/i386-linux/Image/Magick.pm
strict.pm => /usr/lib/perl5/5.8.6/strict.pm
vars.pm => /usr/lib/perl5/5.8.6/vars.pm
warnings.pm => /usr/lib/perl5/5.8.6/warnings.pm
warnings/register.pm => /usr/lib/perl5/5.8.6/warnings/register.pm
@ARGV=screenshot.png screenshot.jpg at test_PerlMagick.pl line 12.
$_image=Image::Magick=ARRAY(0x804c180) at test_PerlMagick.pl line 19.
$_read_result= at test_PerlMagick.pl line 22.
$_write_result= at test_PerlMagick.pl line 25.
.

Pay attention to

Image/Magick.pm => /home/imtester/downloads/ImageMagick-6.2.5/lib/perl5/site_perl/5.8.6/i386-linux/Image/Magick.pm

line - it proves that locally built and installed version of Magick.pm has
been used.


Author: Sergei Steshenko.

End of document.
===============



More information about the Magick-users mailing list