Установите h5py в Mac OS X 10.6.3 - PullRequest
0 голосов
/ 20 мая 2010

Я пытаюсь установить h5py в Mac OS X 10.6.3.

Сначала я установил HDF5 1.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 по умолчанию Если так, как я могу избавиться от этой ошибки?

Спасибо.

Ответы [ 2 ]

1 голос
/ 13 декабря 2010

Я только что столкнулся с подобной ошибкой при попытке построить модуль расширения Python в Mac OS X с помощью компилятора Intel C / C ++. Чтобы исправить ошибку «неопределенные символы: _основная», мне пришлось добавить в команду компоновщика следующее: -bundle -undefined dynamic_lookup

Вы можете сделать 'man ld', чтобы узнать, что делают конкретные команды компоновщика, но в основном вы говорите компоновщику, чтобы он не беспокоился о неопределенных символах и динамически их просматривал при загрузке библиотеки.

0 голосов
/ 20 мая 2010

Если вы используете macports, попробуйте: py26-h5py

...