pari installation

161 views
Skip to first unread message

John Cremona

unread,
Nov 8, 2023, 6:29:03 AM11/8/23
to SAGE devel
Two things: 

1. After

./configure --enable-pari_elldata  --enable-pari_galpol --enable-pari_jupyter --enable-pari_nftables --enable-pari_seadata

and make build I had an error installing pari_jupyter (which I had never used before).  See attched log.

2. I really need to build Sage to use my own installation of a more recent version of pari than the one which Sage includes, which appears to now be 2.15.4, as It has a bug in functions I use.  I have my own istallation of pari-2.16.1 (in /usr/local), and used --with-system-pari=yes in the configure line, but configure still reports

pari:                           SPKG version 2.15.4 is already installed

---

Of these, #1 is not important to me right now but #2 is.  Thanks,

John
pari_jupyter-1.4.0.log

John Cremona

unread,
Nov 8, 2023, 6:37:43 AM11/8/23
to SAGE devel
PS OK, my bug was fixed in pari-2.15.4 which is what is in Sage 10.2rc0 so I am happy with that -- though I would still like to know how to use my system-installed 2.16.1.

Dima Pasechnik

unread,
Nov 8, 2023, 6:46:10 AM11/8/23
to sage-...@googlegroups.com
On Wed, Nov 8, 2023 at 11:37 AM John Cremona <john.c...@gmail.com> wrote:
>
> PS OK, my bug was fixed in pari-2.15.4 which is what is in Sage 10.2rc0 so I am happy with that -- though I would still like to know how to use my system-installed 2.16.1.

if you have pari installed in Sage you need to uninstall it before
using the system-wide one. This can be done by

make pari-clean pari-uninstall

and then you can run ./configure and hope that the system one is judged OK.

HTH
Dima

PS.I'm also not 100% sure that the dependency resolution will work
correctly, so that everything that depends on libpari is properly
rebuilt (or you need to clean these all, manually, as well)




>
> On Wed, 8 Nov 2023 at 11:28, John Cremona <john.c...@gmail.com> wrote:
>>
>> Two things:
>>
>> 1. After
>>
>> ./configure --enable-pari_elldata --enable-pari_galpol --enable-pari_jupyter --enable-pari_nftables --enable-pari_seadata
>>
>> and make build I had an error installing pari_jupyter (which I had never used before). See attched log.
>>
>> 2. I really need to build Sage to use my own installation of a more recent version of pari than the one which Sage includes, which appears to now be 2.15.4, as It has a bug in functions I use. I have my own istallation of pari-2.16.1 (in /usr/local), and used --with-system-pari=yes in the configure line, but configure still reports
>>
>> pari: SPKG version 2.15.4 is already installed
>>
>> ---
>>
>> Of these, #1 is not important to me right now but #2 is. Thanks,
>>
>> John
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAD0p0K5S%3DmdGxKRXCY2zEALCaJFi_z5_8t%3DhHro-uHtSon%2BCKA%40mail.gmail.com.

John Cremona

unread,
Nov 8, 2023, 7:51:56 AM11/8/23
to SAGE devel


On Wed, 8 Nov 2023, 11:46 Dima Pasechnik, <dim...@gmail.com> wrote:
On Wed, Nov 8, 2023 at 11:37 AM John Cremona <john.c...@gmail.com> wrote:
>
> PS OK, my bug was fixed in pari-2.15.4 which is what is in Sage 10.2rc0 so I am happy with that -- though I would still like to know how to use my system-installed 2.16.1.

if you have pari installed in Sage you need to uninstall it before
using the system-wide one. This can be done by

make pari-clean pari-uninstall

and then you can run ./configure and hope that the system one is judged OK.

HTH
Dima

PS.I'm also not 100% sure that the dependency resolution will work
correctly, so that everything that depends on libpari is properly
rebuilt (or you need to clean these all, manually, as well)

Thanks Dima, I'll try and report back.

John





>
> On Wed, 8 Nov 2023 at 11:28, John Cremona <john.c...@gmail.com> wrote:
>>
>> Two things:
>>
>> 1. After
>>
>> ./configure --enable-pari_elldata  --enable-pari_galpol --enable-pari_jupyter --enable-pari_nftables --enable-pari_seadata
>>
>> and make build I had an error installing pari_jupyter (which I had never used before).  See attched log.
>>
>> 2. I really need to build Sage to use my own installation of a more recent version of pari than the one which Sage includes, which appears to now be 2.15.4, as It has a bug in functions I use.  I have my own istallation of pari-2.16.1 (in /usr/local), and used --with-system-pari=yes in the configure line, but configure still reports
>>
>> pari:                           SPKG version 2.15.4 is already installed
>>
>> ---
>>
>> Of these, #1 is not important to me right now but #2 is.  Thanks,
>>
>> John
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAD0p0K5S%3DmdGxKRXCY2zEALCaJFi_z5_8t%3DhHro-uHtSon%2BCKA%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.

