Homebrew によるImageMagickのインストール
いちいち,プレビュー起動で見るのがめんどくさくなったので.
それよりは,displayコマンドで見たほうが楽ちんなことが多いのです.
ということで,設定します.
少しハマったので,むむむ??となりました.
そのメモメモを兼ねて入れます.
Homebrew のインストールだとかセットアップだとかについてはこちらを
Mac にHomebrew をインストールする - 日々鍛錬
また,Homebrewの詳しい説明については,以下のサイトが参考になります
HomeBrewの仕組みについてまとめておく - それマグで!
1. Homebrew のUpgradeとUpdate
まずは,HomebrewのDB内情報を最新版に更新します.
次のコマンドをタイプします.
ここで,
$brew update
Homebrew の本体とfomulaの本体をそのまま 全体としてUpdate
$brew upgrade
利用可能なUpdate version のformulaが存在するかを確認し,
その内容をupdate する
ところが,こちらのupdateをかけると,'Permision not defined'が出てしまいました...
この場合は,以下のコマンドを実行します.
sudo chown -R "whoami" /usr/local/Celler
他にもこんなエラー群が
error: The following untracked working tree files would be overwritten by merge:
Library/Formula/freeswitch.rb
Library/Formula/nailgun.rb
Library/Formula/storm.rb
Please move or remove them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
.
この場合は,gitの情報を書き換えました.
以下のコマンドを実行します.
$ cd /usr/local
$ git fetch origin
$ git reset --hard origin/master
これで,HomebrewのCellerに最新版をかけることができるわけですので,
この処理の後に,再度brew updateで最新版にしておきます.
その後,Imagemagickのインストール
$ brew install imagemagick --with-x11
エラーが以下の様に吐出された.
Warning: imagemagick dependency libtiff was built with a different C++ standard
library (libstdc++ from clang). This may cause problems at runtime.
/usr/local/Cellar/imagemagick/6.8.9-8: 1433 files, 22M, built in 93 seconds
昔のVersionと強豪しているので,最初にunlinkして,それからSoftwareをインストールします.
Softwareというのは,そうやって成立しているものだと改めて実感した.
$ brew unlink imagemagick
次は,ようやくおまたせなインストールのオプションを切り替えて,以下のコマンドで実行
$ export DISPLAY=:0.0
$ brew install imagemagick --disable-openmp --build-from-source --with-x11
画像系のSetupということを想定すると,おそらく,Exportの問題も絡みます.
以下を.profileに1行記述して,必ずsource読み込みをします.
export DISPLAY=:0.0
$ source .profile
以下のメッセージよりエラー無しで私はOKと判断しました!
brew install imagemagick --disable-openmp --build-from-source --with-x11
==> Downloading http://www.imagemagick.org/download/releases/ImageMagick-6.8.9-8
Already downloaded: /Library/Caches/Homebrew/imagemagick-6.8.9-8.tar.xz
==> ./configure --disable-osx-universal-binary --prefix=/usr/local/Cellar/imagem
==> make install
🍺 /usr/local/Cellar/imagemagick/6.8.9-8: 1437 files, 23M, built in 86 seconds
適当な画像をChoiceして実際にdisplay command で実行してみてください.
これで,実行できればImageMagickの設定は完了です.
要は,リポジトリはちゃんとupdateを掛けておきましょう!