- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我像这样安装 gmpy2:
yum install gmp-devel
yum install mpfr-devel
yum install libmpc-devel
但显示这些错误:
src/gmpy_mpc.c:1294: error: ‘gmpy_context’ has no member named ‘real_round’
src/gmpy_mpc.c:1294: error: ‘gmpy_context’ has no member named ‘real_round’
src/gmpy_mpc.c:1294: error: ‘gmpy_context’ has no member named ‘imag_round’
src/gmpy_mpc.c:1294: error: ‘gmpy_context’ has no member named ‘underflow’
src/gmpy_mpc.c:1294: error: ‘gmpy_context’ has no member named ‘trap_underflow’
src/gmpy_mpc.c:1294: error: ‘gmpy_context’ has no member named ‘overflow’
src/gmpy_mpc.c:1294: error: ‘gmpy_context’ has no member named ‘trap_overflow’
src/gmpy_mpc.c:1294: error: ‘gmpy_context’ has no member named ‘inexact’
src/gmpy_mpc.c:1294: error: ‘gmpy_context’ has no member named ‘trap_inexact’
..........
src/gmpy2.c:969: error: ‘MPFR_RNDU’ undeclared (first use in this function)
src/gmpy2.c:970: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy2.c:971: error: ‘MPFR_RNDA’ undeclared (first use in this function)
error: command 'gcc' failed with exit status 1
怎么了?我已经安装了 gmp、mpfr、mpc 和他们的开发,,,但仍然有很多错误。为什么?
最佳答案
我是 gmpy2 的维护者。
gmpy2
需要相对较新版本的 MPFR 和 MPC。如果setup.py
找不到合适的版本,它将显示以下警告消息:
----------------------------------------------------------------
setup.py was not able to detect the required versions of MPFR
and/or MPC. gmpy2 requires MPFR version 3.1.0 or greater and
MPC version 1.0.0 or greater. To specify a directory prefix that
contains the proper versions, use the --prefix=<dir> option.
In some circumstances, the correct versions may be present and
this warning can be ignored. If you have difficulties compiling
or running gmpy2, please try compiling with the --prefix option.
It is possible to compile gmpy2 without support for MPFR and MPC
but that is not a supported configuration. Beginning with v2.1.0,
MPFR and MPC will be required.
setup.py will continue and attempt to compile gmpy2.
-----------------------------------------------------------------
如果您无法安装最新版本的 GMP、MPFR 和 MPC,那么您需要编译自己版本的 GMP、MPFR 和 MPC,然后指示 setup.py
使用您的版本。我通常将副本安装到 /opt/local
中。以下说明假设源位于 /opt/local/src
中,并且您使用具有 sudo
访问权限的管理员帐户。
$ cd /opt/local/src/gmp-6.0.0
$ ./configure --prefix=/opt/local
$ make
$ make check
$ make install
$ cd /opt/local/src/mfr-3.1.2
$ ./configure --prefix=/opt/local --with-gmp=/opt/local
$ make
$ make check
$ make install
$ cd /opt/local/src/mpc-1.0.2
$ ./configure --prefix=/opt/local --with-gmp=/opt/local --with-mpfr=/opt/local
$ make
$ make check
$ make install
$ cd /opt/local/src/gmpy2-2.0.3
$ python setup.py build_ext --prefix=/opt/local
$ sudo python setup.py install
如果您需要在各种系统(实验室或计算机集群)上分发gmpy2
库,可以编译静态链接版本。如果您需要这些说明,请告诉我。
关于python - 如何安装gmpy2错误: ‘MPFR_RNDU’ undeclared (first use in this function),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25704776/
我想知道为什么这段代码在 Python 中 print gmpy.sqrt(2009) 给出结果 44,而不是 44.82186966... 就像我想要的那样?如何设置函数以显示十进制数。 提前谢谢你
我想使用导入 gmpy 的 python 脚本。然而,python 总是告诉我: ImportError: 没有名为“gmpy”的模块 我在 Ubuntu 14.04 i686 上,我尝试通过各种方式
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 6 年前。
我需要将一个 64 位整数从 DLL 传递到一个函数中,但 native python int 类型是 12 个字节(sys.getsizeof(1) 返回 12),我收到错误“ValueError:
我知道 import mpmath as mp print mp.libmp.BACKEND 但如果我没记错的话,它不会说我使用的是 gmpy 还是 gmpy2。 另外,每次你使用更新版本的东西时,你
这是我第一次尝试将 JIT 用于 python,这是我想要加速的用例。我读了一些关于 numba 的文章,它看起来很简单,但下面的代码没有提供任何加速。请原谅我可能犯的任何明显错误。 我也尝试按照 c
出于某种原因,我想在我的python(版本3.6.0)上安装gmpy2,我在pycharm上尝试过。 它给了我一条错误消息,如下所示: (我已经安装了pip),有人帮我吗?谢谢! 最佳答案 通常此类问
有人建议我使用 gmpy 来帮助有效地计算大数。在我只使用 python 之前,我的脚本运行了一两天然后内存不足(不确定这是怎么发生的,因为我的程序的内存使用基本上应该始终保持不变。可能是内存泄漏?)
我有 brew installed mpc 和 gmp ,但是当我尝试 pip install gmpy2 我得到一行编译错误 #include "mpc.h" 所以由于某种原因 clang 找不到
我无法在没有警告的情况下在 OS X Mountain Lion 上安装 gmpy(1 或 2)。我试过 pip,我试过编译,我安装了 gcc 4.2.1 并尝试用 i386 arch 编译 gmp(
我正在尝试使用名为 CatMAP 的程序这大量使用了 gmpy 依赖项(根据安装说明,我认为它是 gmpy,而不是 gmpy2)。 我通过 Anaconda 有 Python 2.7.12,但在安装
这方面有什么基准吗??? (我尝试用谷歌搜索一些结果,但没有找到...... 我无法测试 gmpy,因为 gmplib 不会安装在我的笔记本电脑上) 谢谢! 最佳答案 首先,我可能有偏见,因为我是 g
我已经在 Windows10 上安装了 Pyhton 3.7,当我运行 pip install gmpy 时,控制台向我返回此错误: Collecting gmpy Using cached ht
我已经在 Windows10 上安装了 Pyhton 3.7,当我运行 pip install gmpy 时,控制台向我返回此错误: Collecting gmpy Using cached ht
我是一名优秀的程序员,十分优秀!