From a17e594d16c159f8c2094bc40f0d42784157a7b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Tue, 1 Oct 2024 23:21:35 -0300 Subject: [PATCH] pari: update to 2.17.1. --- common/shlibs | 2 +- srcpkgs/pari/patches/fix-nproc.patch | 18 ++++++++++++++++++ srcpkgs/pari/template | 11 ++++++++--- 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/pari/patches/fix-nproc.patch diff --git a/common/shlibs b/common/shlibs index 9a2842d7635..f373a7371db 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4199,7 +4199,7 @@ libsimavrparts.so.1 simavr-1.6_2 libsword-1.8.1.so libsword-1.8.1_6 libgivaro.so.9 givaro-4.1.1_1 liblinbox.so.0 linbox-1.6.3_1 -libpari-gmp-tls.so.8 pari-2.15.0_1 +libpari-gmp-tls.so.9 pari-2.17.0_1 libtree-sitter.so.0.24 tree-sitter-0.24.3_1 libplanarity.so.0 planarity-3.0.1.1_1 libgap.so.9 gap-4.13.0_1 diff --git a/srcpkgs/pari/patches/fix-nproc.patch b/srcpkgs/pari/patches/fix-nproc.patch new file mode 100644 index 00000000000..eba2b0849e8 --- /dev/null +++ b/srcpkgs/pari/patches/fix-nproc.patch @@ -0,0 +1,18 @@ +Prefer "number of online processors" since some cpus will overreport +the total number of cpus. + +See: https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=2593#25 + +--- a/src/mt/pthread.c ++++ b/src/mt/pthread.c +@@ -139,7 +139,9 @@ void mt_broadcast(GEN code) {(void) code;} + void pari_mt_init(void) + { + pari_mt = NULL; +-#ifdef _SC_NPROCESSORS_CONF ++#ifdef _SC_NPROCESSORS_ONLN ++ if (!pari_mt_nbthreads) pari_mt_nbthreads = sysconf(_SC_NPROCESSORS_ONLN); ++#elif _SC_NPROCESSORS_CONF + if (!pari_mt_nbthreads) pari_mt_nbthreads = sysconf(_SC_NPROCESSORS_CONF); + #elif defined(_WIN32) + if (!pari_mt_nbthreads) pari_mt_nbthreads = win32_nbthreads(); diff --git a/srcpkgs/pari/template b/srcpkgs/pari/template index 6b2c5c00a1b..0de57ac6657 100644 --- a/srcpkgs/pari/template +++ b/srcpkgs/pari/template @@ -1,6 +1,6 @@ # Template file for 'pari' pkgname=pari -version=2.15.5 +version=2.17.1 revision=1 build_style=configure build_helper=qemu @@ -17,9 +17,9 @@ short_desc="Fast computations library in number theory" maintainer="Gonzalo TornarĂ­a " license="GPL-2.0-or-later" homepage="https://pari.math.u-bordeaux.fr" -changelog="https://pari.math.u-bordeaux.fr/cgi-bin/gitweb.cgi?p=pari.git;a=blob_plain;f=CHANGES;hb=refs/heads/pari-${version%.*}" +changelog="https://pari.math.u-bordeaux.fr/cgi-bin/sgitweb.cgi?p=pari.git;a=blob_plain;f=CHANGES;hb=refs/heads/pari-${version%.*}" distfiles="https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-${version}.tar.gz" -checksum=0efdda7515d9d954f63324c34b34c560e60f73a81c3924a71260a2cc91d5f981 +checksum=67ba6f3071233725258541e4f174b5efbc64c65ae5115bade9edfc45f1fde5dc build_options="x11 pthreads" build_options_default="x11 pthreads" @@ -56,6 +56,11 @@ pre_configure() { if [ "$CROSS_BUILD" ]; then export RUNTEST="/usr/bin/qemu-$XBPS_TARGET_QEMU_MACHINE-static" fi + if [ "${XBPS_WORDSIZE}" = 32 ] && [ $(nproc) -gt 4 ]; then + # for 32 bit, limit nbthreads to 4, to avoid memory issues, see + # https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=2593 + export GPTESTOPT='-D nbthreads=4' + fi } pari-devel_package() {