r38065 - in /branches/upstream/libmath-pari-perl/current: Changes INSTALL META.yml Makefile.PL Pari.pm Pari.xs README t/00_Pari.t test_eng/Testout.pm utils/Math/PariBuild.pm

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Sat Jun 13 16:00:43 UTC 2009


Author: carnil-guest
Date: Sat Jun 13 16:00:27 2009
New Revision: 38065

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=38065
Log:
[svn-upgrade] Integrating new upstream version, libmath-pari-perl (2.010801)

Modified:
    branches/upstream/libmath-pari-perl/current/Changes
    branches/upstream/libmath-pari-perl/current/INSTALL
    branches/upstream/libmath-pari-perl/current/META.yml
    branches/upstream/libmath-pari-perl/current/Makefile.PL
    branches/upstream/libmath-pari-perl/current/Pari.pm
    branches/upstream/libmath-pari-perl/current/Pari.xs
    branches/upstream/libmath-pari-perl/current/README
    branches/upstream/libmath-pari-perl/current/t/00_Pari.t
    branches/upstream/libmath-pari-perl/current/test_eng/Testout.pm
    branches/upstream/libmath-pari-perl/current/utils/Math/PariBuild.pm

Modified: branches/upstream/libmath-pari-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-pari-perl/current/Changes?rev=38065&op=diff
==============================================================================
--- branches/upstream/libmath-pari-perl/current/Changes (original)
+++ branches/upstream/libmath-pari-perl/current/Changes Sat Jun 13 16:00:27 2009
@@ -668,3 +668,47 @@
 	Remove #error on LONG_LARGER_THAN_... (sp?).
 	Warn on pitfalls of 2.3.*.
 	On Solaris, support MakeLVL0.sh-style build too.
