我正在尝试安装这个fitio python包:https://github.com/esheldon/fitsio。
我试过了
pip install fitsio
和fitio目录中的python setup.py install
,它们都给出了类似的“错误注册”错误。这是pip install输出的开头:
Downloading/unpacking fitsio
Downloading fitsio-0.9.6.tar.gz (5.9MB): 5.9MB downloaded
Running setup.py (path:/private/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pip_build_Christina/fitsio/setup.py) egg_info for package fitsio
checking build system type... x86_64-apple-darwin13.3.0
checking host system type... x86_64-apple-darwin13.3.0
checking target system type... x86_64-apple-darwin13.3.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking bzlib.h usability... yes
checking bzlib.h presence... yes
checking for bzlib.h... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for gfortran... gfortran
checking whether we are using GNU Fortran...
yes
cfitsio: == Adding wrapper support for GNU Fortran...
done
checking for ar... ar
checking for ranlib... ranlib
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking whether gcc accepts -arch i386 -arch x86_64... no
cfitsio: == Using gcc version 4.8.2
checking "whether ftruncate works"... "yes"
checking "whether long long is defined"... "yes"
checking "whether system V style IPC services are supported"... "yes"
checking "do we have flock_t defined in sys/fcntl.h"... "no"
checking "do we have flock_t defined in sys/flock.h"... "no"
checking "do we have union semun defined"... "yes"
checking for library containing gethostbyname... none required
checking for library containing connect... none required
configure: creating ./config.status
config.status: creating Makefile
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cfitsio.pc
Congratulations, Makefile update was successful.
You may want to run "make" now.
gcc -c -o ./buffers.o -g -O2 -Dg77Fortran -fPIC -fno-common -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_BZLIB_H=1 -DHAVE_BZIP2=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MATH_H=1 -DHAVE_LIMITS_H=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DHAVE_FTRUNCATE=1 -DHAVE_LONGLONG=1 -DHAVE_SHMEM_SERVICES=1 -DHAVE_UNION_SEMUN=1 -DHAVE_NET_SERVICES=1 buffers.c
gcc -c -o ./cfileio.o -g -O2 -Dg77Fortran -fPIC -fno-common -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_BZLIB_H=1 -DHAVE_BZIP2=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MATH_H=1 -DHAVE_LIMITS_H=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DHAVE_FTRUNCATE=1 -DHAVE_LONGLONG=1 -DHAVE_SHMEM_SERVICES=1 -DHAVE_UNION_SEMUN=1 -DHAVE_NET_SERVICES=1 cfileio.c`
然后是更多的gcc行:
ar rv libcfitsio.a buffers.o cfileio.o checksum.o drvrfile.o drvrmem.o drvrnet.o drvrsmem.o drvrgsiftp.o editcol.o edithdu.o eval_l.o eval_y.o eval_f.o fitscore.o getcol.o getcolb.o getcold.o getcole.o getcoli.o getcolj.o getcolk.o getcoll.o getcols.o getcolsb.o getcoluk.o getcolui.o getcoluj.o getkey.o group.o grparser.o histo.o iraffits.o modkey.o putcol.o putcolb.o putcold.o putcole.o putcoli.o putcolj.o putcolk.o putcoluk.o putcoll.o putcols.o putcolsb.o putcolu.o putcolui.o putcoluj.o putkey.o region.o scalnull.o swapproc.o wcssub.o wcsutil.o imcompress.o quantize.o ricecomp.o pliocomp.o fits_hcompress.o fits_hdecompress.o simplerng.o zlib/adler32.o zlib/crc32.o zlib/deflate.o zlib/infback.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o zlib/uncompr.o zlib/zcompress.o zlib/zuncompress.o zlib/zutil.o f77_wrap1.o f77_wrap2.o f77_wrap3.o f77_wrap4.o; \
ranlib libcfitsio.a;
ar: creating archive libcfitsio.a
/opt/local/bin/ranlib: file: libcfitsio.a(drvrgsiftp.o) has no symbols
a - buffers.o
a - cfileio.o
a - checksum.o
a - drvrfile.o
a - drvrmem.o
a - drvrnet.o
a - drvrsmem.o
a - drvrgsiftp.o
a - editcol.o
a - edithdu.o
a - eval_l.o
a - eval_y.o
a - eval_f.o
a - fitscore.o
a - getcol.o
a - getcolb.o
a - getcold.o
a - getcole.o
a - getcoli.o
a - getcolj.o
a - getcolk.o
a - getcoll.o
a - getcols.o
a - getcolsb.o
a - getcoluk.o
a - getcolui.o
a - getcoluj.o
a - getkey.o
a - group.o
a - grparser.o
a - histo.o
a - iraffits.o
a - modkey.o
a - putcol.o
a - putcolb.o
a - putcold.o
a - putcole.o
a - putcoli.o
a - putcolj.o
a - putcolk.o
a - putcoluk.o
a - putcoll.o
a - putcols.o
a - putcolsb.o
a - putcolu.o
a - putcolui.o
a - putcoluj.o
a - putkey.o
a - region.o
a - scalnull.o
a - swapproc.o
a - wcssub.o
a - wcsutil.o
a - imcompress.o
a - quantize.o
a - ricecomp.o
a - pliocomp.o
a - fits_hcompress.o
a - fits_hdecompress.o
a - simplerng.o
a - zlib/adler32.o
a - zlib/crc32.o
a - zlib/deflate.o
a - zlib/infback.o
a - zlib/inffast.o
a - zlib/inflate.o
a - zlib/inftrees.o
a - zlib/trees.o
a - zlib/uncompr.o
a - zlib/zcompress.o
a - zlib/zuncompress.o
a - zlib/zutil.o
a - f77_wrap1.o
a - f77_wrap2.o
a - f77_wrap3.o
a - f77_wrap4.o
ranlib: file: libcfitsio.a(drvrgsiftp.o) has no symbols
Downloading/unpacking numpy from https://pypi.python.org/packages/source/n/numpy/numpy-1.9.2.tar.gz#md5=a1ed53432dbcd256398898d35bc8e645 (from fitsio)
Downloading numpy-1.9.2.tar.gz (4.0MB): 4.0MB downloaded
Running setup.py (path:/private/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pip_build_Christina/numpy/setup.py) egg_info for package numpy
Running from numpy source directory.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
Installing collected packages: fitsio, numpy
Running setup.py install for fitsio
make[1]: Nothing to be done for `stand_alone'.
building 'fitsio._fitsio_wrap' extension
gcc -fno-strict-aliasing -I/Users/Christina/anaconda/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icfitsio3370 -I/Users/Christina/anaconda/lib/python2.7/site-packages/numpy/core/include -I/Users/Christina/anaconda/include/python2.7 -c fitsio/fitsio_pywrap.c -o build/temp.macosx-10.5-x86_64-2.7/fitsio/fitsio_pywrap.o -arch i386 -arch x86_64
In file included from /Users/Christina/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1761:0,
from /Users/Christina/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from /Users/Christina/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from fitsio/fitsio_pywrap.c:28:
/Users/Christina/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by " \
^
关于弃用的NumPy API的最后一行是我无法解决的问题,但似乎可以忽略它。
在此之后,有很多行看起来像这样:
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:16:bad register name `%rbp'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:18:bad register name `%rbx'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:20:bad register name `%rdx'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:21:bad register name `%rsp'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:26:`L4(%rip)' is not a valid base/index expression
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:29:`movslq' is only supported in 64-bit mode
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:30:bad register name `%rdx'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:31:bad register name `%rax'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:50:bad register name `%rsi)'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:54:bad register name `%rbx)'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:58:bad register name `%rsp'
最后以
结束 error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Removing temporary dir /private/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pip_build_Christina... Command /Users/Christina/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pip_build_Christina/f\ itsio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/3p/v45zthb14d1\ d108h9y8xg6cw0000gn/T/pip-ww4Fvd-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/3p/v45zthb1\ 4d1d108h9y8xg6cw0000gn/T/pip_build_Christina/fitsio
Exception information:
Traceback (most recent call last): File "/Users/Christina/anaconda/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Users/Christina/anaconda/lib/python2.7/site-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Users/Christina/anaconda/lib/python2.7/site-packages/pip/req.py", line 1435, in install requirement.install(install_options, global_options, *args, **kwargs)
File "/Users/Christina/anaconda/lib/python2.7/site-packages/pip/req.py", line 706, in install cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Users/Christina/anaconda/lib/python2.7/site-packages/pip/util.py", line 697, in call_subprocess % (command_desc, proc.returncode, cwd))
InstallationError: Command /Users/Christina/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pi\ p_build_Christina/fitsio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/fol\ ders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pip-ww4Fvd-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/\ folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pip_build_Christina/fitsio
从广泛的谷歌搜索,似乎错误的寄存器问题来自于32位与64位系统的gcc标志混淆。但是setup.py似乎已经发现我有一个64位并希望将-arch i386 -arch x86_64
传递给gcc,但是这一行:
checking whether gcc accepts -arch i386 -arch x86_64... no
让我相信它不能出于某种原因。我不知道为什么。我正在运行MacPorts gcc版本4.8。以下是我做的一些检查,以确保是这种情况:
$port select --list gcc
Available versions for gcc:
llvm-gcc42
mp-gcc48 (active)
none
$which gcc
/opt/local/bin/gcc
非常感谢任何帮助/想法。
答案 0 :(得分:0)
我自己想出来了......
我进入setup.py并更改了这一行:
if platform.system()=='Darwin':
extra_compile_args=['-arch','i386',
'-arch','x86_64']
extra_link_args=['-arch','i386',
'-arch','x86_64']
删除i386。像这样:
if platform.system()=='Darwin':
extra_compile_args=['-arch','x86_64']
extra_link_args=['-arch','x86_64']
这消除了错误的寄存器错误。