投稿者 sdskid | 2011/11/02

gnuplot CVS版のなぞ – 解決か?

これまでさんざん悩んできたgnuplot cvsのconfigure時のエラー.久しぶりにやったところ今日も出くわしました.

今日の私がこれまでと違ったのは,冷静にエラーを見たこと.

ld: warning: in alloc.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in axis.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in binary.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in breaders.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in color.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in command.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in contour.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in datafile.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in dynarray.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in eval.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in fit.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in gadgets.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in getcolor.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in graph3d.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in graphics.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in help.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in hidden3d.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in history.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in internal.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in interpol.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in matrix.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in misc.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in mouse.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in parse.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in plot.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in plot2d.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in plot3d.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in pm3d.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in readline.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in save.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in scanner.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in set.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in show.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in specfun.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in standard.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in stats.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in stdfn.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in tables.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in tabulate.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in term.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in time.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in unset.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in util.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in util3d.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in variable.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in version.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in wxt_gui.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in gp_cairo.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in gp_cairo_helpers.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in bitmap.o, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/liblua.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libpangocairo-1.0.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libcairo.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libpangoft2-1.0.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libpango-1.0.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libgtk-quartz-2.0.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libgdk-quartz-2.0.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libatk-1.0.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /opt/local/lib/libgdk_pixbuf-2.0.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols:
“_main”, referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [gnuplot] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

はい.つまりX86-64じゃなくてi386対応のライブラリとかを準備してよ,ってことですかね.
確かに

$file /opt/local/lib/libpng.dylib
libpng.dylib: Mach-O 64-bit dynamically linked shared library x86_64

となります.(もちろん,macportsで入れてます)
そこで,

sudo port upgrade –enforce-variants libpng +universal

として,強制的にVariantsにUniversalを足すと,

$ file libpng.dylib 
libpng.dylib: Mach-O universal binary with 2 architectures
libpng.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
libpng.dylib (for architecture i386): Mach-O dynamically linked shared library i386

となります.おーすごーい.
という訳で,全部UniversalのVariantsを付けてコンパイルすれば良いのかな...
ここの考えにたどり着くまでにごちゃごちゃ試してるうちに訳が分からない状態に陥ってしまい,もうMacportsを入れ直すところからやるはめに・・・.
そうなるともう一つ頭をひねりました.いくら何でも一つずつ+universalを書くのはめんどくさい.
しかも試しに

GraphicsMagick +q32 +universal

としても,それにつられた入るlibpngとはかはなぜか全然Universalではなく,X86-64向け限定となってしまう.
これじゃ,なに?一個ずつi386対応にする訳???そんなのは嫌だ.
ということで,調べました.すべてをuniversal化する方法.本家のここに出てました

/opt/local/etc/macports/variants.conf に +unviersal を書き加える

確かにこれをやった後,

GraphicsMagick +q32

とすると,libpngなどもuniversal化されています.やったー.
macportsの再インストールとgnuplot cvs実行作戦については・・・つづく.

広告

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト /  変更 )

Google+ フォト

Google+ アカウントを使ってコメントしています。 ログアウト /  変更 )

Twitter 画像

Twitter アカウントを使ってコメントしています。 ログアウト /  変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト /  変更 )

%s と連携中

カテゴリー

%d人のブロガーが「いいね」をつけました。