+
+2.010800:
+	Test suite was sub()ifying argument to sumnuminit().
+	Test suite would not correctly sub()ify intnum() if limits had "()".
+	Test suite calculated Pi Euler too early; Now only these fail
+    t/55_intnum.t               51    1   1.96%  12
+    t/55_ploth.t                34    1   2.94%  4
+
+  # eval-noans: $oo=[  PARI(1) ];
+  # eval-noans: setprecision(96)
+  # eval-noans: $tab=intfuncinit($t,[-$oo,4.5],[$oo,4.5], sub{gamma(2+ I*$t)**3},1);
+  # eval: intmellininvshort(2,4,$tab)-$A
+  not ok 12 # in='intmellininvshort(2,4,$tab)-$A'
+
+    >>>>>>========================================>>>>>
+      probably -$oo is not interpreted correct, since $oo is not overloaded
+
+  #    out='-0.00162288630645762090148373314245888997812239836220952087633884330352714288074453852820714919691012-6.88133524E-101*I', type='Math::Pari'
+  # pari==='-3.072350108 E-97 + 9.90717831 E-100*I'
+  # re_out='\-3\.072350108,?\s*E\-97,?\s*\+,?\s*9\.90717831,?\s*E\-100\*I'
+
+	Why this succeeds?
+  # eval: intnum($x,-1,1, sub{intnum($y,-sqrt(1-$x**2),sqrt(1-$x**2),$x**2+$y**2,$tab)},$tab)- Pi/2
+	Actually, $x**2+$y**2 is converted to a string as in '0.09+y^2',
+	 which is interpreted by GP/PARI.
+	Add warnings to the test suite for detection of #@_ 
+	 in Perl-in-PARI-in-Perl calls.
+	Attempt to support v5.10 (based on code contributed by Nicholas Clark)
+
+
+2.010801:
+  build_paricfg() takes a version argument
+  write_paricfg(): likewise.
+  Emit paricfg.h which supports GP/PARI v2.3.4.
+  Remove the section on CPAN mirroring from README.
+  INSTALL: Explain how to google when server is down.
+  Skip another subtest in ploth.t.
+  Fix treatment of -oo in tests.  Still fails, but now with
+     not ok 12 # in='intmellininvshort(2,4,$tab)-$A'
+     #    out='-3.364954880E-97+9.90717831E-100*I', type='Math::Pari'
+     # pari==='-3.072350108 E-97 + 9.90717831 E-100*I'
+     # re_out='\-3\.072350108,?\s*E\-97,?\s*\+,?\s*9\.90717831,?\s*E\-100\*I'
+  Consider `intfuncinit' as requiring "unsane" precision of limits
+	(bug in GP/PARI???).  Now all tests pass???

Modified: branches/upstream/libmath-pari-perl/current/INSTALL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-pari-perl/current/INSTALL?rev=38065&op=diff
==============================================================================
--- branches/upstream/libmath-pari-perl/current/INSTALL (original)
+++ branches/upstream/libmath-pari-perl/current/INSTALL Sat Jun 13 16:00:27 2009
@@ -173,6 +173,11 @@
 				limit stacksize 8192
 
 =======================================================
+Sometimes the server ftp://megrez.math.u-bordeaux.fr/pub/pari/unix/
+goes off line for a couple of days (mostly in August).  Then you can try
+downloading from some mirror: google, e.g., for pari-2.1.7.tgz.
+
+=======================================================
 KNOWN PROBLEMS:
       Darwin and other systems where -fno-common gcc flag is used:
         *) Remove the flag from libPARI/Makefile macro CCFLAGS;

Modified: branches/upstream/libmath-pari-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-pari-perl/current/META.yml?rev=38065&op=diff
==============================================================================
--- branches/upstream/libmath-pari-perl/current/META.yml (original)
+++ branches/upstream/libmath-pari-perl/current/META.yml Sat Jun 13 16:00:27 2009
@@ -1,10 +1,10 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Math-Pari
-version:      2.010709
+version:      2.010801
 version_from: Pari.pm
 installdirs:  site
 requires:
 
 distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+generated_by: ExtUtils::MakeMaker version 6.30

Modified: branches/upstream/libmath-pari-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-pari-perl/current/Makefile.PL?rev=38065&op=diff
==============================================================================
--- branches/upstream/libmath-pari-perl/current/Makefile.PL (original)
+++ branches/upstream/libmath-pari-perl/current/Makefile.PL Sat Jun 13 16:00:27 2009
@@ -63,13 +63,8 @@
   ###   considered cursory only.  One may need to downgrade to 2.1.7,
   ###   or run Makefile.PL with option machine=none if the tests fail.
 
-  ### The test t/55_intnum.t takes a very long time to complete.
-
-  ### The following subtests are known to fail:
-
-  ###        t/55_intnum.t                51    2   3.92%  12 50
-  ###        t/55_ploth.t                 34    1   2.94%  4
-  ###        t/55_program.t               37    1   2.70%  2
+  ### For example, the test t/55_intnum.t takes a very long time to complete,
+  ###   and plotting functions are not supported.
 
 EOP
   $common::pari_version = $pari_version;
@@ -80,6 +75,7 @@
 $os = $Config{osname};
 
 $define .= " -DPARI_VERSION_EXP=$pari_version -DDEBUG_PARI";
+$define .= " -DUSE_SLOW_ARRAY_ACCESS -DUSE_SLOW_NARGS_ACCESS" if $] >= 5.009;
 $libs = "-lm";
 $libs .= " $common::parilib" if $common::parilib;
 $noexp2 = '';			# Should be used for generation of paricfg.h
@@ -110,7 +106,8 @@
   build_tests $paridir;		# Convert the test suite
   make_pod 'libPARI.pod', '-to_pod', $paridir; # Now the docs
   make_pod 'libPARI.dumb.pod', '-to_dumb_pod', $paridir;
-  %opts = build_paricfg($paridir, $common::do_configure); # ... and paricfg.h
+  # ... and paricfg.h
+  %opts = build_paricfg($paridir, $common::do_configure, $pari_version);
 
   if ($ENV{MATH_PARI_REPORT_CODES}) {
     # Check the correspondence between string interfaces and numeric interfaces

Modified: branches/upstream/libmath-pari-perl/current/Pari.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-pari-perl/current/Pari.pm?rev=38065&op=diff
==============================================================================
--- branches/upstream/libmath-pari-perl/current/Pari.pm (original)
+++ branches/upstream/libmath-pari-perl/current/Pari.pm Sat Jun 13 16:00:27 2009
@@ -926,7 +926,7 @@
 $initmem ||= 4000000;		# How much memory for the stack
 $initprimes ||= 500000;		# Calculate primes up to this number
 
-$VERSION = '2.010709';
+$VERSION = '2.010801';
 
 my $true = 1;
 # Propagate sv_true, sv_false to SvIOK:

Modified: branches/upstream/libmath-pari-perl/current/Pari.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-pari-perl/current/Pari.xs?rev=38065&op=diff
==============================================================================
--- branches/upstream/libmath-pari-perl/current/Pari.xs (original)
+++ branches/upstream/libmath-pari-perl/current/Pari.xs Sat Jun 13 16:00:27 2009
@@ -101,6 +101,114 @@
    frame on the entry into the function for which SV is the argument.
 */
 
+#ifndef USE_SLOW_NARGS_ACCESS
+#  define	USE_SLOW_NARGS_ACCESS	(defined(PERL_VERSION) && (PERL_VERSION > 9))
+#endif
+
+#if USE_SLOW_NARGS_ACCESS
+#  define PARI_MAGIC_TYPE	((char)0xDE)
+#  define PARI_MAGIC_PRIVATE	0x2020
+
+static IV*
+PARI_SV_to_IVp(SV *const sv)
+{
+    MAGIC *mg;
+    for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
+	if (mg->mg_type == PARI_MAGIC_TYPE
+	    && mg->mg_private == PARI_MAGIC_PRIVATE)
+	    return (IV *) &mg->mg_ptr;
+    }
+    croak("panic: PARI narg value not attached");
+    return NULL;
+}
+
+static void
+SV_myIV_set(SV *sv, IV i)
+{
+    MAGIC *mg;
+
+    mg = sv_magicext((SV*)sv, NULL, PARI_MAGIC_TYPE, NULL, INT2PTR(void *, i), 0);
+    mg->mg_private = PARI_MAGIC_PRIVATE;
+}
+
+#  define SV_myIV_reset_clone(sv)			\
+  STMT_START {						\
+    if(SvTYPE(sv) == SVt_PVAV) {			\
+	IV *p = PARI_SV_to_IVp(sv);			\
+	*p = (IV) gclone((GEN)*p);			\
+    } else {						\
+	SV_myIV_reset_clone_IVX(sv);			\
+    } } STMT_END
+
+
+/* Should be applied to SV* and AV* only */
+#  define SV_myIV_get(sv)						\
+	((SvTYPE(sv) == SVt_PVAV) ? *PARI_SV_to_IVp(sv) : SvIV(sv))
+#  define CV_myIV_get(sv)	(*PARI_SV_to_IVp(sv))
+#  define CV_myIV_set		SV_myIV_set
+#else /* !USE_SLOW_NARGS_ACCESS */
+#  define CV_NUMARGS_get(cv)	(((CV*)(cv))->sv_any->xof_off)
+#  define CV_NUMARGS_set(cv, c)	(CV_NUMARGS_get(cv) = (c))
+#  define SV_myIV_set(sv, i)	(SvIVX(sv) = (i))
+#  define SV_myIV_get(sv)	SvIVX(sv)	/* IVOK is not set! */
+#  define CV_myIV_get(sv)	SvIVX(sv)
+#  define CV_myIV_set(cv, i)	SV_myIV_set((SV*)cv, i)
+#  define SV_myIV_reset_clone	SV_myIV_reset_clone_IVX
+#endif
+
+#define SV_myIV_reset_clone_IVX(sv)	(SvIVX(sv) = (IV) gclone((GEN)SvIV(sv)))
+
+#ifndef USE_SLOW_ARRAY_ACCESS
+#  define	USE_SLOW_ARRAY_ACCESS	(defined(PERL_VERSION) && (PERL_VERSION > 9))
+#endif
+
+#if USE_SLOW_ARRAY_ACCESS
+/* 5.9.x and later assert that you're not using SvPVX() and SvCUR() on arrays,
+   so need a little more code to cheat round this.  */
+#  define NEED_SLOW_ARRAY_ACCESS(sv)	(SvTYPE(sv) == SVt_PVAV)
+#  define AV_SET_LEVEL(sv, val)		(AvARRAY(sv) = (SV **)(val))
+#  define AV_GET_LEVEL(sv)		((char*)AvARRAY(sv))
+#else
+#  define NEED_SLOW_ARRAY_ACCESS(sv)	0
+#  define AV_SET_LEVEL(sv, val)		croak("Panic AV LEVEL")	/* This will never be called */
+#  define AV_GET_LEVEL(sv)		(croak("Panic AV LEVEL"),Nullch) /* This will never be called */
+#endif
+
+/* XXXX May need a flavor when we know it is an AV??? */
+#define SV_PARISTACK_set(sv, stack)				\
+	 (NEED_SLOW_ARRAY_ACCESS(sv) ? (			\
+	     AV_SET_LEVEL(sv, stack), (void)0			\
+	 ) : (							\
+	     SvPVX(sv) = stack, (void)0				\
+	 ))
+
+#define SV_OAVMA_PARISTACK_set(sv, level, stack)		\
+	(NEED_SLOW_ARRAY_ACCESS(sv) ? (				\
+	    AvFILLp(sv) = (level),				\
+	    AV_SET_LEVEL(sv, (stack)), (void)0			\
+	) : (							\
+	    SvCUR(sv) = (level),				\
+	    SvPVX(sv) = (char*)(stack), (void)0			\
+	))
+
+#define SV_OAVMA_PARISTACK_get(sv, level, stack)		\
+	(NEED_SLOW_ARRAY_ACCESS(sv) ? (				\
+	    (level) = AvFILLp(sv),				\
+	    (stack) = AV_GET_LEVEL(sv), (void)0			\
+	) : (							\
+	    (level) = SvCUR(sv),				\
+	    (stack) = SvPVX(sv), (void)0			\
+	))
+
+#define SV_OAVMA_switch(next, sv, newval)			\
+    ( NEED_SLOW_ARRAY_ACCESS(sv) ? (				\
+	(next) = (SV *)AvARRAY(sv),				\
+	AV_SET_LEVEL(sv, newval), (void)0			\
+    ) : (							\
+	next = (SV *) SvPVX(sv),				\
+	SvPVX(sv) = newval, (void)0					\
+    ))
+
 #define GENmovedOffStack ((char*) 1) /* Just an atom. */
 #define GENfirstOnStack ((char*) 2) /* Just an atom. */
 #define GENheap NULL
@@ -158,8 +266,7 @@
     }								\
     if (isonstack(in)) {					\
 	SV* g = SvRV(sv);					\
-	SvCUR(g) = oldavma - bot;				\
-	SvPVX(g) = (char*)PariStack;				\
+	SV_OAVMA_PARISTACK_set(g, oldavma - bot, PariStack);	\
 	PariStack = g;						\
 	perlavma = avma;					\
 	onStack_inc;						\
@@ -241,15 +348,12 @@
     AV *av = (AV*)SvRV(sv);
     char *s = SvPVX(av);
     IV i = SvIVX(av);
-#if 0
-    MAGIC *mg;
-#endif
     SV *newsub = newRV_noinc((SV*)av);	/* cannot use sv, it may be 
 					   sv_restore()d */
 
     (void)SvUPGRADE((SV*)av, SVt_PVAV);    
-    SvPVX(av)	= s;
-    SvIVX(av)	= i;
+    SV_PARISTACK_set(av, s);
+    SV_myIV_set((SV*)av, i);
     sv_magic((SV*)av, newsub, 'P', Nullch, 0);
     SvREFCNT_dec(newsub);		/* now RC(newsub)==1 */
 	/* We avoid an reference loop, so should be careful on DESTROY */
@@ -419,7 +523,7 @@
 	  if (SvSTASH(tsv) == pariStash) {
 	    is_pari:
 	      {
-		  GEN x = (GEN)SvIV(tsv);
+		  GEN x = (GEN)SV_myIV_get(tsv);
 		  if (typ(x) == t_POL	/* Polynomial. */
 		      && lgef(x)==4		/* 2 terms */
 		      && (gcmp0((GEN)x[2]))	/* Free */
@@ -435,7 +539,7 @@
 		  /* Itsn't good to croak: $v=PARIvar 'v'; vector(3,$v,'v'); */
 		  if (generate)
 		      /*croak("Same iterator in embedded PARI loop construct")*/;
-		  return (entree*) SvIV(tsv);
+		  return (entree*) SV_myIV_get(tsv);
 	      }
 	  } else if (sv_derived_from(sv, "Math::Pari")) { /* Avoid recursion */
 	      if (sv_derived_from(sv, "Math::Pari::Ep"))
@@ -702,13 +806,13 @@
 	  if (SvSTASH(tsv) == pariStash) {
 	    is_pari:
 	      {
-		  IV tmp = SvIV(tsv);
+ 		  IV tmp = SV_myIV_get(tsv);
 		  return (GEN) tmp;
 	      }
 	  } else if (SvSTASH(tsv) == pariEpStash) {
 	    is_pari_ep: 
 	      {
-		  IV tmp = SvIV(tsv);
+ 		  IV tmp = SV_myIV_get(tsv);
 		  return (GEN)(((entree*) tmp)->value);
 	      }
 	  } else if (sv_derived_from(sv, "Math::Pari")) { /* Avoid recursion */
@@ -1150,7 +1254,7 @@
 	}
 	*s = '\0';
     }
-    ((CV*)cv)->sv_any->xof_off = numargs;	/* XXXX Nasty of us... */
+    CV_myIV_set(cv, numargs);
     SAVEINT(doing_PARI_autoload);
     doing_PARI_autoload = 1;
     ep = install((void*)SvREFCNT_inc(cv), name, code);
@@ -1183,9 +1287,8 @@
   
   for (sv1 = PariStack; sv1 != sv; sv1 = nextsv) {
     ret++;
-    nextsv = (SV *) SvPVX(sv1);
-    SvPVX(sv1) = GENmovedOffStack; /* Mark as moved off stack. */
-    SvIVX(sv1) = (IV) gclone((GEN)SvIV(sv1));
+    SV_OAVMA_switch(nextsv, sv1, GENmovedOffStack); /* Mark as moved off stack. */
+    SV_myIV_reset_clone(sv1);
     onStack_dec;
     offStack_inc;
   }
@@ -1216,7 +1319,7 @@
 {
     va_list args;
     SV *cv = (SV*) ep->value;
-    int numargs = ((CV*)cv)->sv_any->xof_off;	/* XXXX Nasty of us... */
+    int numargs = CV_myIV_get(cv);
     GEN res;
     int i;
     dSP;
@@ -3738,14 +3841,16 @@
      {
 	 /* PariStack keeps the latest SV that keeps a GEN on stack. */
 	 SV* sv = SvRV(rv);
-	 char* type = SvPVX(sv);	/* The value of PariStack when the
+	 char* ostack;			/* The value of PariStack when the
 					 * variable was created, thus the
 					 * previous SV that keeps a GEN from
 					 * stack, or some atoms. */
-	 long oldavma = SvCUR(sv) + bot; /* The value of avma on the entry
+	 long oldavma;			 /* The value of avma on the entry
 					  * to function having the SV as
 					  * argument. */
 	 long howmany;
+	 SV_OAVMA_PARISTACK_get(sv, oldavma, ostack);
+	 oldavma += bot;
 #if 1
 	 if (SvMAGICAL(sv) && SvTYPE(sv) == SVt_PVAV) {
 	     MAGIC *mg = mg_find(sv, 'P');
@@ -3762,14 +3867,14 @@
 	     AvFILLp((AV*)sv) = -1;	
 	 }
 #endif
-	 SvPVX(sv) = GENheap;		/* To avoid extra free() in moveoff.... */
-	 if (type == GENheap)	/* Leave it alone? XXXX */
+	 SV_PARISTACK_set(sv, GENheap);	/* To avoid extra free() in moveoff.... */
+	 if (ostack == GENheap)	/* Leave it alone? XXXX */
 	     /* break */ ;
-	 else if (type == GENmovedOffStack) {/* Know that it _was temporary. */
-	     killbloc((GEN)SvIV(sv));	     
+	 else if (ostack == GENmovedOffStack) {/* Know that it _was temporary. */
+	     killbloc((GEN)SV_myIV_get(sv));	     
 	 } else {
 	 		/* Still on stack */
-	     if (type != (char*)PariStack) { /* But not the newest one. */
+	     if (ostack != (char*)PariStack) { /* But not the newest one. */
 		 howmany = moveoffstack_newer_than(sv);
 		 RUN_IF_DEBUG_PARI( warn("%li items moved off stack", howmany) );
 	     }
@@ -3783,7 +3888,7 @@
 	     } else {
 		 avma = oldavma;	/* Mark the space on stack as free. */
 	     }
-	     PariStack = (SV*)type; /* The same on the Perl/PARI side. */
+	     PariStack = (SV*)ostack; /* The same on the Perl/PARI side. */
 	 }
 	 SVnum_dec;
      }

Modified: branches/upstream/libmath-pari-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-pari-perl/current/README?rev=38065&op=diff
==============================================================================
--- branches/upstream/libmath-pari-perl/current/README (original)
+++ branches/upstream/libmath-pari-perl/current/README Sat Jun 13 16:00:27 2009
@@ -1,8 +1,10 @@
 a) Math::Pari is the PERL interface to the PARI part of GP/PARI
    (version 2.*).  The info about GP/PARI is on
    http://www.parigp-home.de/
-   Interger part and the first 4 digits after the point in the version
+   Integer part and the first 4 digits after the point in the version
    of Math::Pari reflect the latest version of GP/PARI it was tested with.
+	(2.01080* still fully supports only 2.1.7, but mostly works with 2.3.*
+         too.)
 
    The next paragraph is an excerpt from documentation inside Pari.pm:
 
@@ -17,7 +19,7 @@
 b) This module includes a part written in C; thus it is requires a *fully*
    working Perl installation, including a C compiler which Perl knows about.
    Since prebuild configurations are typically broken (in many subtle ways),
-   it is not supported unless your perl executable was build on your machine
+   build is not supported unless your perl executable was build on your machine
    (or otherwise you show that you know what you are talking about ;-).
 
    Given this, in most cases, this module can be installed as all the others:
@@ -29,7 +31,7 @@
 
      perl -MCPAN -e 'install Math::Pari'
 
-   or (if you manually downloaded the archive)
+   or (if you manually downloaded the archive, and change version numbers):
 
      tar -zxfv Math-Pari-2.001200.tar.gz
      cd Math-Pari-2.001200
@@ -53,10 +55,7 @@
    in between.  Otherwise significant problems may arise.  [A typical
    symptom: the symbol overflow cannot be found.]
 
-c) Due to the apparent recent breakage of PAUSE mirroring of my
-   directories, CPAN may have not the latest-and-greatest version. :-(
-
-d) How the tests work
+c) How the tests work
 
    Lowercase test scripts translate native GP/PARI tests from GP
    syntax to Perl syntax.  You can get a better understanding of these
@@ -72,43 +71,52 @@
    warnings.  Until the test engine is taught to look-for/eat these
    warnings, they *must* appear.
 
-e) Reporting bugs/problems
+d) Reporting bugs/problems	(REQUIRED!!!!!!!!!!!!!!!!!!!!!!!!!)
 
-   I need to see the output of 
+ 0) I need to see the output of 
 
      perl Makefile.PL
      perl -V
 
-   and the relevant messages "near the failure".  Additionally, Math::Pari
-   can be build in several way (see INSTALL); unless you know what you are
-   doing, please rebuild with
+    and the relevant messages from the `make' step "near the failure point".
+
+ 1) Additionally, Math::Pari can be build in several way (see INSTALL);
+    unless you know what you are doing, please rebuild with
 
      cp libPARI/paricfg.h libPARI/paricfg.h-no-configure
      make realclean
      perl Makefile.PL Configure
 
-   and retest the bug you found.  If this does not fix the bug, just mention
-   this in your bug report.  If this fixes the bug, please supply the result
-   of
+    and retest the bug you found.  If this does not fix the bug, just mention
+    this in your bug report.  If this fixes the bug, please supply the result
+    of
 
      diff -u libPARI/paricfg.h-no-configure libPARI/paricfg.h
 
-   too.  Additionally, if this does not fix the bug, and your build is
-   architecture-specific (you saw a message similar to
+    too.
+
+ 2) Additionally, if this does not fix the bug, and your build is
+    architecture-specific (you saw a message similar to
 
  ...I will use assembler build of type 'ix86'.
 
-   during `perl Makefile.PL'), please also do
+    during `perl Makefile.PL'), please also do
 
      make realclean
      perl Makefile.PL machine=none
 
-   retest your problem, and report whether it fixed the bug.
+    retest your problem, and report whether it fixed the bug.
 
-   elliptic.t subtest 41 often fails on GP/PARI itself, so currently I
-   do not consider its failure to be a Math::Pari's bug.
+ 3) elliptic.t subtest 41 often fails on GP/PARI itself, so currently I
+    do not consider its failure to be a Math::Pari's bug.
 
-f) Documentation to this package is contained inside Pari.pm. After
+ 4) If build succeeds, but test not, you can get higher-granularity reports
+    from test files by running them as (in bash/DOSISH, and in tcsh syntax):
+      perl -Mblib t/55_intnum.t 2>&1 >  intnum-log
+      perl -Mblib t/55_intnum.t      >& intnum-log
+    Please inspect and include the generated log file in your report too.
+
+e) Documentation to this package is contained inside Pari.pm. After
    installing it is accessible by standard means, like
 
      perldoc Math::Pari

Modified: branches/upstream/libmath-pari-perl/current/t/00_Pari.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-pari-perl/current/t/00_Pari.t?rev=38065&op=diff
==============================================================================
--- branches/upstream/libmath-pari-perl/current/t/00_Pari.t (original)
+++ branches/upstream/libmath-pari-perl/current/t/00_Pari.t Sat Jun 13 16:00:27 2009
@@ -168,6 +168,7 @@
 }
 
 sub incr1 {
+  warn "incr1: ", scalar @_, " args" unless @_ == 6 or @_ == 1;	# no proto ==> 6 ???
   my $y = shift;
   print "# Adding $y to $x\n";
   $x += $y;

Modified: branches/upstream/libmath-pari-perl/current/test_eng/Testout.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-pari-perl/current/test_eng/Testout.pm?rev=38065&op=diff
==============================================================================
--- branches/upstream/libmath-pari-perl/current/test_eng/Testout.pm (original)
+++ branches/upstream/libmath-pari-perl/current/test_eng/Testout.pm Sat Jun 13 16:00:27 2009
@@ -27,12 +27,12 @@
 
 
 $| = 1;
- at seen = qw(Pi I Euler getrand a x xx y z k t q u j l n v p e
+ at seen = qw(Euler Pi I getrand a x xx y z k t q u j l n v p e
 	   name other mhbi a2 a1 a0 b0 b1
 	   acurve bcurve ccurve cmcurve tcurve mcurve ma mpoints);
 @seen{@seen}  = (' ', ' ', ' ', ' ', ('$') x 100);
 for (@seen) {
-  $$_ = PARI($_);
+  $$_ = PARI($_) unless $seen{$_} eq ' ';
 }
 $seen{'random'} = ' ';
 $DEFAULT = undef;
@@ -53,7 +53,7 @@
       @not_yet_defined{qw(
 	plotbox plotcolor plotcursor plotdraw ploth plothraw plotinit plotlines
 	plotmove plotpoints plotrline plotrmove plotrpoint psdraw psploth
-	psplothraw
+	psplothraw plotscale
 	plotkill
       )} = (1) x 10000;
       $skip_gnuplot = 1;
@@ -380,11 +380,14 @@
       $in =~ s/(^|\G|\W)([-+]?)(\d+(\.\d*)?)(.?)/$1 $2 PARI($3) $5/g;
       # Big integer constants:
       $in =~ s/\bPARI\((\d{10,})\)/PARI('$1')/g;
-    } elsif ($in =~ /\b(elllseries|binomial|mathilbert|intnum|intfuncinit)\b/) { # high precision needed?
+    } elsif ($in =~ /\b(elllseries|binomial|mathilbert|intnum|intfuncinit|intfuncinit)\b/) { # high precision needed?
       # XXXX Primitive!
       # Substitute constants where they are not arguments to functions,
       # (except small half-integers, which should survive conversion)
       $in =~ s/(^|\G|\W)([-+]?)(?!\d{0,6}\.5\b)(\d+\.\d*)/$1 $2 PARI('$3') /g;
+      # Bug in GP???  Too sensitive to precision of 4.5 in intfuncinit(t=[-oo, 4.5],[oo, 4.5], gamma(2+I*t)^3, 1);
+      $in =~ s/(^|\G|\W)([-+]?)(\d+\.\d*)/$1 $2 PARI('$3') /g
+	if $in =~ /intfuncinit/;
       # Big integer constants:
       $in =~ s/\bPARI\((\d{10,})\)/PARI('$1')/g;
     } else {
@@ -402,11 +405,14 @@
     $in =~ s/\b(|p|tex)print(tex|)\(/ 'my_' . $1 . $2 . 'print(1,' /ge;
     $in =~ s/\b(|p|tex)print1\(/ 'my_' . $1 . 'print(0,'/ge;
     $in =~ s/\b(eval|shift|sort)\(/&$1\(/g; # eval($y)
-    # Recognize variables
+    # Special case -oo (with $oo=[PARI(1)] done earlier;
+    # Having $oo defined without external PARI tests conversions; but it'sn't overloaded
+    $in =~ s/-oo\b/- PARI(\$oo)/ if $seen_now{oo} or 1;
+    # Recognize variables and prepend $ in assignments
     # s/\b(direuler\s*\(\s*\w+\s*),/$1=/;	# direuler
     $in =~ s/\bX\b/PARIvar("X")/g if $in =~ /\bdireuler\b/;
-    $in =~ s/(^|[;(])(\w+)(\s*=\s*)/$seen_now{$2} = '$'; $1 . '$' . $2 . $3/ge; # Assignment
-    # Substitute variables (not before '^' - inside of 'o(x^17)'):
+    $in =~ s/(^\s*|[;(]\s*)(?=(\w+)\s*=\s*)/$seen_now{$2} = '$'; $1 . '$'/ge; # Assignment
+    # Prepend $ to variables (not before '^' - inside of 'o(x^17)'):
     $in =~ s/(^|[^\$])\b([a-zA-Z]\w*)\b(?!\s*[\(^])/
       		($1 || '') . ($seen{$2} || $seen_now{$2} || '') . $2
 	/ge;
@@ -423,7 +429,7 @@
       $in =~ s/
 		(
 		  \b
-		  (?:
+		  (?:		# For these, sub{}ify the fourth argument
 		    sum
 		  |
 		    intnum(?!init\b)\w*
@@ -449,19 +455,21 @@
 		  \(
 		  (?:
 		     (?:
-		       [^(=,)\[\]]+
+		       [^(=,)\[\]]+ # One argument without (), []
 		       (?=
-		         [=,]
+		         [(=,)\[\]]
 		       )
-		     |		# One level of parenths supported
-		       \( [^()]+ \)
+		     |		# One or two levels of parenths supported
+		       \( [^()]* \)
+		     |
+		       \( (?: [^()] | \( [^()]* \))* \)
 		     |		# Two levels of brackets supported
-		       \[ [^\[\]]+ \]
+		       \[ [^\[\]]* \]
 		     |
-		       \[ (?: [^\[\]] | \[ [^\[\]]+ \] )* \]
-		     )
+		       \[ (?: [^\[\]] | \[ [^\[\]]* \] )* \]
+		     )*
 		  [,=]){3}		# $x,1,100
-	        |
+	        |		# For these, sub{}ify the third argument
 		  \b
 		  (?:
 		    sumalt
@@ -477,7 +485,7 @@
 		       )
 		     |
 		       \s*\w*\( [^()]+ \)\s*
-		     )		# One level of func-call (PARI('.3')) supported
+		     )*		# One level of func-call (PARI('.3')) supported
 		  [,=]){2}		# $x,1
 		)				# end group 1
 		(?!\s*sub\s*\{)	# Skip already converted...
@@ -519,16 +527,14 @@
 		    \]
 		  )*		# Two levels of parenths supported
 		)				# end group 2
-		(?=
-                  [),]
-                )
+		(?= [),] )
 	      /$1 sub{$2}/xg;
     # Do the rest (do not take = after the variable name)
     1 while
       $in =~ s/
 		(
 		  \b
-		  (
+		  (		# For these, sub{}ify the last argument
 		    solve
 		  |
 		    (?:
@@ -537,7 +543,7 @@
 		    ploth (?! raw \b ) \w+
 		  |
 		    # sum \w*
-		    sum (?! alt | num \b) \w+
+		    sum (?! alt | num (?:init)? \b) \w+
 		  |
 		    # prod \w*
 		    prodinf
@@ -566,7 +572,7 @@
 		  ,
 		)
 		(?!\s*sub\s*\{)	# Skip already converted...
-		(		# This follows after a comma on toplevel
+		(		# 3: This follows after a comma on toplevel
 		  (?:
 		    [^(,)\[\]]+
 		    (?=

Modified: branches/upstream/libmath-pari-perl/current/utils/Math/PariBuild.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmath-pari-perl/current/utils/Math/PariBuild.pm?rev=38065&op=diff
==============================================================================
--- branches/upstream/libmath-pari-perl/current/utils/Math/PariBuild.pm (original)
+++ branches/upstream/libmath-pari-perl/current/utils/Math/PariBuild.pm Sat Jun 13 16:00:27 2009
@@ -1,6 +1,6 @@
 package Math::PariBuild;
 
-$VERSION = '1.000';
+$VERSION = '1.001';
 
 require Exporter;
 @ISA = 'Exporter';
@@ -611,7 +611,7 @@
   return 1;
 }
 
-=item write_paricfg()
+=item write_paricfg($formatted_version)
 
 Writes PARI configuration file F<libPARI/paricfg.h>.  Returns hash
 with options found during the scan of the header files.
@@ -619,6 +619,7 @@
 =cut
 
 sub write_paricfg {
+  my $version = shift;
   my %opts;
   scan_headers(\%opts) or $opts{clk_tck_def} = 0;
   warn "Creating libPARI/paricfg.h...\n";
@@ -698,6 +699,16 @@
 
 EOP
 
+  my @v = ($version =~ /^(\d+)(\d{3})(\d{3})$/)
+    or die "write_paricfg() needs a formatted version argument, got `$version'";
+  my $vvv = ((($v[0]) << 16) + (($v[1]) << 8) + ($v[2]));
+  print F <<EOP;   # <=2.3.0 it was used only in gp.c, which we don't compile
+#define PARI_VERSION_CODE	$vvv
+#define PARI_VERSION(a,b,c)	(((a) << 16) + ((b) << 8) + (c))
+#define PARI_VERSION_SHIFT	8
+
+EOP
+
   close F or die "close 'libPARI/paricfg.h' for write: $!";
   %opts;
 }
@@ -711,8 +722,8 @@
 
 =cut
 
-sub build_paricfg {
-  my ($paridir, $do_configure) = (shift, shift);
+sub build_paricfg {	# $version as in 2003005 for 2.3.5
+  my ($paridir, $do_configure, $version) = (shift, shift, shift);
   my %opts;
   unless (find_or_Configure_paricfg($paridir, $do_configure)) {
     # Not generated by Configure
@@ -724,7 +735,7 @@
 EOP
     } else {
       print "...Generating libPARI/paricfg.h ...\n";
-      %opts = write_paricfg();
+      %opts = write_paricfg($version);
     }
   }
   %opts;




More information about the Pkg-perl-cvs-commits mailing list