Weblog13

お願い申し上げます。

gnuplot導入

2012-08-30 16:05:44 | 研究
昨日、ノリと勢いでOSをMountainLionにしました。
さらにgnuplotの記事を見て、自分も使ってみたい!と思ったのでインストールしてみました。
意外とめんどくさかったので、メモとして残しておきます。

1.Xcodeをインストール
まずXcodeをインストールして下さい。
appsoreに行けば見つかると思います。

2.macportsをインストール
インストールを楽にする為にmacportsをインストールしましょう。
http://www.macports.org/
からインストールできます。

3.macportsを使ってみる
macportsの情報を最新のものにするため

$ sudo port -d selfupdate

と入力してください。
そうすると

DEBUG: Copying /Users/******/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences
DEBUG: MacPorts sources location: /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
---> Updating MacPorts base sources using rsync
rsync: failed to connect to rsync.macports.org: Connection refused (61)
rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-42/rsync/clientserver.c(105) [receiver=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/base.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
Exit code: 10
DEBUG: Error synchronizing MacPorts sources: command execution failed
while executing
"macports::selfupdate [array get global_options] base_updated"
Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed

と出てきて上手く行かないはずです。

4.ポートをあける

->rsync: failed to connect to rsync.macports.org: Connection refused (61)
->rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-42/rsync/clientserver.c(105) [receiver=2.6.9]


と書いてある通りポートが開いていないのが問題です。
そこで~/.profile(無ければ作りましょう)に

http_proxy=http://<proxy_server>:<proxy_port>

と書き込んで下さい。

そして次に/opt/local/etc/macports/sources.confを開いて編集します。(sudoを使って下さい)

#rsync://rsync.macports.org/release/ports/ [default]
http://www.macports.org/files/ports.tar.gz [default]


としていただければ大丈夫です。

$ sudo port -d sync

とコマンドを入力して下さい。これでデータベースが最新のものになるはずです。

5. Command Line Tools for Xcodeのインストール
そこでもう一回

$ sudo port install gnuplot

と入力すると

Warning: The Command Line Tools for Xcode don't appear to be installed; most ports will likely fail to build.
Warning: See http://guide.macports.org/chunked/installing.xcode.html for more information.
---> Computing dependencies for gnuplotError: Unable to execute port: can't read "build.cmd": Failed to locate 'make' in path: '/usr/bin/svn' or at its MacPorts configuration time location, did you move it?


このようになるはずです。
->The Command Line Tools for Xcode don't appear to be installed
と書いてありますので、Xcodeを立ち上げてりんごの隣にある「Xcode」下の「preference」をクリックします。
そこにCommand Line Tools があるのでインストールして下さい。

$ sudo port -d install gnuplot

と入力すると


---> Building aquaterm
DEBUG: Executing org.macports.build (aquaterm)
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_www.macports.org_files_ports_aqua_aquaterm/aquaterm/work/AquaTerm-1.1.1/aquaterm" && /usr/bin/xcodebuild -target "AquaTerm" -configuration Default build OBJROOT=build/ SYMROOT=build/ MACOSX_DEPLOYMENT_TARGET=10.8 ARCHS=x86_64 SDKROOT="" GCC_VERSION=com.apple.compilers.llvm.clang.1_0 LOCAL_APPS_DIR=/Applications/MacPorts LOCAL_FRAMEWORKS_DIR=/opt/local/Library/Frameworks'

You have not agreed to the Xcode license agreements, please run 'xcodebuild -license' (for user-level acceptance) or 'sudo xcodebuild -license' (for system-wide acceptance) from within a Terminal window to review and agree to the Xcode license agreements.
Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_www.macports.org_files_ports_aqua_aquaterm/aquaterm/work/AquaTerm-1.1.1/aquaterm" && /usr/bin/xcodebuild -target "AquaTerm" -configuration Default build OBJROOT=build/ SYMROOT=build/ MACOSX_DEPLOYMENT_TARGET=10.8 ARCHS=x86_64 SDKROOT="" GCC_VERSION=com.apple.compilers.llvm.clang.1_0 LOCAL_APPS_DIR=/Applications/MacPorts LOCAL_FRAMEWORKS_DIR=/opt/local/Library/Frameworks
Exit code: 69
Error: org.macports.build for port aquaterm returned: command execution failed
DEBUG: Error code: NONE
DEBUG: Backtrace: command execution failed
while executing
"$procedure $targetname"
Warning: targets not executed for aquaterm: org.macports.activate org.macports.build org.macports.destroot org.macports.install
Error: Failed to install aquaterm
DEBUG: couldn't open "/System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tclIndex": no such file or directory
while executing
"open [file join $dir tclIndex]"
Please see the log file for port aquaterm for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_www.macports.org_files_ports_aqua_aquaterm/aquaterm/main.log
Error: The following dependencies were not installed: aquaterm expat fontconfig freetype bzip2 zlib libiconv gperf pkgconfig glib2 gettext ncurses libffi perl5 perl5.12 gdbm xz gd2 autoconf help2man p5.12-locale-gettext m4 automake jpeg libpng libtool xpm xorg-libXext xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-libXau xorg-xproto xorg-libXdmcp xorg-libxcb python27 db46 libedit openssl python_select sqlite3 xorg-libpthread-stubs xorg-xcb-proto libxml2 xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-util-macros xorg-libXt xorg-libsm xorg-libice lua readline pango Xft2 xrender xorg-renderproto cairo libpixman xorg-xcb-util gobject-introspection pdflib
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port gnuplot failed


またこんな事を言ってくるはずです。

->DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_www.macports.org_files_ports_aqua_aquaterm/aquaterm/work/AquaTerm-1.1.1/aquaterm" && /usr/bin/xcodebuild -target "AquaTerm" -configuration Default build OBJROOT=build/ SYMROOT=build/ MACOSX_DEPLOYMENT_TARGET=10.8 ARCHS=x86_64 SDKROOT="" GCC_VERSION=com.apple.compilers.llvm.clang.1_0 LOCAL_APPS_DIR=/Applications/MacPorts LOCAL_FRAMEWORKS_DIR=/opt/local/Library/Frameworks'

と言っているので、

$ cd /opt/local/var/macports/build/_opt_local_var_macports_sources_www.macports.org_files_ports_aqua_aquaterm/aquaterm/work/AquaTerm-1.1.1/aquaterm
$ /usr/bin/xcodebuild -target "AquaTerm" -configuration Default build OBJROOT=build/ SYMROOT=build/ MACOSX_DEPLOYMENT_TARGET=10.8 ARCHS=x86_64 SDKROOT="" GCC_VERSION=com.apple.compilers.llvm.clang.1_0 LOCAL_APPS_DIR=/Applications/MacPorts LOCAL_FRAMEWORKS_DIR=/opt/local/Library/Frameworks


を行い

$ sudo xcodebuild -license

でライセンスを開いてaccept と入力します。

そして

$ sudo port install -d gnuplot

と打てば終了です。

(追記)
MacBookAir にはインストール出来たのですが、iMacでは上手く行きませんでした。
ただいま原因を考え中です。

[参考にしたサイト様]
「gnuplot を Mac OS X Lion へインストール」
http://co.maxwell.jp/?page=gnuplot+%A4%F2+Mac+OS+X+Lion+%A4%D8%A5%A4%A5%F3%A5%B9%A5%C8%A1%BC%A5%EB
「ishwt::tracking : プロキシ環境(社内 LANとか)の中でMacPortsを使う」
http://ishwt.net/blog/2011/04/05/use-macports-at-inside-of-proxy/

最新の画像もっと見る

1 コメント

コメント日が  古い順  |   新しい順
Unknown (Unknown)
2013-08-17 11:54:01
Lion Serverに、gnuplotをインストールし、ターミナルから
$ gnuplot
で起動しようとしたところ、下記のようなエラーが出てしまいます。

dyld: Library not loaded: /opt/local/lib/libtiff.3.dylib
Referenced from: /opt/local/bin/gnuplot
Reason: image not found

Mac Book Air (Lion)では、このようなエラーは生じなかったのですが…。
お時間のある時に対処法をお教え頂けませんでしょうか?

コメントを投稿