Where is defined __gmpq_cmp_z?

asked 2019-07-30 19:25:19 +0200

fylou gravatar image

I got the following error after launching sage in Debian10.

----> 7 cdef class Integer(EuclideanDomainElement):
        global cdef = undefined
        global Integer = undefined
        global EuclideanDomainElement = undefined
      8     # This is really of type mpz_t, but we don't use the mpz_t typedef
      9     # to work around Cython bug
     11     cdef __mpz_struct value[1]
     13     cdef int _to_ZZ(self, ZZ_c *z) except -1
     14     cdef void set_from_mpz(self, mpz_t value)
     15     cdef hash_c(self)
     17     cpdef __pari__(self)
     19     cpdef _shift_helper(Integer self, y, int sign)
     20     cpdef _add_(self, other)
     21     cpdef _mul_(self, other)
     22     cpdef _pow_(self, other)
     23     cdef _and(Integer self, Integer other)
     24     cdef _or(Integer self, Integer other)
     25     cdef _xor(Integer self, Integer other)
     27     cpdef size_t _exact_log_log2_iter(self,Integer m)
     28     cpdef size_t _exact_log_mpfi_log(self,m)
     29     cpdef RingElement _valuation(Integer self, Integer p)
     30     cdef object _val_unit(Integer self, Integer p)
     31     cdef Integer _divide_knowing_divisible_by(Integer self, Integer right)

ImportError: /usr/lib/python2.7/dist-packages/sage/rings/integer.x86_64-linux-gnu.so: undefined symbol: __gmpq_cmp_z

Have you any idea to solve this error? Thank you.

edit retag flag offensive close merge delete


In my case (Manjaro install):

[dan@k7 /usr/lib/python2.7/site-packages/sage]$ fgrep -l -r __gmpq_cmp_z .
dan_fulea gravatar imagedan_fulea ( 2019-07-31 03:32:51 +0200 )edit

There is no site-packages directory (target directory of manually built python packages) and no dynamic library rational.so, integer.so ,like you on the computer.

fylou gravatar imagefylou ( 2019-07-31 08:21:50 +0200 )edit

For that matter, those are just modules that reference that symbol, not the one where it's defined.

Iguananaut gravatar imageIguananaut ( 2019-08-14 14:17:06 +0200 )edit

mpq_cmp_z (which gets mangled to __gmpq_cmp_z) is part of GMP, which is a dependency of sage. How did you install sage?

Iguananaut gravatar imageIguananaut ( 2019-08-14 14:17:17 +0200 )edit