2014-09-06 3 views
1

установить gmpy2 так:как установить ошибку gmpy2: «MPFR_RNDU» необъявленная (первое использование в этой функции)

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 и их devel ,,, , но все еще так много ошибок. Зачем?

ответ

1

Я поддерживаю 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 и ПДК, то вам нужно будет скомпилировать ваш собственные версии 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 библиотеку в различных системах (для лаборатории или компьютерного кластера), можно составить статически скомпонованный. Если вам нужны эти инструкции, просто дайте мне знать.

+0

спасибо. Помогает. –

 Смежные вопросы

  • Нет связанных вопросов^_^