在过去 6 个月的大部分时间里,我一直在尝试让 rmagic 函数扩展在 ipython 笔记本中运行——我使用的是 MacOS——当我尝试加载 rmagic 时,内核崩溃了。

我在以前版本的 ipython 笔记本中使用 rpy2,但在途中的某个地方两者停止了通信。我装了,重装,又重装,把头砸在屏幕上了。

我尝试从 pip、easy_install 更新 rpy2,并从源代码编译。

Windows 的解决方案对我没有帮助。 一个也没有帮助。

当我 env ARCHFLAGS="-arch i386 -arch x86_64" python setup.py build install 从源头我得到一个分段错误。

这是我收到的错误:

sudo env ARCHFLAGS="-arch i386 -arch x86_64" python setup.py build install
running build
running build_py
running build_ext
Configuration for R as a library:
include_dirs: ('/Library/Frameworks/R.framework/Resources/include',)
libraries: ('Rblas', 'Rlapack')
library_dirs: ('/Library/Frameworks/R.framework/Resources/lib',)
extra_link_args: ('-framework R', '-F/Library/Frameworks/R.framework/..')
# OSX-specific (included in extra_link_args)
framework_dirs: ('-F/Library/Frameworks/R.framework/..',)
frameworks: ('-framework R',)
building 'rpy2.rinterface._rinterface' extension
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-    aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch i386 -arch x86_64 -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_SIGJMP=1 -DCSTACK_DEFNS=1 -DRIF_HAS_RSIGHAND=1 -I./rpy/rinterface -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/Library/Frameworks/R.framework/Resources/include -c ./rpy/rinterface/_rinterface.c -o build/temp.macosx-10.9-intel-2.7/./rpy/rinterface/_rinterface.o
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1

有人还有更多我可以尝试的建议吗?非常感谢您的任何建议。

有帮助吗?

解决方案

只需在构建 rpy2 之前设置这些环境变量:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

这里 了解更多信息。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top