John Cremona

unread,
Nov 8, 2023, 10:20:55 AM11/8/23
to SAGE devel
On Wed, 8 Nov 2023 at 12:51, John Cremona <john.c...@gmail.com> wrote:


On Wed, 8 Nov 2023, 11:46 Dima Pasechnik, <dim...@gmail.com> wrote:
On Wed, Nov 8, 2023 at 11:37 AM John Cremona <john.c...@gmail.com> wrote:
>
> PS OK, my bug was fixed in pari-2.15.4 which is what is in Sage 10.2rc0 so I am happy with that -- though I would still like to know how to use my system-installed 2.16.1.

if you have pari installed in Sage you need to uninstall it before
using the system-wide one. This can be done by

make pari-clean pari-uninstall

and then you can run ./configure and hope that the system one is judged OK.

After this, configure did not like the newly installed system-wide pari (version 2.16.1).

Checking whether SageMath should install SPKG pari...
checking whether any of gmp readline is installed as or will be installed as SPKG... yes; install pari as well
configure: no suitable system package found for SPKG pari

-- which is what you thought might happen.  So I also did make x-clean x-uninstall for x=gmp and x=readline.  AFter that it was happy with my readline but not with my gmp.  I wonder why:

Checking whether SageMath should install SPKG gmp...
checking for gmp.h... yes
checking for gmpxx.h... no
checking for library containing __gmpq_cmp_z... -lgmp
configure: no suitable system package found for SPKG gmp

I do of course have gmp installed, I'm not sure anything works without it (this is a ubuntu Ubuntu 22.04.3 LTS system).  I have libgmp-dev, libgmp10, libgmp10-doc, libgmp3-dev, libgmpxx4ldbl.  The file mentioned gmpxx is in /usr/include (and also in /usr/local/sage/sage-10.1/local/include/gmpxx.h from a system-wide installation of sage 10.1) -- and those two files are identical.
 
Any ideas?

John

Dima Pasechnik

unread,
Nov 8, 2023, 10:31:56 AM11/8/23
to sage-...@googlegroups.com
On Wed, Nov 8, 2023 at 3:20 PM John Cremona <john.c...@gmail.com> wrote:
>
>
>
> On Wed, 8 Nov 2023 at 12:51, John Cremona <john.c...@gmail.com> wrote:
>>
>>
>>
>> On Wed, 8 Nov 2023, 11:46 Dima Pasechnik, <dim...@gmail.com> wrote:
>>>
>>> On Wed, Nov 8, 2023 at 11:37 AM John Cremona <john.c...@gmail.com> wrote:
>>> >
>>> > PS OK, my bug was fixed in pari-2.15.4 which is what is in Sage 10.2rc0 so I am happy with that -- though I would still like to know how to use my system-installed 2.16.1.
>>>
>>> if you have pari installed in Sage you need to uninstall it before
>>> using the system-wide one. This can be done by
>>>
>>> make pari-clean pari-uninstall
>>>
>>> and then you can run ./configure and hope that the system one is judged OK.
>
>
> After this, configure did not like the newly installed system-wide pari (version 2.16.1).
>
> Checking whether SageMath should install SPKG pari...
> checking whether any of gmp readline is installed as or will be installed as SPKG... yes; install pari as well
> configure: no suitable system package found for SPKG pari
>
> -- which is what you thought might happen. So I also did make x-clean x-uninstall for x=gmp and x=readline. AFter that it was happy with my readline but not with my gmp. I wonder why:
>
> Checking whether SageMath should install SPKG gmp...
> checking for gmp.h... yes
> checking for gmpxx.h... no
> checking for library containing __gmpq_cmp_z... -lgmp
> configure: no suitable system package found for SPKG gmp
>
> I do of course have gmp installed, I'm not sure anything works without it (this is a ubuntu Ubuntu 22.04.3 LTS system). I have libgmp-dev, libgmp10, libgmp10-doc, libgmp3-dev, libgmpxx4ldbl. The file mentioned gmpxx is in /usr/include (and also in /usr/local/sage/sage-10.1/local/include/gmpxx.h from a system-wide installation of sage 10.1) -- and those two files are identical.

do you have a file named

/usr/include/gmpxx.h ?

Or is it

/usr/include/gmpxx ?

The latter won't work.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAD0p0K6LnqVjLuzq_35H%3Dfm5affAjWGTd9h5njd4KuYsC3JARw%40mail.gmail.com.

John Cremona

unread,
Nov 8, 2023, 11:17:14 AM11/8/23
to sage-...@googlegroups.com
I do have the former:

john@john-Latitude-E5470:~/sage (branch: develop)$ locate gmpxx.h
/usr/include/gmpxx.h
/usr/local/sage/sage-10.1/local/include/gmpxx.h

and no file gmpxx (without the suffix) anywhere.

 

Dima Pasechnik

