Skip to content

Commit d8c1f35

Browse files
Jonathan KliemMatthias Koeppe
Jonathan Kliem
authored and
Matthias Koeppe
committed
Remove PARI
1 parent acd9d8b commit d8c1f35

File tree

3 files changed

+2
-34
lines changed

3 files changed

+2
-34
lines changed

README.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Requirements
3131
- Python >= 3.6
3232
- Cython >= 0.28
3333
- Sphinx >= 1.6 (for building the documentation)
34-
- PARI/GP (optional; for interfacing with the PARI/GP signal handler)
3534

3635
Links
3736
-----
@@ -47,7 +46,7 @@ Changelog
4746
^^^^^^^^^^^^^^^^^^^^^^^^^
4847

4948
* Replace `fprintf` by calls to `write`, which is async-signal-safe according to POSIX. [#162]
50-
* Introduce a general hook to interface with custom signal handling
49+
* Introduce a general hook to interface with custom signal handling and remove optional compile-time dependency on PARI/GP. [#166]
5150

5251

5352
1.11.2 (2021-12-15)

configure.ac

-17
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ AC_CONFIG_FILES([src/cysignals/signals.pxd])
1212

1313
AC_ARG_ENABLE(debug,
1414
AS_HELP_STRING([--enable-debug], [enable debug output]))
15-
AC_ARG_WITH(pari,
16-
AS_HELP_STRING([--without-pari], [build without PARI support]))
1715

1816
if test "$enable_debug" = yes; then
1917
AC_DEFINE([ENABLE_DEBUG_CYSIGNALS], 1, [Enable debug output])
@@ -30,21 +28,6 @@ AC_PROG_CXX()
3028
AC_CHECK_HEADERS([execinfo.h sys/mman.h sys/prctl.h sys/time.h sys/wait.h windows.h])
3129
AC_CHECK_FUNCS([fork kill sigprocmask sigaltstack backtrace])
3230

33-
34-
have_pari=no
35-
if test "$with_pari" != "no"; then
36-
AC_SEARCH_LIBS([pari_init], [pari], [
37-
AC_CHECK_DECL([PARI_SIGINT_block],
38-
[have_pari=yes], [],
39-
[[#include <pari/pari.h>]])])
40-
fi
41-
42-
if test "$have_pari" = "yes"; then
43-
AC_DEFINE([HAVE_PARI], 1, [Define to 1 if PARI is fully supported.])
44-
elif test "$with_pari" = "yes"; then
45-
AC_MSG_ERROR([PARI support requested but PARI was not found])
46-
fi
47-
4831
AC_MSG_CHECKING([for emms instruction])
4932
# We add the "leal" instruction to reduce false positives in case some
5033
# non-x86 architecture also has an "emms" instruction.

src/cysignals/implementation.c

+1-15
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ Interrupt and signal handling for Cython
5454
#include <sys/prctl.h>
5555
#endif
5656
#include <Python.h>
57-
#if HAVE_PARI
58-
#include <pari/pari.h>
59-
#else
60-
/* Fake PARI variables */
61-
static int PARI_SIGINT_block = 0;
62-
static int PARI_SIGINT_pending = 0;
63-
#define paricfg_version NULL
64-
#endif
6557

6658
// Custom signal handling of other packages.
6759
#define MAX_N_CUSTOM_HANDLERS 16
@@ -94,8 +86,6 @@ void custom_set_pending_signal(int sig){
9486
}
9587

9688
#if HAVE_WINDOWS_H
97-
/* We must include <windows.h> after <pari.h>
98-
* See https://github.com/sagemath/cysignals/issues/107 */
9989
#include <windows.h>
10090
#endif
10191
#include "struct_signals.h"
@@ -245,7 +235,7 @@ static void cysigs_interrupt_handler(int sig)
245235

246236
if (cysigs.sig_on_count > 0)
247237
{
248-
if (!cysigs.block_sigint && !PARI_SIGINT_block && !custom_signal_is_blocked())
238+
if (!cysigs.block_sigint && !custom_signal_is_blocked())
249239
{
250240
/* Raise an exception so Python can see it */
251241
do_raise_exception(sig);
@@ -268,7 +258,6 @@ static void cysigs_interrupt_handler(int sig)
268258
if (cysigs.interrupt_received != SIGHUP && cysigs.interrupt_received != SIGTERM)
269259
{
270260
cysigs.interrupt_received = sig;
271-
PARI_SIGINT_pending = sig;
272261
custom_set_pending_signal(sig);
273262
}
274263
}
@@ -431,7 +420,6 @@ static void _sig_on_interrupt_received(void)
431420
do_raise_exception(cysigs.interrupt_received);
432421
cysigs.sig_on_count = 0;
433422
cysigs.interrupt_received = 0;
434-
PARI_SIGINT_pending = 0;
435423
custom_signal_unblock();
436424

437425
#if HAVE_SIGPROCMASK
@@ -444,11 +432,9 @@ static void _sig_on_interrupt_received(void)
444432
static void _sig_on_recover(void)
445433
{
446434
cysigs.block_sigint = 0;
447-
PARI_SIGINT_block = 0;
448435
custom_signal_unblock();
449436
cysigs.sig_on_count = 0;
450437
cysigs.interrupt_received = 0;
451-
PARI_SIGINT_pending = 0;
452438
custom_set_pending_signal(0);
453439

454440
#if HAVE_SIGPROCMASK

0 commit comments

Comments
 (0)