How do I get Imagemagick supported on my server ?

77 posts / 0 new
Last post
Sun, 06/07/2009 - 07:53 (Reply to #51)
Donkzilla

googling for <i>imagick &quot;libgomp.so.1: shared object cannot be dlopen()ed&quot;</i> leads me to suspect gcc available via yum may be too old a version - similarly the ImageMagick version available via yum is so old it's fallen off the bottom of the ImageMagick changelog page. It looks like I may be able to score a win if I can get the latest and greatest version of gcc. I never realised trying to do a simple upgrade of ImageMagick to get jpegs and gifs images with rounded corners could turn into such a massive set of problems.
<a href='http://bugs.gentoo.org/223817' target='_blank'>http://bugs.gentoo.org/223817</a>

[url]
http://www.centos.org/modules/newbb/viewtopic.php?viewmode=flat&amp;topi...

<a href='http://groups.google.com/group/lovdbyless/browse_thread/thread/997bc21d2... target='_blank'>http://groups.google.com/group/lovdbyless/browse_thread/thread/997bc21d2...

<a href='http://blog.benkoski.com/2009/01/compiling-imagemagick-64-on-ubuntu-hard... target='_blank'>http://blog.benkoski.com/2009/01/compiling-imagemagick-64-on-ubuntu-hard...

More googling has revealed a possibly easier solution: Looks like a way around the problem is to place <div class='quote'>&acirc;

Wed, 05/06/2009 - 06:21 (Reply to #52)
Donkzilla

hi Joe, yes, I figured out what was going on with the backslash. I'm still struggling to get a compile. It compiled ok at the weekend... I've checked and double checked that all references to djvu have been removed... I must be doing something slightly different to the spec file than what I did when I got it to compile at the weekend... it's driving me nuts. I've got to get stuff done in my day job right now, I'll come back to this later tonight. Those pesky square corners are not going to get away with it.

Sun, 06/07/2009 - 07:53 (Reply to #53)
Donkzilla

here is my spec file:

[code:1]%define VER 6.5.1
%define Patchlevel 2

Name: ImageMagick
Version: %{VER}.%{Patchlevel}
Release: 1%{?dist}
Summary: An X application for displaying and manipulating images
Group: Applications/Multimedia
License: ImageMagick
Url: http://www.imagemagick.org/
Source0: ftp://ftp.ImageMagick.org/pub/%{name}/%{name}-%{VER}-%{Patchlevel}.tar.bz2
Patch1: ImageMagick-6.4.0-multilib.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: bzip2-devel, freetype-devel, libjpeg-devel, libpng-devel
BuildRequires: libtiff-devel, giflib-devel, zlib-devel, perl
BuildRequires: ghostscript-devel
BuildRequires: libwmf-devel, libtool-ltdl-devel
BuildRequires: libX11-devel, libXext-devel, libXt-devel
BuildRequires: lcms-devel, libxml2-devel, librsvg2-devel

%description
ImageMagick is an image display and manipulation tool for the X
Window System. ImageMagick can read and write JPEG, TIFF, PNM, GIF,
and Photo CD image formats. It can resize, rotate, sharpen, color
reduce, or add special effects to an image, and when finished you can
either save the completed work in the original format or a different
one. ImageMagick also includes command line programs for creating
animated or transparent .gifs, creating composite images, creating
thumbnail images, and more.

ImageMagick is one of your choices if you need a program to manipulate
and display images. If you want to develop your own applications
which use ImageMagick code or APIs, you need to install
ImageMagick-devel as well.

%package devel
Summary: Library links and header files for ImageMagick app development
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: libX11-devel, libXext-devel, libXt-devel
Requires: ghostscript-devel
Requires: bzip2-devel
Requires: freetype-devel
Requires: libtiff-devel
Requires: libjpeg-devel
Requires: lcms-devel
Requires: pkgconfig

%description devel
ImageMagick-devel contains the library links and header files you'll
need to develop ImageMagick applications. ImageMagick is an image
manipulation program.

If you want to create applications that will use ImageMagick code or
APIs, you need to install ImageMagick-devel as well as ImageMagick.
You do not need to install it if you just want to use ImageMagick,
however.

%package doc
Summary: ImageMagick html documentation
Group: Documentation

%description doc
ImageMagick documentation, this package contains usage (for the
commandline tools) and API (for the libraries) documentation in html format.
Note this documentation can also be found on the ImageMagick website:
http://www.imagemagick.org/

%package perl
Summary: ImageMagick perl bindings
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires: perl(:MODULE_COMPAT_%(eval &quot;`%{__perl} -V:version`&quot;; echo $version))

%description perl
Perl bindings to ImageMagick.

Install ImageMagick-perl if you want to use any perl scripts that use
ImageMagick.

%package c++
Summary: ImageMagick Magick++ library (C++ bindings)
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}

%description c++
This package contains the Magick++ library, a C++ binding to the ImageMagick
graphics manipulation library.

Install ImageMagick-c++ if you want to use any applications that use Magick++.

%package c++-devel
Summary: C++ bindings for the ImageMagick library
Group: Development/Libraries
Requires: %{name}-c++ = %{version}-%{release}
Requires: %{name}-devel = %{version}-%{release}

%description c++-devel
ImageMagick-devel contains the static libraries and header files you'll
need to develop ImageMagick applications using the Magick++ C++ bindings.
ImageMagick is an image manipulation program.

If you want to create applications that will use Magick++ code
or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
ImageMagick.
You don't need to install it if you just want to use ImageMagick, or if you
want to develop/compile applications using the ImageMagick C interface,
however.

%prep
%setup -q -n %{name}-%{VER}-%{Patchlevel}
%patch1 -p1 -b .multilib
sed -i 's/libltdl.la/libltdl.so/g' configure
iconv -f ISO-8859-1 -t UTF-8 README.txt &gt; README.txt.tmp
touch -r README.txt README.txt.tmp
mv README.txt.tmp README.txt
# for %doc
mkdir Magick++/examples
cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples

%build
%configure --enable-shared \
--disable-static \
--with-modules \
--with-perl \
--with-x \
--with-threads \
--with-magick_plus_plus \
--with-gslib \
--with-wmf \
--with-lcms \
--with-rsvg \
--with-xml \
--with-perl-options=&quot;INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/magick/.libs'&quot; \
--without-dps \
--disable-openmp \
--without-included-ltdl --with-ltdl-include=%{_includedir} \
--with-ltdl-lib=%{_libdir}
# Disable rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=&quot;&quot;|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
make

%install
rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT INSTALL=&quot;install -p&quot;
cp -a www/source $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{VER}
rm $RPM_BUILD_ROOT%{_libdir}/*.la

# fix weird perl Magick.so permissions
chmod 755 $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Image/Magick/Magick.so

# perlmagick: fix perl path of demo files
%{__perl} -MExtUtils::MakeMaker -e 'MY-&gt;fixin(@ARGV)' PerlMagick/demo/*.pl

# perlmagick: cleanup various perl tempfiles from the build which get installed
find $RPM_BUILD_ROOT -name &quot;*.bs&quot; |xargs rm -f
find $RPM_BUILD_ROOT -name &quot;.packlist&quot; |xargs rm -f
find $RPM_BUILD_ROOT -name &quot;perllocal.pod&quot; |xargs rm -f

# perlmagick: build files list
echo &quot;%defattr(-,root,root,-)&quot; &gt; perl-pkg-files
find $RPM_BUILD_ROOT/%{_libdir}/perl* -type f -print \
| sed &quot;s@^$RPM_BUILD_ROOT@@g&quot; &gt; perl-pkg-files
find $RPM_BUILD_ROOT%{perl_vendorarch} -type d -print \
| sed &quot;s@^$RPM_BUILD_ROOT@%dir @g&quot; \
| grep -v '^%dir %{perl_vendorarch}$' \
| grep -v '/auto$' &gt;&gt; perl-pkg-files
if [ -z perl-pkg-files ] ; then
echo &quot;ERROR: EMPTY FILE LIST&quot;
exit -1
fi

# These don't belong here, we include them in %%doc
rm $RPM_BUILD_ROOT%{_datadir}/%{name}-%{VER}/{ChangeLog,LICENSE,NEWS.txt}

# fix multilib issues
%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
%define wordsize 64
%else
%define wordsize 32
%endif

mv $RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config.h \
$RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config-%{wordsize}.h

cat &gt;$RPM_BUILD_ROOT%{_includedir}/%{name}/magick/magick-config.h &lt;&lt;EOF
#ifndef IMAGEMAGICK_MULTILIB
#define IMAGEMAGICK_MULTILIB

#include &lt;bits/wordsize.h&gt;

#if __WORDSIZE == 32
# include &quot;magick-config-32.h&quot;
#elif __WORDSIZE == 64
# include &quot;magick-config-64.h&quot;
#else
# error &quot;unexpected value for __WORDSIZE macro&quot;
#endif

#endif
EOF

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%post c++ -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%postun c++ -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc QuickStart.txt ChangeLog Platforms.txt
%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt
%{_libdir}/libMagickCore.so.*
%{_libdir}/libMagickWand.so.*
%{_bindir}/[a-z]*
%{_libdir}/%{name}-%{VER}
%{_datadir}/%{name}-%{VER}
%{_mandir}/man[145]/[a-z]*
%{_mandir}/man1/%{name}.*
#%exclude %{_libdir}/%{name}-%{VER}/modules-Q16/coders/djvu.*

%files devel
%defattr(-,root,root,-)
%{_bindir}/MagickCore-config
%{_bindir}/Magick-config
%{_bindir}/MagickWand-config
%{_bindir}/Wand-config
%{_libdir}/libMagickCore.so
%{_libdir}/libMagickWand.so
%{_libdir}/pkgconfig/MagickCore.pc
%{_libdir}/pkgconfig/ImageMagick.pc
%{_libdir}/pkgconfig/MagickWand.pc
%{_libdir}/pkgconfig/Wand.pc
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/magick
%{_includedir}/%{name}/wand
%{_mandir}/man1/Magick-config.*
%{_mandir}/man1/MagickCore-config.*
%{_mandir}/man1/Wand-config.*
%{_mandir}/man1/MagickWand-config.*

#%files djvu
#%defattr(-,root,root,-)
#%{_libdir}/%{name}-%{VER}/modules-Q16/coders/djvu.*

%files doc
%defattr(-,root,root,-)
%doc %{_datadir}/doc/%{name}-%{VER}

%files c++
%defattr(-,root,root,-)
%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
%doc www/Magick++/COPYING
%{_libdir}/libMagick++.so.*

%files c++-devel
%defattr(-,root,root,-)
%doc Magick++/examples
%{_bindir}/Magick++-config
%{_includedir}/%{name}/Magick++
%{_includedir}/%{name}/Magick++.h
%{_libdir}/libMagick++.so
%{_libdir}/pkgconfig/Magick++.pc
%{_libdir}/pkgconfig/ImageMagick++.pc
%{_mandir}/man1/Magick++-config.*

%files perl -f perl-pkg-files
%defattr(-,root,root,-)
%{_mandir}/man3/*
%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt[/code:1]

here is the command I run to try to compile:

<div class='quote'>rpmbuild -bb /usr/src/redhat/SPECS/ImageMagick.spec</div>

This command takes a good 10 to 15 minutes to run... and after a marathon amount of output, I end up with this:

<div class='quote'>+ cd /usr/src/redhat/BUILD
+ cd ImageMagick-6.5.1-2
+ DOCDIR=/var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-perl-6.5.1.2
+ export DOCDIR
+ rm -rf /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-perl-6.5.1.2
+ /bin/mkdir -p /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-perl-6.5.1.2
+ cp -pr PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-perl-6.5.1.2
+ exit 0
Provides: Magick.so perl(Image::Magick) = 6.5.1 perl(Turtle)
Requires(rpmlib): rpmlib(CompressedFileNames) &lt;= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) &lt;= 4.0-1 rpmlib(VersionedDependencies) &lt;= 3.0.3-1
Requires: ImageMagick = 6.5.1.2-1 libMagickCore.so.2 libMagickWand.so.2 libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1.3) libc.so.6(GLIBC_2.3.4) libc.so.6(GLIBC_2.4) libm.so.6 libm.so.6(GLIBC_2.0) perl &gt;= 0:5.002 perl(:MODULE_COMPAT_5.8.8) perl(AutoLoader) perl(Carp) perl(DynaLoader) perl(Exporter) perl(strict) perl(vars) rtld(GNU_HASH)
Processing files: ImageMagick-c++-6.5.1.2-1
error: File not found by glob: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/lib/libMagick++.so.*
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.86056
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd ImageMagick-6.5.1-2
+ DOCDIR=/var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-c++-6.5.1.2
+ export DOCDIR
+ rm -rf /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-c++-6.5.1.2
+ /bin/mkdir -p /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-c++-6.5.1.2
+ cp -pr Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-c++-6.5.1.2
+ cp -pr www/Magick++/COPYING /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-c++-6.5.1.2
+ exit 0
Processing files: ImageMagick-c++-devel-6.5.1.2-1
error: File not found: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/bin/Magick++-config
error: File not found: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/include/ImageMagick/Magick++.h
error: File not found: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/lib/libMagick++.so
error: File not found: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/lib/pkgconfig/Magick++.pc
error: File not found: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/lib/pkgconfig/ImageMagick++.pc
error: File not found by glob: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/man/man1/Magick++-config.*
Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.86056
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd ImageMagick-6.5.1-2
+ DOCDIR=/var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-c++-devel-6.5.1.2
+ export DOCDIR
+ rm -rf /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-c++-devel-6.5.1.2
+ /bin/mkdir -p /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-c++-devel-6.5.1.2
+ cp -pr Magick++/examples /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/doc/ImageMagick-c++-devel-6.5.1.2
+ exit 0

RPM build errors:
File not found by glob: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/lib/libMagick++.so.*
File not found: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/bin/Magick++-config
File not found: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/include/ImageMagick/Magick++.h
File not found: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/lib/libMagick++.so
File not found: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/lib/pkgconfig/Magick++.pc
File not found: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/lib/pkgconfig/ImageMagick++.pc
File not found by glob: /var/tmp/ImageMagick-6.5.1.2-1-root-root/usr/share/man/man1/Magick++-config.*
[root@domU-12-31-39-00-48-05:~]</div>

I don't have a copy of the spec file that worked ok for me the other day... I have no idea why what is basically the same spec file (as far as I remember) as the one that worked the other day fails now. I've tried it with and without --disable-openmp (correctly backslashed).

Wed, 05/06/2009 - 15:24 (Reply to #54)
Donkzilla

this forum boardcode has stripped out large parts of my spec file... hmmm... I'm cornered.

Thu, 05/07/2009 - 01:24 (Reply to #55)
Donkzilla

I think I was making a basic error by not first deleting the contents of the /usr/src/redhat/BUILD/ directory before trying each new compile. I'll keep bashing away at it til I get it right.

Thu, 05/07/2009 - 06:56 (Reply to #56)
Joe
Joe's picture

The BUILD directory is normally cleaned up during build, anyway. That is unlikely to be the cause of your trouble.

--

Check out the forum guidelines!

Thu, 05/07/2009 - 14:26 (Reply to #57)
Donkzilla

[img size=212]http://www.virtualmin.com/components/com_fireboard/uploaded/images/200h_...

I'd like to be able to explain for anybody following this, how I actually got there in the end... basically I had to read a book about RPMs and it took me literally dozens of attempts at building. I ended up with ImageMagick-6.5.2-3 and imagick-2.3.0rc1

If anyone has any particular questions, please feel free to ask. It can be done! BTW, I'm not using bleeding edges or anything, just the standard Virtualmin Pro CENTOS thingy.

Fri, 05/08/2009 - 03:39 (Reply to #58)
Donkzilla

here is a brief explanation of how I got there... whether it will work for other people, I don't know - a lot depends upon dependencies (hmm, yes, of course!)...

First, I made a lot of progress from the info on page 3 and page 4 of this thread. Next, cutting out details of the many failures along the way, I obtained the latest ImageMagick.src.rpm from here: <a href='ftp://ftp.imagemagick.org/pub/ImageMagick/linux/SRPMS/ImageMagick.src.rpm' target='_blank'>ftp://ftp.imagemagick.org/pub/ImageMagick/linux/SRPMS/ImageMagick.src.rp..., using this command:
<div class='quote'>
wget ftp://ftp.imagemagick.org/pub/ImageMagick/linux/SRPMS/ImageMagick.src.rp...

I then had some problems doing this:
<div class='quote'>rpmbuild --rebuild ImageMagick.src.rpm</div>

so I tried this:
<div class='quote'>rpm -ivh --nomd5 ImageMagick.src.rpm</div>

I couldn't find the spec file even though all seemed to be going well at this point... but I found a spec file I had accumulated from <i>somewhere</i> during the last week (by now I'd had a couple of beers and my brain was oiled for the home run). I had to severely hack this spec file to get rid of the c++ stuff. I can't post the contents of the file directly here because this forum will chew it up... so here it is as a file attachment (fingers crossed): [/file]

I placed the file in the relevant directory, then ran this:
<div class='quote'>rpmbuild -bb /usr/src/redhat/SPECS/ImageMagick.spec</div>

Next:
<div class='quote'>[root@domU-12-31-39-00-48-05:~] rpm -Uvh /usr/src/redhat/RPMS/i386/ImageMagick-6.5.2-3.i386.rpm
error: Failed dependencies:
ImageMagick = 6.5.1.2-1 is needed by (installed) ImageMagick-devel-6.5.1.2-1.i386
[root@domU-12-31-39-00-48-05:~] rpm -Uvh /usr/src/redhat/RPMS/i386/ImageMagick-6.5.1.2-1.i386.rpm
Preparing... ########################################### [100%]
package ImageMagick-6.5.1.2-1 is already installed
[root@domU-12-31-39-00-48-05:~]</div>

then:
<div class='quote'>[root@domU-12-31-39-00-48-05:~] yum remove ImageMagick
Loading &quot;installonlyn&quot; plugin
Setting up Remove Process
Resolving Dependencies
--&gt; Populating transaction set with selected packages. Please wait.
---&gt; Package ImageMagick.i386 0:6.5.1.2-1 set to be erased
--&gt; Running transaction check
Setting up repositories
virtualmin 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 951 B 00:00
virtualmin-universal 100% |=========================| 951 B 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
--&gt; Processing Dependency: libMagickWand.so.2 for package: ImageMagick-devel
--&gt; Processing Dependency: ImageMagick = 6.5.1.2-1 for package: ImageMagick-devel
--&gt; Processing Dependency: libMagickCore.so.2 for package: ImageMagick-devel
--&gt; Restarting Dependency Resolution with new changes.
--&gt; Populating transaction set with selected packages. Please wait.
---&gt; Package ImageMagick-devel.i386 0:6.5.1.2-1 set to be erased
--&gt; Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Removing:
ImageMagick i386 6.5.1.2-1 installed 12 M
Removing for dependencies:
ImageMagick-devel i386 6.5.1.2-1 installed 370 k

Transaction Summary
=============================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 2 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Removing : ImageMagick ######################### [1/2]
Removing : ImageMagick-devel ######################### [2/2]

Removed: ImageMagick.i386 0:6.5.1.2-1
Dependency Removed: ImageMagick-devel.i386 0:6.5.1.2-1
Complete!
[root@domU-12-31-39-00-48-05:~] rpm -Uvh /usr/src/redhat/RPMS/i386/ImageMagick-6.5.1.2-1.i386.rpm
Preparing... ########################################### [100%]
1:ImageMagick ########################################### [100%]
[root@domU-12-31-39-00-48-05:~] rpm -Uvh /usr/src/redhat/RPMS/i386/ImageMagick-6.5.2-3.i386.rpm
Preparing... ########################################### [100%]
1:ImageMagick ########################################### [100%]
/sbin/ldconfig: relative path `2' used to build cache
error: %post(ImageMagick-6.5.2-3.i386) scriptlet failed, exit status 1
[root@domU-12-31-39-00-48-05:~] rpm -Uvh /usr/src/redhat/RPMS/i386/ImageMagick-devel-6.5.2-3.i386.rpm
Preparing... ########################################### [100%]
1:ImageMagick-devel ########################################### [100%]
[root@domU-12-31-39-00-48-05:~] pecl uninstall imagick
Unable to remove &quot;extension=imagick.so&quot; from php.ini
uninstall ok: channel://pecl.php.net/imagick-2.3.0RC1
[root@domU-12-31-39-00-48-05:~] pecl install imagick-2.3.0RC1
downloading imagick-2.3.0RC1.tgz ... </div>

and finally:
<div class='quote'>/etc/init.d/httpd restart</div>

All done. Time for another beer.

Fri, 05/08/2009 - 03:42 (Reply to #59)
Donkzilla

here is a brief explanation of how I got there... whether it will work for other people, I don't know - a lot depends upon dependencies (hmm, yes, of course!)...

First, I made a lot of progress from the info on page 3 and page 4 of this thread. Next, cutting out details of the many failures along the way, I obtained the latest ImageMagick.src.rpm from here: <a href='ftp://ftp.imagemagick.org/pub/ImageMagick/linux/SRPMS/ImageMagick.src.rpm' target='_blank'>ftp://ftp.imagemagick.org/pub/ImageMagick/linux/SRPMS/ImageMagick.src.rp..., using this command:
<div class='quote'>
wget ftp://ftp.imagemagick.org/pub/ImageMagick/linux/SRPMS/ImageMagick.src.rp...

I then had some problems doing this:
<div class='quote'>rpmbuild --rebuild ImageMagick.src.rpm</div>

so I tried this:
<div class='quote'>rpm -ivh --nomd5 ImageMagick.src.rpm</div>

I couldn't find the spec file even though all seemed to be going well at this point... but I found a spec file I had accumulated from <i>somewhere</i> during the last week (by now I'd had a couple of beers and my brain was oiled for the home run). I had to severely hack this spec file to get rid of the c++ stuff. I can't post the contents of the file directly here because this forum will chew it up... so here it is as a file attachment (fingers crossed): NOPE, IT WON'T UPLOAD... hmmm

I placed the file in the relevant directory, then ran this:
<div class='quote'>rpmbuild -bb /usr/src/redhat/SPECS/ImageMagick.spec</div>

Next:
<div class='quote'>[root@domU-12-31-39-00-48-05:~] rpm -Uvh /usr/src/redhat/RPMS/i386/ImageMagick-6.5.2-3.i386.rpm
error: Failed dependencies:
ImageMagick = 6.5.1.2-1 is needed by (installed) ImageMagick-devel-6.5.1.2-1.i386
[root@domU-12-31-39-00-48-05:~] rpm -Uvh /usr/src/redhat/RPMS/i386/ImageMagick-6.5.1.2-1.i386.rpm
Preparing... ########################################### [100%]
package ImageMagick-6.5.1.2-1 is already installed
[root@domU-12-31-39-00-48-05:~]</div>

then:
<div class='quote'>[root@domU-12-31-39-00-48-05:~] yum remove ImageMagick
Loading &quot;installonlyn&quot; plugin
Setting up Remove Process
Resolving Dependencies
--&gt; Populating transaction set with selected packages. Please wait.
---&gt; Package ImageMagick.i386 0:6.5.1.2-1 set to be erased
--&gt; Running transaction check
Setting up repositories
virtualmin 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 951 B 00:00
virtualmin-universal 100% |=========================| 951 B 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
--&gt; Processing Dependency: libMagickWand.so.2 for package: ImageMagick-devel
--&gt; Processing Dependency: ImageMagick = 6.5.1.2-1 for package: ImageMagick-devel
--&gt; Processing Dependency: libMagickCore.so.2 for package: ImageMagick-devel
--&gt; Restarting Dependency Resolution with new changes.
--&gt; Populating transaction set with selected packages. Please wait.
---&gt; Package ImageMagick-devel.i386 0:6.5.1.2-1 set to be erased
--&gt; Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Removing:
ImageMagick i386 6.5.1.2-1 installed 12 M
Removing for dependencies:
ImageMagick-devel i386 6.5.1.2-1 installed 370 k

Transaction Summary
=============================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 2 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Removing : ImageMagick ######################### [1/2]
Removing : ImageMagick-devel ######################### [2/2]

Removed: ImageMagick.i386 0:6.5.1.2-1
Dependency Removed: ImageMagick-devel.i386 0:6.5.1.2-1
Complete!
[root@domU-12-31-39-00-48-05:~] rpm -Uvh /usr/src/redhat/RPMS/i386/ImageMagick-6.5.1.2-1.i386.rpm
Preparing... ########################################### [100%]
1:ImageMagick ########################################### [100%]
[root@domU-12-31-39-00-48-05:~] rpm -Uvh /usr/src/redhat/RPMS/i386/ImageMagick-6.5.2-3.i386.rpm
Preparing... ########################################### [100%]
1:ImageMagick ########################################### [100%]
/sbin/ldconfig: relative path `2' used to build cache
error: %post(ImageMagick-6.5.2-3.i386) scriptlet failed, exit status 1
[root@domU-12-31-39-00-48-05:~] rpm -Uvh /usr/src/redhat/RPMS/i386/ImageMagick-devel-6.5.2-3.i386.rpm
Preparing... ########################################### [100%]
1:ImageMagick-devel ########################################### [100%]
[root@domU-12-31-39-00-48-05:~] pecl uninstall imagick
Unable to remove &quot;extension=imagick.so&quot; from php.ini
uninstall ok: channel://pecl.php.net/imagick-2.3.0RC1
[root@domU-12-31-39-00-48-05:~] pecl install imagick-2.3.0RC1
downloading imagick-2.3.0RC1.tgz ... </div>

and finally:
<div class='quote'>/etc/init.d/httpd restart</div>

All done. Time for another beer.

Fri, 05/08/2009 - 13:01 (Reply to #60)
Joe
Joe's picture

A well-deserved beer, I'd say.

--

Check out the forum guidelines!

Fri, 02/27/2009 - 04:15
Davvit

Thanks for replying,

I found this download page:
http://www.imagemagick.org/script/binary-releases.php#unix

My system info in VM pro gives me this:

Kernel and CPU Linux 2.6.18-53.1.14.el5 on i686

So do you think I should go for this download option:
ImageMagick-6.4.9-7.i586.rpm download download Fedora Core 10 i586 RPM

Please see download page link above.

Is it correct to do for a binary download or should I
be doing something else ?

Thanks for advice :)

Fri, 02/27/2009 - 04:35 (Reply to #62)
andreychek

There should be an imagemagick package for your distro in the repository-- you can install it from the command line by typing:

yum install imagemagick

That should work on RHEL/CentOS.
-Eric

Fri, 02/27/2009 - 04:53
Davvit

Hi,
I have tried that, but don't know if it worked.

Using &quot;putty&quot;, I got a &quot;nothing to do&quot; message !

Here is a pict:

[img size=150]http://www.tor-forum.org/yum.jpg[/img]

What should I do now ?

Fri, 02/27/2009 - 04:57
Davvit

Maybe this image is better:

[img size=150]http://www.tor-forum.org/yum.jpg[/img]

Fri, 02/27/2009 - 09:33
BossHog

Hey Eric,
this brings up an interesting point.
I overlooked the package because of the capital &quot;I&quot; in ImageMagick, I did look in the CentOS-5 repo and scrolled right down the page to the &quot;i&quot; packages. Doh!
Is yum case sensitive?
Just a thought.
Joe

Fri, 02/27/2009 - 14:52 (Reply to #66)
Joe
Joe's picture

Yes, yum (and RPM) is case sensitive. It's an accident of history that ImageMagick doesn't get downcased, I think. It's a really old library, and it's always been named ImageMagick, so I guess it just continues to be named ImageMagick, even though the vast majority of packages get downcased.

--

Check out the forum guidelines!

Sun, 03/01/2009 - 05:37
Davvit

Hi,
Thanks for reply.

Using Putty, I logged in and got the:

[root@heavyhoster ~]# prompt

( I hope thats a good sign ? )

Then I typed in what you suggested:
rpm -qa | grep imagemagick

Nothing came back, just the prompt:

[root@heavyhoster ~]#

So what does that mean ?

( I guess you can tell that I am new to this ? )

Sun, 03/01/2009 - 10:04
Davvit

OK - since you must all be tucked up in bed
( or out on the town ! ) I have now tried to enter
the install command:

[root@heavyhoster ~]# pecl install imagick

This is the result:
downloading imagick-2.2.2.tgz ...
Starting to download imagick-2.2.2.tgz (77,212 bytes)
.................done: 77,212 bytes
11 source files, building
running: phpize
sh: phpize: command not found
ERROR: `phpize' failed

[root@heavyhoster ~]#

Any idea why it errored ?
What can I do now ?

Thanks.

Sun, 03/01/2009 - 10:59 (Reply to #69)
andreychek

Howdy,

Well, regarding the rpm command you typed, try tweaking it to this, which does a case-insensitive search:

rpm -qa | grep -i imagemagick

You'll definitely need to have the ImageMagick package installed for any of this to work.

Next, regarding the pecl command you typed -- you're on the right path, but it looks like you're missing the &quot;phpize&quot; program, which is used to compile PHP libraries.

You can install it by typing:

yum install php-devel

With Imagemagick and phpize installed, that should get you to the point where you can install that imagick PHP module.
-Eric

Sun, 03/01/2009 - 20:01
Davvit

Hi again.
Thanks for helping.

Well I installed the php-devel
by typing &quot;yum install php-devel&quot;

In the end it gave me this message:

Installed: php-devel.i386 0:5.1.6-20.el5_2.1
Dependency Installed: autoconf.noarch 0:2.59-12 automake.noarch 0:1.9.6-2.1 imake.i386 0:1.0.2-3
Complete!

[root@heavyhoster ~]#

So I hope that this is an uptodate version of what I need.

Now I also typed this:
[root@heavyhoster ~]# rpm -qa | grep -i imagemagick

and I just got my prompt back:
[root@heavyhoster ~]#

So I guess that means I don't have what I need yet ?

What should I do now ?

Mon, 03/02/2009 - 20:45
Davvit

OK - thanks Ronald.

It worked - lots an lots of stuff about gnomes and
magick - but no hob-goblins ?

Finally this arrived:

Installed: ImageMagick.i386 0:6.2.8.0-4.el5_1.1
Dependency Installed: audiofile.i386 1:0.2.6-5 avahi.i386 0:0.6.16-1.el5_2.1 avahi-glib.i386 0:0.6.16-1.el5_2.1 chkfontpath.i386 0:1.10.1-1.1 esound.i386 1:0.2.36-3 gamin.i386 0:0.1.7-8.el5 ghostscript.i386 0:8.15.2-9.3.el5 ghostscript-fonts.noarch 0:5.50-13.1.1 gnome-keyring.i386 0:0.6.0-1.fc6 gnome-mime-data.i386 0:2.4.2-3.1 gnome-mount.i386 0:0.5-3.el5 gnome-vfs2.i386 0:2.16.2-4.el5 lcms.i386 0:1.15-1.2.2.el5_2.2 libFS.i386 0:1.0.0-3.1 libXfont.i386 0:1.2.2-1.0.3.el5_1 libbonobo.i386 0:2.16.0-1.fc6 libbonoboui.i386 0:2.16.0-1.fc6 libcroco.i386 0:0.6.1-2.1 libdaemon.i386 0:0.10-5.el5 libfontenc.i386 0:1.0.2-2.2.el5 libglade2.i386 0:2.6.0-2 libgnome.i386 0:2.16.0-6.el5 libgnomecanvas.i386 0:2.14.0-4.1 libgnomeui.i386 0:2.16.0-5.el5 libgsf.i386 0:1.14.1-6.1 librsvg2.i386 0:2.16.1-1.el5 libwmf.i386 0:0.2.8.4-10.1 libxslt.i386 0:1.1.17-2.el5_2.2 shared-mime-info.i386 0:0.19-5.el5 ttmkfdir.i386 0:3.0.9-23.el5 urw-fonts.noarch 0:2.3-6.1.1 xorg-x11-font-utils.i386 1:7.1-2 xorg-x11-xfs.i386 1:1.0.2-4
Complete!

I did a check:
[root@heavyhoster ~]# rpm -qa | grep -i imagemagick

And got this:
ImageMagick-6.2.8.0-4.el5_1.1
[root@heavyhoster ~]#

So I guess thats good !

Thanks again

Sun, 05/03/2009 - 11:30
Donkzilla

hi everyone, I'm back again! I managed to get some coding done at last. Then I ran into a problem: The most up-to-date version of ImageMagick in the yum repository is 6.2.8. In order for one of my scrips to work (create images with rounded corners), I need at least version 6.2.9.

I've done a fair bit of googling and keep coming to the same conclusion: I need to uninstall ImageMagick and manually install the latest version (6.5.1). This is where I come unstuck - linux administration is not one of my strong points - hence why I use Virtualmin. I can probably follow the gist of the instructions here ok: <a href='http://www.imagemagick.org/script/install-source.php' target='_blank'>http://www.imagemagick.org/script/install-source.php</a>, but first, I don't have a clue which directory to put ImageMagick.tar.gz in before I can unpack it.

So who better to ask about this kind of stuff, than the experts! Thanks in advance ;)

Sun, 05/03/2009 - 13:06 (Reply to #73)
Joe
Joe's picture

I would strongly recommend you get ahold of a more recent SRPM and rebuild it for your system. This keeps things under control of the package manager on the system...so when you upgrade your OS a year or two from now, it'll all go smooth and happy.

Fedora is usually where I go for the latest greatest SRPMS, and sure enough, you can find 6.5.1 in the development version of Fedora:

http://mirrors.kernel.org/fedora/development/source/SRPMS/ImageMagick-6....

So, grab that, and try a rebuild. Assuming you already have gcc, rpm-build, and the rest of the development tools installed, and you have a little good luck, it'll just work.

rpmbuild --rebuild ImageMagick-6.5.1.2-1.fc11.src.rpm

If it doesn't just work, it'll give you some clues about why. Missing dependencies, etc. This is where luck comes in...as long as the library doesn't require extremely new versions of any of the libraries it builds against, you should be able to get all of the dependencies it needs using yum. If the versions available on your OS aren't new enough, it might cause some problems. If you want to bring them up here, I can probably lend some guidance. I've built way more than my fair share of RPMs over the years.

--

Check out the forum guidelines!

Sun, 06/07/2009 - 07:53
Joe
Joe's picture

You do <i>not</i> want to fiddle with the gcc version. Life gets real hard real fast when messing with that evilly long dependency chain.

Disabling openmp is the way to go.

ImageMagick.spec contains the calls to the ImageMagick configure script. Remember earlier when we disabled dejavu in the configure section of the spec file? That's where you want to add the --disable-openmp option. There will usually be a list of those sorts of options. I don't have the ImageMagick spec file in front of me but I'm pretty confident there will be a section that starts with %configure and it will contain options like that, and you'll want to stick it in there (note the \ at the end of lines...those are escapes for the newline...to make it all one command...you'll need to include...ah, screw it...describing this is way too complicated). Here's an example:

%configure --enable-shared \
--disable-static \
--with-modules \
--with-perl \
--with-x \
--with-threads \
--with-magick_plus_plus \
--with-gslib \
--with-wmf \
--with-lcms \
--with-rsvg \
--with-xml \
--with-perl-options=&quot;INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/magick/.libs'&quot; \
--without-dps \
--disable-openmp

Be careful, this is not a copy/pasta situation. I just found this ImageMagick.spec on the web to use for example purposes, so it probably does not match yours exactly. Note that I added a \ after --without-dps and then added --disable-openmp. You need to do that in your spec file.

--

Check out the forum guidelines!

Sun, 06/07/2009 - 07:53
Joe
Joe's picture

You do <i>not</i> want to fiddle with the gcc version. Life gets real hard real fast when messing with that evilly long dependency chain.

Disabling openmp is the way to go.

ImageMagick.spec contains the calls to the ImageMagick configure script. Remember earlier when we disabled dejavu in the configure section of the spec file? That's where you want to add the --disable-openmp option. There will usually be a list of those sorts of options. I don't have the ImageMagick spec file in front of me but I'm pretty confident there will be a section that starts with %configure and it will contain options like that, and you'll want to stick it in there (note the \ at the end of lines...those are escapes for the newline...to make it all one command...you'll need to include...ah, screw it...describing this is way too complicated). Here's an example:

%configure --enable-shared \
--disable-static \
--with-modules \
--with-perl \
--with-x \
--with-threads \
--with-magick_plus_plus \
--with-gslib \
--with-wmf \
--with-lcms \
--with-rsvg \
--with-xml \
--with-perl-options=&quot;INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/magick/.libs'&quot; \
--without-dps \
--disable-openmp

Be careful, this is not a copy/pasta situation. I just found this ImageMagick.spec on the web to use for example purposes, so it probably does not match yours exactly. Note that I added a \ after --without-dps and then added --disable-openmp. You need to do that in your spec file.

--

Check out the forum guidelines!

Tue, 05/05/2009 - 23:31
Joe
Joe's picture

Crap. I just noticed that the backslash has been completely stripped from my comment by our godawful forum (which is nearing death...I'm starting to move data over to the new website as we speak), making both my example and the explanation nonsensical. Hopefully you noticed the backslashes in the spec file and figure out that that's what I was talking about. ;-)

--

Check out the forum guidelines!

Pages