Fitsio pip安装提供错误的寄存器错误,在64位MacBook P上使用MacPorts gcc

2024-06-01 11:24:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试安装这个fitsio python包:https://github.com/esheldon/fitsio。在

我试过了 pip install fitsiopython 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行:

^{pr2}$

关于不推荐使用的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

通过大量的google搜索,错误的寄存器问题似乎来自于gcc标志在32位与64位系统上的混淆。但是设置.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

如有任何帮助/建议,我们将不胜感激。在


Tags: installpippyforvaryesfoldersgcc
1条回答
网友
1楼 · 发布于 2024-06-01 11:24:05

我自己想出来的。。在

我进入了设置.py改变了这条线:

if platform.system()=='Darwin':
extra_compile_args=['-arch','i386',                                                     
                    '-arch','x86_64']
extra_link_args=['-arch','i386',                                                        
                 '-arch','x86_64']

卸下i386。是这样的:

^{pr2}$

这删除了错误的寄存器错误。在

相关问题 更多 >