这是我在ubuntu 14上设置pypy沙箱时遇到的错误。 如果你能找到任何线索,请帮忙
(my-pypy-env)sterilistic@sterilistic:~/Desktop/Coderunner/pypy-4.0.1-src/pypy/goal$ ../../rpython/bin/rpython -O2 --sandbox targetpypystandalone.py
[translation:info] 2.7.10 (5f8302b8bf9f, Nov 18 2015, 10:46:49)
[translation:info] [PyPy 4.0.1 with GCC 4.6.3]
[platform:msg] Set platform with 'host' cc=None, using cc='gcc', version='Unknown'
[translation:info] Translating target as defined by targetpypystandalone
[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused /tmp/usession-release-4.0.1-9/gcctest.c -o /tmp/usession-release-4.0.1-9/gcctest.o
[platform:execute] gcc /tmp/usession-release-4.0.1-9/gcctest.o -pthread -Wl,--export-dynamic -lrt -o /tmp/usession-release-4.0.1-9/gcctest
[platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused /tmp/usession-release-4.0.1-9/gcctest.c -o /tmp/usession-release-4.0.1-9/gcctest.o
[platform:execute] gcc /tmp/usession-release-4.0.1-9/gcctest.o -pthread -Wl,--export-dynamic -lrt -o /tmp/usession-release-4.0.1-9/gcctest
Traceback (most recent call last):
File "../../rpython/bin/rpython", line 20, in <module>
main()
File "/home/sterilistic/Desktop/Coderunner/pypy-4.0.1-src/rpython/translator/goal/translate.py", line 217, in main
targetspec_dic, translateconfig, config, args = parse_options_and_load_target()
File "/home/sterilistic/Desktop/Coderunner/pypy-4.0.1-src/rpython/translator/goal/translate.py", line 156, in parse_options_and_load_target
targetspec_dic = load_target(targetspec)
File "/home/sterilistic/Desktop/Coderunner/pypy-4.0.1-src/rpython/translator/goal/translate.py", line 98, in load_target
mod = __import__(specname)
File "targetpypystandalone.py", line 13, in <module>
from rpython.rlib import rthread
File "/home/sterilistic/Desktop/Coderunner/pypy-4.0.1-src/rpython/rlib/rthread.py", line 1, in <module>
from rpython.rtyper.lltypesystem import rffi, lltype, llmemory
File "/home/sterilistic/Desktop/Coderunner/pypy-4.0.1-src/rpython/rtyper/lltypesystem/rffi.py", line 1077, in <module>
maxint, sizeof(llmemory.Address)))
AssertionError: Mixed configuration of the word size of the machine:
the underlying Python was compiled with maxint=2147483647,
but the C compiler says that 'void *' is 8 bytes
答案 0 :(得分:0)
C编译器定义了沙箱可以计算的字节数。由于8字节的限制,这似乎是为32位机器设计的代码。来自this网页:
PyPy / RPython根据您用于运行构建的python版本做出了很多平台/架构决策。由于emscripten提供了32位运行时环境,因此您需要使用32位版本的python运行构建。 (我构建了一个32位的Ubuntu VM来实现这一目标。)
基本上,您需要运行32位版本的Python。我不确定如何在Windows和Linux上执行此操作,但here is a Stack Overflow link如何在Mac上执行此操作,这可能会为您提供一些起点。最好的办法是运行32-bit version of Ubuntu的虚拟机 - 只需在下载页面上选择32-bit
而不是64-bit
。
祝你好运!
答案 1 :(得分:0)
你正在运行PyPy 4.0.1 32位,它正在调用C编译器,它是gcc或clang 64位。您需要使这两者保持一致,例如通过下载并运行PyPy 4.0.1 64位。