[arch-commits] Commit in giac/trunk (PKGBUILD giac-pari-thread.patch)
Antonio Rojas
arojas at archlinux.org
Sun Feb 5 22:02:32 UTC 2017
Date: Sunday, February 5, 2017 @ 22:02:31
Author: arojas
Revision: 210122
Update to 1.2.3.21, add Debian improvements to pthread patch
Modified:
giac/trunk/PKGBUILD
giac/trunk/giac-pari-thread.patch
------------------------+
PKGBUILD | 6 -
giac-pari-thread.patch | 151 +++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 150 insertions(+), 7 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2017-02-05 21:44:52 UTC (rev 210121)
+++ PKGBUILD 2017-02-05 22:02:31 UTC (rev 210122)
@@ -3,7 +3,7 @@
pkgbase=giac
pkgname=(xcas libgiac)
-_pkgver=1.2.3-13
+_pkgver=1.2.3-21
pkgver=${_pkgver//-/.}
pkgrel=1
pkgdesc="A free computer algebra system"
@@ -12,8 +12,8 @@
license=(GPL3)
makedepends=(mpfi gsl pari ntl lapack libpng libjpeg fltk)
source=("http://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/${pkgbase}_${_pkgver}.tar.gz" giac-pari-thread.patch)
-md5sums=('909c3301f3c455464eaea6a5bc6216a6'
- '1e871126c1c6b5be2447984ee7749e8e')
+md5sums=('a0fd6ab751af6e5f362512207cb83801'
+ 'e49775b578ca066295b3bc97429c8101')
prepare() {
cd $pkgbase-${pkgver%.*}
Modified: giac-pari-thread.patch
===================================================================
--- giac-pari-thread.patch 2017-02-05 21:44:52 UTC (rev 210121)
+++ giac-pari-thread.patch 2017-02-05 22:02:31 UTC (rev 210122)
@@ -1,11 +1,154 @@
---- giac-1.2.2/src/pari.cc.orig 2016-12-21 22:36:08.403918549 +0000
-+++ giac-1.2.2/src/pari.cc 2016-12-21 22:36:30.450537200 +0000
-@@ -53,7 +53,7 @@
+diff --git a/src/pari.cc b/src/pari.cc
+index 441141c..b59bf0b 100644
+--- a/src/pari.cc
++++ b/src/pari.cc
+@@ -53,7 +53,11 @@ static long int abs(long int & l){
extern "C" {
#include <pari/pari.h>
#include <pari/paripriv.h>
-- extern void *PARI_stack_limit;
++#ifdef ENABLE_TLS
+ extern THREAD void *PARI_stack_limit;
++#else
+ extern void *PARI_stack_limit;
++#endif
extern entree functions_basic[];
}
#if PARI_VERSION_CODE<PARI_VERSION(2,4,0) // 132096
+@@ -106,15 +110,13 @@ namespace giac {
+ gp_read_str("[x,y,z,t]");
+ }
+
+- struct giac_pari_init {
+- giac_pari_init(long maxprime) {
+- if(!avma){
+- do_giac_pari_init(maxprime);
+- }
++ static long pari_maxprime=100000;
++ long get_pari_avma() {
++ if(!avma){
++ do_giac_pari_init(pari_maxprime);
+ }
++ return avma;
+ };
+- static long pari_maxprime=100000;
+- static giac_pari_init bidon(pari_maxprime);
+
+ static gen pow2sizeof_long(pow(256,sizeof(long)));
+ // Conversion of a GEN integer to a gen, using Horner method
+@@ -593,7 +595,7 @@ namespace giac {
+ #ifdef HAVE_LIBPTHREAD
+ pthread_cleanup_push(pari_cleanup, (void *) pari_mutex_ptr);
+ #endif
+- long av=avma;
++ long av=get_pari_avma();
+ tmp=GEN2gen(gisprime(gen2GEN(e,vecteur(0),0),certif),vecteur(0));
+ avma=av;
+ #ifdef HAVE_LIBPTHREAD
+@@ -609,7 +611,7 @@ namespace giac {
+ #ifdef HAVE_LIBPTHREAD
+ pthread_cleanup_push(pari_cleanup, (void *) pari_mutex_ptr);
+ #endif
+- long av=avma;
++ long av=get_pari_avma();
+ GEN g=gen2GEN(e,vecteur(0),0);
+ GEN gf=factorint(g,0);
+ s=GEN2string(gf);
+@@ -627,7 +629,7 @@ namespace giac {
+ #ifdef HAVE_LIBPTHREAD
+ pthread_cleanup_push(pari_cleanup, (void *) pari_mutex_ptr);
+ #endif
+- long av=avma;
++ long av=get_pari_avma();
+ GEN g=gen2GEN(e,vecteur(0),0);
+ GEN gf=ggamma(g,precision(g));
+ res=GEN2gen(gf,vecteur(0));
+@@ -645,7 +647,7 @@ namespace giac {
+ #ifdef HAVE_LIBPTHREAD
+ pthread_cleanup_push(pari_cleanup, (void *) pari_mutex_ptr);
+ #endif
+- long av=avma;
++ long av=get_pari_avma();
+ GEN g=gen2GEN(e,vecteur(0),0);
+ GEN gf=gzeta(g,precision(g));
+ res=GEN2gen(gf,vecteur(0));
+@@ -663,7 +665,7 @@ namespace giac {
+ #ifdef HAVE_LIBPTHREAD
+ pthread_cleanup_push(pari_cleanup, (void *) pari_mutex_ptr);
+ #endif
+- long av=avma;
++ long av=get_pari_avma();
+ GEN g=gen2GEN(e,vecteur(0),0);
+ GEN gf=gpsi(g,precision(g));
+ res=GEN2gen(gf,vecteur(0));
+@@ -681,7 +683,7 @@ namespace giac {
+ abort_if_locked();
+ pthread_cleanup_push(pari_cleanup, (void *) pari_mutex_ptr);
+ #endif
+- long av=avma;
++ long av=get_pari_avma();
+ tmp=GEN2gen(ffinit(gen2GEN(p,vecteur(0),0),n,0),vecteur(0));
+ avma=av;
+ #ifdef HAVE_LIBPTHREAD
+@@ -698,7 +700,7 @@ namespace giac {
+ // GEN combine_factors(GEN a, GEN famod, GEN p, long klim, long hint);
+ bool pari_lift_combine(const vecteur & a,const vector<vecteur> & factmod,gen & modulo,vector<vecteur> & res){
+ #ifdef PARI23
+- long av=avma;
++ long av=get_pari_avma();
+ GEN pari_a=gen2GEN(r2e(a,x__IDNT_e,context0),vecteur(0),0);
+ string s("[");
+ vector<vecteur>::const_iterator it=factmod.begin(),itend=factmod.end();
+@@ -731,7 +733,7 @@ namespace giac {
+ }
+
+ static gen pari_exec(const string & s,GIAC_CONTEXT){
+- long av=avma;
++ long av=get_pari_avma();
+ void * save_pari_stack_limit = PARI_stack_limit;
+ PARI_stack_limit=0; // required since the stack changed
+ #ifdef PARI23
+@@ -804,7 +806,7 @@ namespace giac {
+ lidnt(v,vars,false);
+ vars.erase(vars.begin());
+ bool parse_all=false;
+- long av=avma;
++ long av=get_pari_avma();
+ #ifdef PARI23
+ if (setjmp(GP_DATA->env)){
+ avma = av;
+@@ -951,7 +953,7 @@ namespace giac {
+ } // end if (i!=pari_function_table.end())
+ } // end if vstr!=""
+ if (vstr=="" && vs==2){
+- long av=avma;
++ long av=get_pari_avma();
+ gen res= GEN2gen(gen2GEN(v[1],vars,contextptr),vars);
+ avma=av;
+ return res;
+@@ -1063,7 +1065,7 @@ namespace giac {
+ #ifdef HAVE_LIBPTHREAD
+ pthread_cleanup_push(pari_cleanup, (void *) pari_mutex_ptr);
+ #endif
+- long av=avma;
++ long av=get_pari_avma();
+ GEN G=gen2GEN(change_subtype(p,_POLY1__VECT),vecteur(0),contextptr);
+ if (debug_infolevel)
+ CERR << "pari_polroots " << GEN2gen(G,vecteur(1,vx_var)) << endl;
+@@ -1087,7 +1089,7 @@ namespace giac {
+ #ifdef HAVE_LIBPTHREAD
+ pthread_cleanup_push(pari_cleanup, (void *) pari_mutex_ptr);
+ #endif
+- long av=avma;
++ long av=get_pari_avma();
+ void * save_pari_stack_limit = PARI_stack_limit;
+ PARI_stack_limit=0;
+ GEN P=gen2GEN(p,lv,contextptr);
+@@ -1111,7 +1113,7 @@ namespace giac {
+ #ifdef HAVE_LIBPTHREAD
+ pthread_cleanup_push(pari_cleanup, (void *) pari_mutex_ptr);
+ #endif
+- long av=avma;
++ long av=get_pari_avma();
+ void * save_pari_stack_limit = PARI_stack_limit;
+ PARI_stack_limit=0;
+ GEN P=gen2GEN(p,lv,contextptr);
More information about the arch-commits
mailing list