0

Mac OSX10.6.3にh5pyをインストールしようとしています。

最初に、次のコマンドを使用してHDF51.8をインストールしました。

./configure \
--prefix=/Library/Frameworks/Python.framework/Versions/Current \
--enable-shared \
--enable-production \
--enable-threadsafe \
CPPFLAGS=-I/Library/Frameworks/Python.framework/Versions/Current/include \
LDFLAGS=-L/Library/Frameworks/Python.framework/Versions/Current/lib

make
make check
sudo make install

次に、h5pyをインストールします。

/Library/Frameworks/Python.framework/Versions/Current/bin/python \
setup.py \
build \
--api=18 \
--hdf5=/Library/Frameworks/Python.framework/Versions/Current

次に、エラーが発生しました。

******************************************
Configure: Autodetecting HDF5 settings...
    Custom HDF5 dir:       /Library/Frameworks/Python.framework/Versions/Current
    Custom API level:      (1, 8)
ld: warning: in detect/vers.o, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /Library/Frameworks/Python.framework/Versions/Current/lib/libhdf5.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.5.o

ld: symbol(s) not found

collect2: ld returned 1 exit status

Failed to compile HDF5 test program.  Please check to make sure:

* You have a C compiler installed
* A development version of Python is installed (including header files)
* A development version of HDF5 is installed (including header files)
* If HDF5 is not in a default location, supply the argument --hdf5=<path>
******************************************
error: command 'cc' failed with exit status 1

Xcodeを更新したばかりですが、これがgccのデフォルト設定によるものかどうかはわかりません。もしそうなら、どうすればこのエラーを取り除くことができますか?

ありがとう。

4

2 に答える 2

1

Intel C/C++ コンパイラを使用して Mac OS X で Python 拡張モジュールをビルドしようとしているときに、同様のエラーに遭遇しました。「未定義のシンボル: _main」エラーを修正するには、リンカー コマンドに次を追加する必要がありました: -bundle -undefined dynamic_lookup

「man ld」を実行して、特定のリンカ コマンドが何をするかを調べることができますが、基本的には、未定義のシンボルを気にせず、ライブラリがロードされたときにそれらを動的に検索するようにリンカに指示しています。

于 2010-12-12T21:16:27.007 に答える
0

macportsを使用する場合は、py26-h5pyを試してください。

于 2010-05-19T22:08:15.003 に答える