mirror of
https://src.fedoraproject.org/rpms/sagemath.git
synced 2025-04-18 18:29:01 -04:00
45 lines
2.2 KiB
Diff
45 lines
2.2 KiB
Diff
diff -up sage-5.9/spkg/build/sage-5.9/sage/interfaces/gp.py.orig sage-5.9/spkg/build/sage-5.9/sage/interfaces/gp.py
|
|
--- sage-5.9/spkg/build/sage-5.9/sage/interfaces/gp.py.orig 2013-03-28 16:19:35.000000000 -0300
|
|
+++ sage-5.9/spkg/build/sage-5.9/sage/interfaces/gp.py 2013-05-06 17:34:56.021265319 -0300
|
|
@@ -977,11 +977,11 @@ def is_GpElement(x):
|
|
"""
|
|
return isinstance(x, GpElement)
|
|
|
|
-from sage.env import DOT_SAGE, SAGE_LOCAL
|
|
+from sage.env import DOT_SAGE, SAGE_EXTCODE
|
|
import os
|
|
|
|
-# Set GPRC environment variable to $SAGE_LOCAL/etc/gprc.expect
|
|
-os.environ["GPRC"] = os.path.join(SAGE_LOCAL, 'etc', 'gprc.expect')
|
|
+# Set GPRC environment variable to $SAGE_EXTCODE/pari/gprc.expect
|
|
+os.environ["GPRC"] = '%s/pari/gprc.expect'%SAGE_EXTCODE
|
|
|
|
# An instance
|
|
gp = Gp(logfile=os.path.join(DOT_SAGE,'gp-expect.log')) # useful for debugging!
|
|
diff -up sage-5.9/spkg/build/sage-5.9/sage/libs/pari/gen.pyx.orig sage-5.9/spkg/build/sage-5.9/sage/libs/pari/gen.pyx
|
|
--- sage-5.9/spkg/build/sage-5.9/sage/libs/pari/gen.pyx.orig 2013-05-06 17:34:09.952263554 -0300
|
|
+++ sage-5.9/spkg/build/sage-5.9/sage/libs/pari/gen.pyx 2013-05-06 17:34:24.826264124 -0300
|
|
@@ -182,6 +182,10 @@ include '../../ext/stdsage.pxi'
|
|
cdef extern from "mpz_pylong.h":
|
|
cdef int mpz_set_pylong(mpz_t dst, src) except -1
|
|
|
|
+cdef extern from "gmp.h":
|
|
+ cdef void mp_get_memory_functions(void**, void**, void**)
|
|
+ cdef void mp_set_memory_functions(void*, void*, void*)
|
|
+
|
|
# Make sure we don't use mpz_t_offset before initializing it by
|
|
# putting in a value that's likely to provoke a segmentation fault,
|
|
# rather than silently corrupting memory.
|
|
@@ -9218,7 +9222,12 @@ cdef class PariInstance(sage.structure.p
|
|
|
|
# The size here doesn't really matter, because we will allocate
|
|
# our own stack anyway. We ask PARI not to set up signal handlers.
|
|
+ cdef void *_gmp_malloc
|
|
+ cdef void *_gmp_realloc
|
|
+ cdef void *_gmp_free
|
|
+ mp_get_memory_functions(&_gmp_malloc, &_gmp_realloc, &_gmp_free)
|
|
pari_init_opts(10000, maxprime, INIT_JMPm | INIT_DFTm)
|
|
+ mp_set_memory_functions(_gmp_malloc, _gmp_realloc, _gmp_free)
|
|
num_primes = maxprime
|
|
|
|
# NOTE: sig_on() can only come AFTER pari_init_opts()!
|