#19610: Fix dependencies on PARI
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: defect | Status: needs_info
Priority: major | Milestone: sage-6.10
Component: cython | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jdemeyer/fix_dependencies_on_pari| 5d0e4d30588ab0f13bfc0770d2b4b407d7580035
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by leif):
The following works for me to get rid of GMP (i.e., avoids overlinking
`interrupt.so` with libgmp):
{{{
#!diff
diff --git a/src/sage/ext/interrupt/implementation.c
b/src/sage/ext/interrupt/implementation.c
index 7b96199..55dac47 100644
--- a/src/sage/ext/interrupt/implementation.c
+++ b/src/sage/ext/interrupt/implementation.c
@@ -42,7 +42,18 @@ AUTHORS:
#ifdef __linux__
#include <sys/prctl.h>
#endif
-#include <pari/pari.h>
+
+#include <pari/paricfg.h>
+#include <pari/parisys.h> /* needed for THREAD and VOLATILE */
+#if 0
+/* further includes would be needed, see below */
+#include <pari/paricom.h> /* needed for PARI_SIGINT_* */
+#else
+/* It's hard to selectively include PARI headers (i.e., declarations), */
+/* so we *copy* them (from pari/paricom.h): */
+extern THREAD VOLATILE int PARI_SIGINT_block, PARI_SIGINT_pending;
+#endif
+
#include "interrupt/struct_signals.h"
#include "interrupt/interrupt.h"
diff --git a/src/sage/ext/interrupt/interrupt.pxd
b/src/sage/ext/interrupt/interrupt.pxd
index 3818447..c1a3b54 100644
--- a/src/sage/ext/interrupt/interrupt.pxd
+++ b/src/sage/ext/interrupt/interrupt.pxd
@@ -1,4 +1,5 @@
# distutils: depends = INTERRUPT_DEPENDS
+# distutils: libraries = pari
#
# NOTE: these functions are actually defined in "macros.h".
# However, we intentionally do not mention that file here, because
diff --git a/src/sage/ext/interrupt/interrupt.pyx
b/src/sage/ext/interrupt/interrupt.pyx
index ed4552a..97dd96d 100644
--- a/src/sage/ext/interrupt/interrupt.pyx
+++ b/src/sage/ext/interrupt/interrupt.pyx
@@ -23,9 +23,6 @@ from libc.signal cimport *
from libc.stdio cimport freopen, stdin
from cpython.exc cimport PyErr_Occurred
-# Needed for PARI_SIGINT_block in implementation.c:
-cimport sage.libs.pari.paridecl
-
cdef extern from "interrupt/implementation.c":
sage_signals_t _signals "_signals"
void setup_sage_signal_handler() nogil
}}}
(preliminary hack)
Probably another `distutils: depends` for PARI is needed in
`sage/ext/interrupt/interrupt.pxd`.
--
Ticket URL: <http://trac.sagemath.org/ticket/19610#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.