diff --git a/build/pari/build.sh b/build/pari/build.sh new file mode 100755 index 000000000..79143373b --- /dev/null +++ b/build/pari/build.sh @@ -0,0 +1,94 @@ +#!/usr/bin/bash +# +# {{{ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# }}} +# +# OmniOS package for the PARI/GP computer algebra system +# Copyright 2025 David Stes +# NOTE: PARI from https://pari.math.u-bordeaux.fr is NOT covered by the OmniOS package copyright +# Files or logfiles derived from PARI are NOT covered by the OmniOS package copyright + +. ../../lib/build.sh + +PROG=pari +VER=2.17.3 +PKG=ooce/library/math/pari +SUMMARY="PARI/GP" +DESC="Computer algebra system with the main aim of facilitating number theory computations" + +OPREFIX=$PREFIX +PREFIX+=/$PROG + +set_arch 64 + +# make target is gp +# check test target is dyntest-all +MAKE_TARGET=gp + +# PARI/GP configure is not GNU autoconf +# set build style autoconf-like for prep-build +CONFIGURE_CMD=./Configure +# reset_configure_opts + +# the PARI test script is in : src/test/dotest +# PARI measures with test-all diffs between static and dyn linked gp +# it prints timing information and checks for correctness +# the timing info could be useful but for our purpose remove/filter it from the testsuite.log +TESTSUITE_SED=" +s/gp-sta..TIME=[ ]*[0-9]*//g +s/gp-dyn..TIME=[ ]*[0-9]*//g +/Total bench/d +" + +# for dotest-env in testsuite +# if not set testsuite seems to report a bug and exit code nonzero +export AAA='XXX' +export BBB='YYY' + +XFORM_ARGS=" + -DOPREFIX=${OPREFIX#/} + -DPREFIX=${PREFIX#/} + -DPROG=$PROG + -DPKGROOT=$PROG +" + +# build with GNU gmp +# could use an IPS mediator for selecting the native (non GNU gmp) arithmetic +# PARI/GP does not find gmp headers +# --with-gmp-lib=/usr/lib/amd64 +CONFIGURE_OPTS[amd64]=" + --prefix=$PREFIX + --bindir=$PREFIX/bin + --libdir=$PREFIX/lib/$arch + --with-readline + --mt=pthread + --with-gmp + --with-gmp-include=/usr/include/gmp +" + +LDFLAGS[i386]+=" -R$OPREFIX/lib" +LDFLAGS[amd64]+=" -R$OPREFIX/lib/amd64" +LDFLAGS[i386]+=" -lssp_ns" + +# create package functions +init +download_source $PROG $PROG $VER +patch_source +prep_build autoconf-like +build +strip_install +run_testsuite dyntest-all +make_package +clean_up + +# Vim hints +# vim:ts=4:sw=4:et:fdm=marker diff --git a/build/pari/local.mog b/build/pari/local.mog new file mode 100644 index 000000000..2e8a8b9b7 --- /dev/null +++ b/build/pari/local.mog @@ -0,0 +1,21 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. + +# Copyright 2025 David Stes +# NOTE: PARI from https://pari.math.u-bordeaux.fr is NOT covered by the OmniOS package copyright +# Files or logfiles derived from PARI are NOT covered by the OmniOS package copyright + +license COPYING license=GPLv2 + + drop> + + + + diff --git a/build/pari/patches/01-genfunclist.patch b/build/pari/patches/01-genfunclist.patch new file mode 100644 index 000000000..15d91ba70 --- /dev/null +++ b/build/pari/patches/01-genfunclist.patch @@ -0,0 +1,11 @@ +--- pari-2.13.3/config/genfunclist Wed Mar 25 12:58:26 2020 ++++ p0/pari-2.13.3/config/genfunclist Mon Nov 22 15:52:15 2021 +@@ -2,7 +2,7 @@ + FL="$1" + DIR="$2" + TMPFL=$FL.tmp$$ +-(cd $DIR && find ../functions -name CVS -prune -o -name '.*' -prune -o -name '*~' -prune -o -type f -print | env LANG= LC_COLLATE= LC_ALL= sort | xargs cksum ) > $TMPFL ++(cd $DIR && find ../functions -name CVS -prune -o -name '.*' -prune -o -name '*~' -prune -o -type l -print | env LANG= LC_COLLATE= LC_ALL= sort | xargs cksum ) > $TMPFL + if cmp $FL $TMPFL >/dev/null 2>&1; then + rm -f $TMPFL + else diff --git a/build/pari/patches/02-get_mt.patch b/build/pari/patches/02-get_mt.patch new file mode 100644 index 000000000..d78495f4c --- /dev/null +++ b/build/pari/patches/02-get_mt.patch @@ -0,0 +1,11 @@ +--- pari-2.17.3/config/get_mt Tue Feb 27 22:12:25 2024 ++++ p0/pari-2.17.3/config/get_mt Fri Dec 19 18:31:06 2025 +@@ -3,7 +3,7 @@ + case $thread_engine in + single);; + pthread) +- MT_LIBS="-lpthread" ++ MT_LIBS="" # with -lpthread unused object libpthread.so.1 warning + cmd="$CC $CFLAGS $extraflag -o $exe $file $MT_LIBS" + . log_cmd + if test -r $exe; then diff --git a/build/pari/patches/series b/build/pari/patches/series new file mode 100644 index 000000000..064fc2b8f --- /dev/null +++ b/build/pari/patches/series @@ -0,0 +1 @@ +02-get_mt.patch diff --git a/build/pari/testsuite.log b/build/pari/testsuite.log new file mode 100644 index 000000000..ada72adc0 --- /dev/null +++ b/build/pari/testsuite.log @@ -0,0 +1,265 @@ +Making dyntest-all in Osolaris-ix86 +* Testing addprimes +* Testing agm +* Testing algebras +* Testing alggroup +* Testing alghasse +* Testing alglattices +* Testing algsplit +* Testing analyz +* Testing apply +* Testing arith +* Testing asymp +* Testing aurifeuille +* Testing bbhnf +* Testing bern +* Testing bessel +* Testing bestappr +* Testing binomial +* Testing bit +* Testing bnf +* Testing bnfisintnorm +* Testing bnflog +* Testing bnfsunit +* Testing bnr +* Testing bnrL1 +* Testing bnrclassfield +* Testing bnrisgalois +* Testing bnrmap +* Testing character +* Testing characteristic +* Testing charpoly +* Testing chinese +* Testing cmp +* Testing combinat +* Testing compat +* Testing concat +* Testing content +* Testing contfrac +* Testing cxtrigo +* Testing cyclo +* Testing debugger +* Testing deriv +* Testing det +* Testing diffop +* Testing digits +* Testing dirmul +* Testing dirpowers +* Testing disc +* Testing div +* Testing divisors +* Testing ell +* Testing ellanal +* Testing ellff +* Testing ellfromeqn +! Skipping ellglobalred: optional package elldata not installed. +! Skipping ellheight: optional package elldata not installed. +* Testing elliptic +* Testing ellisogeny +* Testing ellisomat +* Testing ellissupersingular +! Skipping ellmanin: optional package elldata not installed. +! Skipping ellmodulareqn: optional package seadata not installed. +* Testing ellnf +* Testing ellpadic +* Testing ellpadiclambdamu +* Testing ellrank +* Testing ellratpoints +* Testing ellsea +* Testing ellseaJ +* Testing elltors +* Testing ellweilpairing +* Testing env +* Testing equal +* Testing err +* Testing eval +* Testing exact0 +* Testing export +* Testing extract +* Testing factor +* Testing factorback +* Testing factorff +* Testing factorint +* Testing factormod +* Testing ff +* Testing ffisom +* Testing fflog +* Testing fft +* Testing forperm +* Testing forsubset +* Testing forvec +! Skipping galois: optional package galdata not installed. +! Skipping galoischartable: optional package galpol not installed. +* Testing galoisinit +! Skipping galpol: optional package galpol not installed. +* Testing gamma +* Testing gammamellininv +* Testing gcdext +* Testing gchar +* Testing gchar-large +* Testing gchar-lfun +* Testing genus2 +* Testing genus2red +* Testing graph +* Testing harmonic +* Testing help +* Testing hgm +* Testing history +* Testing hyperell +* Testing hyperelldisc +* Testing hypergeom +* Testing ideal +* Testing idealappr +* Testing idealramgroups +* Testing incgam +* Testing install +* Testing interpol +* Testing intnum +* Testing intnumosc +* Testing io +* Testing ispower +* Testing isprime +* Testing iterator +* Testing krasner +* Testing lambert +* Testing language +* Testing lerch +* Testing lex +* Testing lfun +! Skipping lfunartin: optional package galpol not installed. +* Testing lfunlarge +* Testing lfunquad +* Testing lfuntype +* Testing lift +* Testing lindep +* Testing linear +* Testing list +* Testing lll +* Testing log +* Testing logint +* Testing map +* Testing mat +* Testing mathnf +* Testing matpermanent +* Testing matsnf +! Skipping member: optional package elldata not installed. +* Testing memory +* Testing mf +* Testing mfgaloisrep +* Testing minim +* Testing minmax +* Testing modfun +* Testing modpr +* Testing modsym +* Testing modular +* Testing mscosets +* Testing mspadic +* Testing mspolygon +* Testing multiif +* Testing multivar-mul +* Testing nf +* Testing nfcompositum +* Testing nfdiscfactors +* Testing nfeltembed +* Testing nfeltsign +* Testing nffactor +* Testing nfhilbert +* Testing nfields +* Testing nfislocalpower +* Testing nflist +! Skipping nflistA5: optional package nflistdata not installed. +* Testing nflistQT +! Skipping nflistQTall: optional package galdata not installed. +! Skipping nflistQTall: optional package nflistdata not installed. +* Testing nfpolsturm +* Testing nfrootsof1 +* Testing nfsplitting +* Testing nfweilheight +* Testing norm +* Testing number +* Testing objets +* Testing op +* Testing orthopol +* Testing padic +* Testing parallel +* Testing partition +* Testing perm +* Testing plotexport +* Testing ploth +* Testing pol +* Testing polclass +* Testing polmod +* Testing polmodular +* Testing polred +* Testing polygonal +* Testing polylog +* Testing polyser +* Testing pow +* Testing prec +* Testing prime +* Testing primorial +* Testing print +* Testing printf +* Testing program +! Skipping programming: optional package elldata not installed. +* Testing qf +* Testing qfb +* Testing qfbclassno +* Testing qfbsolve +* Testing qfcvp +* Testing qfisom +* Testing qfsolve +* Testing quad +* Testing quadclassunit +* Testing quaddisc +* Testing quadray +* Testing ramanujantau +* Testing random +* Testing ranges +* Testing ratpoints +* Testing real +* Testing resultant +* Testing rfrac +* Testing rnf +* Testing rnfkummer +* Testing rootsof1 +* Testing rootsreal +* Testing round +* Testing round4 +* Testing select +* Testing self +* Testing ser +* Testing set +* Testing setdebug +* Testing size +* Testing solve +* Testing sort +* Testing sqrtn +* Testing stark +* Testing str +* Testing subcyclo +* Testing subcyclopclgp +* Testing subfields +* Testing subgroup +* Testing subst +* Testing sumdedekind +* Testing sumdiv +* Testing sumformal +* Testing sumiter +* Testing sumnum +* Testing sumnumrat +* Testing thue +* Testing time +* Testing trans +* Testing trans2 +* Testing valuation +* Testing vararg +* Testing variable +* Testing version +* Testing whatnow +* Testing zeta +* Testing zetahurwitz +* Testing zetamult +* Testing zn +* Testing zncoppersmith +The following tests were skipped: ellglobalred ellheight ellmanin ellmodulareqn galois galoischartable galpol lfunartin member nflistA5 nflistQTall programming