unread,
Nov 8, 2023, 11:21:00 AM11/8/23
to sage-devel
this is very strange.
Could it be that you have some weird stuff in PATH or other env vars?

please send

config.log along 



Is 

Dima Pasechnik

unread,
Nov 8, 2023, 11:44:17 AM11/8/23
to sage-devel
also check that ./configure is not stale - re-run ./bootstrap

John Cremona

unread,
Nov 8, 2023, 11:57:16 AM11/8/23
to sage-...@googlegroups.com
After rerunning ./boostrap there was no difference.

I have attached config.log, and there are error messages i nthe gmp check which I hope will mean something to somebody.

I don't think that there is anything relevant in my env but some of these are surely obsolete:

john@john-Latitude-E5470:~/sage (branch: develop)$ env | grep SAGE
SAGE_UPGRADING=yes
SAGE_MATPLOTLIB_GUI=yes
SAGE_PARALLEL_SPKG_BUILD=yes
SAGE_INSTALL_CCACHE=yes

config.log

Dima Pasechnik

unread,
Nov 8, 2023, 1:01:02 PM11/8/23
to sage-...@googlegroups.com
I guess your gmp installation is shot (e.g. there is another one,which
causes header mess),or your g++ installation is shot, or both.
Are there any CFLAGS/CXXFLAGS/CPPFLAGS set in the shell, by any chance?

Can you try running

g++ -c foo.cpp

on the 1-line file foo.cpp,like this:

/* cut here: foo.cpp */
#include <gmpxx.h>
/* cut here */


Dima
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAD0p0K5OzQPt9-qPJ1iPz%3DnOuW_3j3%2BrxE0%3D3DvEP587-A8_nw%40mail.gmail.com.

Dima Pasechnik

unread,
Nov 8, 2023, 1:46:53 PM11/8/23
to sage-devel
---------- Forwarded message ---------
From: Dima Pasechnik <dim...@gmail.com>
Date: Wed, Nov 8, 2023 at 6:41 PM
Subject: Re: [sage-devel] Re: pari installation
To: François Bissey <frp.b...@gmail.com>


On Wed, Nov 8, 2023 at 6:37 PM François Bissey <frp.b...@gmail.com> wrote:
>
> Another possibly interesting question, what version of gmp?
> And where did you install it from?

the only relevant thread I found on this sort of errors is here:

https://gmplib.org/list-archives/gmp-bugs/2016-August/003997.html

and they say it's a mixup of headers from several versions.

>
> François

John Cremona

unread,
Nov 9, 2023, 4:25:01 AM11/9/23
to sage-...@googlegroups.com
OK, so compiling he one-line file produces the same set of error messages as in Sage's log.

Adding -E and examining the result shows that /usr/local/include/gmp/h is begin used (note the "local") and that file is -- despite the nsame -- one put there by MPIR which I do have installed.

I have had trouble before with the MPIR code pretending to be gmp, but I have not (yet) been able to eliminate MPIR from my built software, though I know that I should.

ANyway, renaming that /usr/local/include/gmp.h (at least temporarily) and rerunning the one-liner shows that it now works and gets its gmp.h from /usr/include/x86_64-linux-gnu/gmp.h which looks good.

However, configure still didn't like my system pari. Next I uninstalled ubuntu's official pari-related packages (which were there as well as my own newer version in /usr/local) and tried again.  That very nearly worked, and DID WORK after I rebuilt my pari with the --mt=pthreads option which I had forgotten.

Thanks for all the help, I am rebuilding Sage now to make sure that everything works.  I suppose my next job will be to persuade Sage to use my own eclib (which I certainly have installed!) which is likely to run into some of the same issues.

John

Dima Pasechnik

unread,
Nov 9, 2023, 4:46:06 AM11/9/23
to sage-...@googlegroups.com
On Thu, Nov 9, 2023 at 9:25 AM John Cremona <john.c...@gmail.com> wrote:
>
> OK, so compiling he one-line file produces the same set of error messages as in Sage's log.
>
> Adding -E and examining the result shows that /usr/local/include/gmp/h is begin used (note the "local") and that file is -- despite the nsame -- one put there by MPIR which I do have installed.
>
> I have had trouble before with the MPIR code pretending to be gmp, but I have not (yet) been able to eliminate MPIR from my built software, though I know that I should.

What do you do with MPIR? We certainly have eliminated it from
anywhere in Sage I can think of.
(e.g. I removed MPIR from deformation spkg and replaced it with gmp)
Anything you do with MPIR can be just as well done with gmp.

John Cremona

unread,
Nov 9, 2023, 9:28:19 AM11/9/23
to sage-...@googlegroups.com
No reason except inertia.  I think I used to install MPIR for use with FLINT (which I do actually use), which is of course unnecessary.

It is quite tricky to uninstall a system-wide MPIR which has been configured to pretend to be gmp -- for example, putting a header file called gmp.h into /usr/local/include, and putting files called libgmp* into /usr/local/lib.

John

 

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages