Opened 4 years ago

Closed 4 years ago

#19905 closed enhancement (fixed)

Upgrade PARI/GP to latest master

Reported by: buck Owned by: buck
Priority: major Milestone: sage-7.1
Component: packages: standard Keywords:
Cc: rws Merged in:
Authors: Buck Evan, Jeroen Demeyer Reviewers: Buck Evan
Report Upstream: N/A Work issues:
Branch: 5bca083 (Commits) Commit: 5bca083d3e391ced1170fb7e7be79a747a899310
Dependencies: Stopgaps:

Change History (22)

comment:1 follow-up: Changed 4 years ago by buck

  • Cc rws added
  • Component changed from PLEASE CHANGE to packages: standard
  • Reviewers set to jdemeyer

This is what I have so far, but I see that src/sage/libs/pari/paridecl.pxd needs to be updated. @jdemeyer: How is this file maintained? I don't trust my ability to do this accurately, manually. It seems like something that should also be done by the autogen/pari system.

  • build/pkgs/pari/checksums.ini

    diff --git a/build/pkgs/pari/checksums.ini b/build/pkgs/pari/checksums.ini
    index c62c530..aabe08d 100644
    a b  
    11tarball=pari-VERSION.tar.gz
    2 sha1=fa23e0c8b6e38a356048d19224dc9b9658d77724
    3 md5=c753faaa4780de5ad8d461f0ffd70ecf
    4 cksum=1220765312
     2sha1=55299bfe042da491648897e830030083809d9967
     3md5=97738f8e92bba498f7dfd723c8e9d910
     4cksum=1221580104
  • build/pkgs/pari/package-version.txt

    diff --git a/build/pkgs/pari/package-version.txt b/build/pkgs/pari/package-version.txt
    index 2b25bd1..5fdd71e 100644
    a b  
    1 2.8-1813-g6157df4.p0
     12.8-2230-g450ce38
  • build/pkgs/pari/patches/public_memory_functions.patch

    diff --git a/build/pkgs/pari/patches/public_memory_functions.patch b/build/pkgs/pari/patches/public_memory_functions.patch
    index b3726d7..ee14fa4 100644
    a b index 7067183..4ede6ed 100644 
    99+void *  pari_mainstack_malloc(size_t size);
    1010+void    pari_mainstack_mfree(void *s, size_t size);
    1111+void    pari_mainstack_free(struct pari_mainstack *st);
    12  void    paristack_alloc(size_t rsize, size_t vsize);
    1312 void    paristack_newrsize(ulong newsize);
    1413 void    paristack_resize(ulong newsize);
     14 void    paristack_setsize(size_t rsize, size_t vsize);
    1515diff --git a/src/language/init.c b/src/language/init.c
    1616index 7b5922d..2a578d7 100644
    1717--- a/src/language/init.c
  • src/sage_setup/autogen/pari/args.py

    diff --git a/src/sage_setup/autogen/pari/args.py b/src/sage_setup/autogen/pari/args.py
    index 57356b4..a2749df 100644
    a b class PariArgumentPrec(PariArgumentClass): 
    254254        s = "        {name} = prec_bits_to_words({name})\n"
    255255        return s.format(name=self.name)
    256256
     257class PariArgumentBitPrec(PariArgumentClass):
     258    def _typerepr(self):
     259        return "bitprec"
     260    def ctype(self):
     261        return "long"
     262    def always_default(self):
     263        return "0"
     264    def get_argument_name(self, namesiter):
     265        return "bitprecision"
     266
    257267class PariArgumentSeriesPrec(PariArgumentClass):
    258268    def _typerepr(self):
    259269        return "serprec"
    pari_arg_types = { 
    277287        'U': PariArgumentULong,
    278288        'n': PariArgumentVariable,
    279289        'p': PariArgumentPrec,
     290        'b': PariArgumentBitPrec,
    280291        'P': PariArgumentSeriesPrec,
    281292
    282293    # Codes which are known but not actually supported for Sage
  • src/sage_setup/autogen/pari/generator.py

    diff --git a/src/sage_setup/autogen/pari/generator.py b/src/sage_setup/autogen/pari/generator.py
    index 7aa9990..9b78d88 100644
    a b class PariFunctionGenerator(object): 
    233233        D = sorted(D.values(), key=lambda d: d['function'])
    234234        sys.stdout.write("Generating PARI functions:")
    235235
    236         self.gen_file = open(self.gen_filename, 'w')
     236        self.gen_file = open(self.gen_filename + '.tmp', 'w')
    237237        self.gen_file.write(gen_banner)
    238         self.instance_file = open(self.instance_filename, 'w')
     238        self.instance_file = open(self.instance_filename + '.tmp', 'w')
    239239        self.instance_file.write(instance_banner)
    240240
    241241        for v in D:
    class PariFunctionGenerator(object): 
    249249
    250250        self.gen_file.close()
    251251        self.instance_file.close()
     252
     253        # All done? Let's commit.
     254        os.rename(self.gen_filename + '.tmp', self.gen_filename)
     255        os.rename(self.instance_filename + '.tmp', self.instance_filename)

comment:2 in reply to: ↑ 1 Changed 4 years ago by jdemeyer

Replying to buck:

This is what I have so far, but I see that src/sage/libs/pari/paridecl.pxd needs to be updated. @jdemeyer: How is this file maintained?

Manually. It's mostly a copy and paste from PARI's <paridecl.h>.

It seems like something that should also be done by the autogen/pari system.

Feel free to propose a patch :-)

I would prefer this ticket to depend on #19883 in order to avoid merge conflicts.

comment:3 Changed 4 years ago by jdemeyer

  • Reviewers jdemeyer deleted
  • Type changed from PLEASE CHANGE to enhancement

A reviewer without author?

comment:4 Changed 4 years ago by jdemeyer

  • Dependencies set to #19883

comment:5 Changed 4 years ago by buck

  • Branch set to u/buck/bump-pari

comment:6 Changed 4 years ago by buck

  • Authors set to buck
  • Commit set to 683ac866ce855a27ed436b199327c8525c1ac565
  • Owner changed from (none) to buck
  • Report Upstream changed from N/A to Fixed upstream, but not in a stable release.
  • Reviewers set to jdemeyer

New commits:

683ac86update pari to latest master

comment:7 Changed 4 years ago by jdemeyer

  • Reviewers changed from jdemeyer to Jeroen Demeyer

You should write your real name in the Author field.

Also don't forget to post a link to the tarball (created with make snapshot) and to set the ticket to needs_review if you are done.

comment:8 Changed 4 years ago by jdemeyer

  • Description modified (diff)
  • Milestone changed from sage-7.0 to sage-7.1

What does the "Fixed upstream, but not in a stable release." refer to?

comment:9 Changed 4 years ago by jdemeyer

@buck: do you intend to finish this?

comment:10 Changed 4 years ago by jdemeyer

  • Authors changed from buck to Jeroen Demeyer
  • Reviewers Jeroen Demeyer deleted

@buck: I will finish this. Remember to add your real name as author.

comment:11 Changed 4 years ago by jdemeyer

  • Authors changed from Jeroen Demeyer to Evan Buck, Jeroen Demeyer
  • Report Upstream changed from Fixed upstream, but not in a stable release. to N/A

comment:12 Changed 4 years ago by jdemeyer

  • Description modified (diff)

comment:13 Changed 4 years ago by jdemeyer

  • Branch changed from u/buck/bump-pari to u/jdemeyer/bump-pari

comment:14 Changed 4 years ago by git

  • Commit changed from 683ac866ce855a27ed436b199327c8525c1ac565 to cf197b7b8ca9885ed81b40961caaa6ce059558ce

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

cf197b7Merge tag '7.1.beta1' into t/19905/bump-pari

comment:15 Changed 4 years ago by jdemeyer

  • Dependencies #19883 deleted

comment:16 Changed 4 years ago by jdemeyer

  • Description modified (diff)

comment:17 Changed 4 years ago by git

  • Commit changed from cf197b7b8ca9885ed81b40961caaa6ce059558ce to 7d9387a2b2d2d88cd0603f34a065b03ddfd0bdf4

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

b92232cMerge tag '7.1.beta1' into t/19905/bump-pari
e36e614Remove obsolete declarations
7d9387aFix bitprec support

comment:18 Changed 4 years ago by git

  • Commit changed from 7d9387a2b2d2d88cd0603f34a065b03ddfd0bdf4 to 5bca083d3e391ced1170fb7e7be79a747a899310

Branch pushed to git repo; I updated commit sha1. New commits:

5bca083Add pari_stack declarations

comment:19 Changed 4 years ago by jdemeyer

  • Status changed from new to needs_review

comment:20 follow-up: Changed 4 years ago by buck

  • Authors changed from Evan Buck, Jeroen Demeyer to Buck Evan, Jeroen Demeyer
  • Reviewers set to Buck Evan
  • Status changed from needs_review to positive_review

LGTM.

Thanks for finishing up. I hope my patch helped some.

comment:21 in reply to: ↑ 20 Changed 4 years ago by jdemeyer

Replying to buck:

I hope my patch helped some.

Of course it did. Thank you too.

comment:22 Changed 4 years ago by vbraun

  • Branch changed from u/jdemeyer/bump-pari to 5bca083d3e391ced1170fb7e7be79a747a899310
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.