黒羊庭園

技術系の話題とかその他

さくらVPSにPerlMagickをインストールしてみた

※注意

このやり方でインストールした場合、現状でpngの取り扱いができない事とAnnotateが動作していないので何か問題がある可能性があります。
ご注意ください

とりあえずざっくりPerlの準備

curl -LO http://xrl.us/perlbrew
chmod +x perlbrew
./perlbrew self-install
perlbrew init
source ~/perl5/perlbrew/etc/bashrc
perlbrew install-patchperl
perlbrew install perl-5.16.0
perlbrew switch perl-5.16.0
perlbrew install-cpanm

※最初のcurlhttpsのエラーとか出たら--insecureとかしちゃえばいいんじゃないですかね

ImageMagickインストール

yumはどうにもうまくいかなかったのでソースからインストールしました

wget ftp://ftp.kddlabs.co.jp/graphics/ImageMagick/ImageMagick-6.7.8-6.tar.gz
tar zxvf ImageMagick-6.7.8-6.tar.gz
cd ImageMagick-6.7.8-6.tar.gz
./configure --prefix $HOME/local/imagemagick --with-perl
make
make install
ln -s $HOME/local/imagemagick/bin/* .

※2012/7/29修正 リンクの追加

続いてPerlMagickをインストール

cpanmからのインストールはどうにも途中でコケるのでImageMagickのパッケージに入ってるものをソースから入れました

cd PerlMagick
perl Makefile.PL
make
make install

途中で

#Warning: -L../magick/.libs changed to -L{$HOME}/tmp/ImageMagick-6.7.8-6/PerlMagick/../magick/.libs
#Note (probably harmless): No library found for -lperl

というエラーが出るけど華麗にスルー
インストール成功しました


yumで試行錯誤したのですごく大変だった印象があったのですが、終わって見れば結構あっさりインストールできちゃうんですね


参考:
YellowStore: [perl]perlbrewな環境下でImage::Magickを使いたくなったのでセットアップしたというお話