Problem building cypari in Sage 9.0

91 views
Skip to first unread message

Alexander Kruppa

unread,
Mar 3, 2020, 5:58:46 AM3/3/20
to sage-devel
 I get the following error when trying to build Sage 9.0 from source on OpenSuse Leap 15.1, see the attached logs.

All the best,
Alex

cypari-2.1.1.log
config.log

Dima Pasechnik

unread,
Mar 3, 2020, 9:18:13 AM3/3/20
to sage-devel
Could you try the latest dev branch?
https://github.com/sagemath/sage/tree/develop
> --
> 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/24e1d847-e2ff-4759-96db-07120e7264c6%40googlegroups.com.

Alexander Kruppa

unread,
Mar 5, 2020, 1:05:04 PM3/5/20
to sage-devel
I downloaded the dev branch as a .zip file from Github and tried to build it with "make". If failed in essentially the same way, see attachment.


Am Dienstag, 3. März 2020 15:18:13 UTC+1 schrieb Dima Pasechnik:
Could you try the latest dev branch?
https://github.com/sagemath/sage/tree/develop

On Tue, Mar 3, 2020 at 10:58 AM Alexander Kruppa <akr...@gmail.com> wrote:
>
>  I get the following error when trying to build Sage 9.0 from source on OpenSuse Leap 15.1, see the attached logs.
>
> All the best,
> Alex
>
> --
> 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-...@googlegroups.com.
cypari-2.1.1.log

Vincent Delecroix

unread,
Mar 5, 2020, 1:13:34 PM3/5/20
to sage-...@googlegroups.com
I believe it is a problem with pari version. Do you mind making a report
directly at

https://github.com/sagemath/cypari2

Also, it would help if you provide the following information:

1. whether you have pari installed on your system (independently of
Sage)?
2. if yes to 1, whether Sage configure does catch your pari from
the system (this information is available in config.log)
3. if yes to 2 and 3, try to install pari on your regular Python
(directly in the console with "pip install cypari2 --user")

Best
Vincent

Le 05/03/2020 à 19:05, Alexander Kruppa a écrit :
> I downloaded the dev branch as a .zip file from Github and tried to build
> it with "make". If failed in essentially the same way, see attachment.
>
> Am Dienstag, 3. März 2020 15:18:13 UTC+1 schrieb Dima Pasechnik:
>>
>> Could you try the latest dev branch?
>> https://github.com/sagemath/sage/tree/develop
>>
>> On Tue, Mar 3, 2020 at 10:58 AM Alexander Kruppa <akr...@gmail.com
>> <javascript:>> wrote:
>>>
>>> I get the following error when trying to build Sage 9.0 from source on
>> OpenSuse Leap 15.1, see the attached logs.
>>>
>>> All the best,
>>> Alex
>>>
>>> --
>>> 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-...@googlegroups.com <javascript:>.

Dima Pasechnik

unread,
Mar 5, 2020, 1:18:50 PM3/5/20
to sage-devel
On Thu, Mar 5, 2020 at 6:13 PM Vincent Delecroix
<20100.d...@gmail.com> wrote:
>
> I believe it is a problem with pari version. Do you mind making a report
> directly at
>
> https://github.com/sagemath/cypari2
>
> Also, it would help if you provide the following information:
>
> 1. whether you have pari installed on your system (independently of
> Sage)?
> 2. if yes to 1, whether Sage configure does catch your pari from
> the system (this information is available in config.log)

from the config.log in the 1st message on the thread:

configure:11939: === checking whether to install the pari SPKG ===
configure:11985: checking installing gmp/mpir or readline?
configure:11991: result: no
configure:11993: checking installing PARI/GP packages?
configure:11997: checking for gp
configure:12015: found /usr/bin/gp
configure:12027: result: /usr/bin/gp
configure:12039: checking is pari_elldata installed?
configure:12043: result: yes
configure:12054: checking is pari_galdata installed?
configure:12058: result: yes
configure:12069: checking is pari_galpol installed?
*** at top-level: galoisgetname(12,1)=
*** ^--------------------
*** not a function in function call
configure:12076: result: no; cannot use system pari/GP without galpol package
configure:12078: Install galpol package and reconfigure.
configure:12080: Otherwise Sage will build its own pari/GP.
configure:12084: checking is pari_seadata installed?
configure:12088: result: yes
configure:12328: result: using Sage's pari SPKG

That is to say, Pari is installed system-wide, but galpol package is
missing, and so Sage
builds its own Pari.

I suspect the error stems from a mix-up of paths, a system-wide Pari
gets used instead of the Sage's Pari.
> 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/03b6639a-8708-5bbe-c15b-05293d438f29%40gmail.com.

Vincent Delecroix

unread,
Mar 5, 2020, 1:25:12 PM3/5/20
to sage-...@googlegroups.com
Exactly, it is a problem with cypari2 that has to fight with two pari
installation. Some of the files of cypari2 are generated during the
build. And to do so it calls the gp interpreter (apparently the wrong
one).

One quick workaround: rename (temporarily) your system gp to
HIDDEN_gp and try again.

Vincent

Dima Pasechnik

unread,
Mar 5, 2020, 1:34:04 PM3/5/20
to sage-devel
On Thu, Mar 5, 2020 at 6:25 PM Vincent Delecroix
I am not sure this will help. Specifically, the failing gcc call

gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall
-Wno-unused -fPIC -I./cypari2
-I/home/alex/build/sage-develop/local/lib/python3.7/site-packages/cysignals
-I/home/alex/build/sage-develop/local/include/python3.7m -c
cypari2/gen.c -o build/temp.linux-x86_64-3.7/cypari2/gen.o
cypari2/gen.c: In function '__pyx_pf_7cypari2_3gen_8Gen_base_40algabsdim':
cypari2/gen.c:11949:18: warning: implicit declaration of function
'algabsdim'; did you mean 'algdim'? [-Wimplicit-function-declaration]
__pyx_v__ret = algabsdim(__pyx_v__al);
^~~~~~~~~
algdim

should have option -I/home/alex/build/sage-develop/local/include to
get the correct Sage's Pari headers,
but for some reason this does not happen.



>
> Vincent
>
> --
> 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/f0c94e86-754a-1c1e-37c2-042ee864362b%40gmail.com.

Vincent Delecroix

unread,
Mar 5, 2020, 2:00:53 PM3/5/20
to sage-...@googlegroups.com
That is the same problem. algabsdim does *not* exist since PARI 2.10
which means that this wrapper should not have been created in the first
place by the autogeneration of cypari2.

The list of include directories are also determined by the
autogeneration stuff.

And this is specifically autogen/paths.py. What it does is looking at
the path provided by

gppath = find_executable("gp")

In the OP situation, I believe the gppath variable is just wrong.


Vincent
in cypari2.


Dima Pasechnik

unread,
Mar 5, 2020, 2:58:22 PM3/5/20
to sage-devel
I cannot reproduce this problem on Ubuntu 18 with Pari 2.9.4 installed
(and so Sage builds Pari 2.11).
cypari builds just fine in the presense of another pari/gp.

Thing to check:
fire up
./sage -sh

and run

echo $PATH #
(SAGE_LOCAL/bin should be 1st)

which gp
(should be in SAGE_LOCAL/bin)

which python
(should be in SAGE_LOCAL/bin)

run
python
at python prompt, do

from distutils.spawn import find_executable
find_executable('gp')

it shouild print the full path to 'gp' in SAGE_LOCAL/bin

Alexander Kruppa

unread,
Mar 5, 2020, 3:56:10 PM3/5/20
to sage-devel
I think we're getting closer.

alex@lily:~/build/sage-develop> ./sage -sh

Starting subshell with Sage environment variables set.  Don't forget
to exit when you are done.  Beware:
 * Do not do anything with other copies of Sage on your system.
 * Do not use this for installing Sage packages using "sage -i" or for
   running "make" at Sage's root directory.  These should be done
   outside the Sage shell.

Bypassing shell configuration files...

Note: SAGE_ROOT=/home/alex/build/sage-develop
(sage-sh) alex@lily:sage-develop$ echo $PATH
/home/alex/build/sage-develop/build/bin:/home/alex/build/sage-develop/src/bin:/home/alex/build/sage-develop/local/bin:/home/alex/.pyenv/shims:/home/alex/.pyenv/bin:/home/alex/.local/bin/:/home/alex/.pyenv/shims:/home/alex/.pyenv/bin:/home/alex/.local/bin/:/usr/lib64/mpi/gcc/openmpi/bin:/home/alex/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin
(sage-sh) alex@lily:sage-develop$ which gp
/home/alex/build/sage-develop/local/bin/gp
(sage-sh) alex@lily:sage-develop$ which python
/home/alex/.pyenv/shims/python
(sage-sh) alex@lily:sage-develop$ python
Python 2.7.14 (default, Oct 12 2017, 15:50:02) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> from distutils.spawn import find_executable
>>> find_executable('gp')
'/usr/bin/gp'
>>>


"python" runs the distribution's Python 2. There is no Python 2 installed in SAGE_LOCAL/bin/

alex@lily:~/build/sage-develop> ls -la /home/alex/build/sage-develop/local/bin/py*
lrwxrwxrwx 1 alex users     8 Mar  3 22:08 /home/alex/build/sage-develop/local/bin/pydoc3 -> pydoc3.7
-rwxr-xr-x 1 alex users   109 Mar  3 22:08 /home/alex/build/sage-develop/local/bin/pydoc3.7
lrwxrwxrwx 1 alex users     9 Mar  3 22:08 /home/alex/build/sage-develop/local/bin/python3 -> python3.7
lrwxrwxrwx 1 alex users    16 Mar  3 22:08 /home/alex/build/sage-develop/local/bin/python3-config -> python3.7-config
-rwxr-xr-x 1 alex users 31304 Mar  3 22:07 /home/alex/build/sage-develop/local/bin/python3.7
lrwxrwxrwx 1 alex users    17 Mar  3 22:08 /home/alex/build/sage-develop/local/bin/python3.7-config -> python3.7m-config
-rwxr-xr-x 1 alex users 31304 Mar  3 22:07 /home/alex/build/sage-develop/local/bin/python3.7m
-rwxr-xr-x 1 alex users  3143 Mar  3 22:08 /home/alex/build/sage-develop/local/bin/python3.7m-config
lrwxrwxrwx 1 alex users    10 Mar  3 22:08 /home/alex/build/sage-develop/local/bin/pyvenv -> pyvenv-3.7
-rwxr-xr-x 1 alex users   466 Mar  3 22:08 /home/alex/build/sage-develop/local/bin/pyvenv-3.7


My pyenv points at the system-installed Python 2:

alex@lily:~/build/sage-develop> pyenv global
system
alex@lily:~/build/sage-develop> pyenv shell
pyenv: no shell-specific version configured
alex@lily:~/build/sage-develop> pyenv local
pyenv: no local version configured for this directory


The config.log file (attached) for the build of the development version says:

[...]
configure:8367: checking Python version to install
configure:8384: result: 3
[...]
configure:29199: result: python2-2.7.15.p1:                           does not support check for system package; optional, use "./configure --enable-python2" to install
configure:29199: result: python3-3.7.3.p1:                            does not support check for system package; will be installed as an SPKG
[...]

It looks like Python 2 does not get compiled as part of Sage, and merely running "python" (as opposed to, say, "python3") from the Sage shell ends up using the system-installed Python 2 which then runs the system-installed gp.
config.log

Dima Pasechnik

unread,
Mar 5, 2020, 4:16:14 PM3/5/20
to sage-devel
there is no need for Python2 any more. Perhaps your
/home/alex/.pyenv/shims/python
is very unusual, and it modifies/freezes PATH, or something like this...

What's the output of
>>> import os
>>> os.environ['PATH']

if you run it?

Anyhow, /home/alex/.pyenv/shims/python looks dodgy to me.
I don't think we ever test anything for pyenv...






> --
> 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/ec5c50d6-46b8-4534-a9fe-81aa12c255ab%40googlegroups.com.

Dima Pasechnik

unread,
Mar 5, 2020, 4:17:25 PM3/5/20
to sage-devel
(run it from ./sage -sh, that is)

Alexander Kruppa

unread,
Mar 5, 2020, 5:08:48 PM3/5/20
to sage-devel
alex@lily:~/build/sage-develop> ./sage -sh

Starting subshell with Sage environment variables set.  Don't forget
to exit when you are done.  Beware:
 * Do not do anything with other copies of Sage on your system.
 * Do not use this for installing Sage packages using "sage -i" or for
   running "make" at Sage's root directory.  These should be done
   outside the Sage shell.

Bypassing shell configuration files...

Note: SAGE_ROOT=/home/alex/build/sage-develop
(sage-sh) alex@lily:sage-develop$ python
Python 2.7.14 (default, Oct 12 2017, 15:50:02) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ['PATH']
'/usr/bin:/home/alex/.pyenv/libexec:/home/alex/.pyenv/plugins/python-build/bin:/home/alex/build/sage-develop/build/bin:/home/alex/build/sage-develop/src/bin:/home/alex/build/sage-develop/local/bin:/home/alex/.pyenv/shims:/home/alex/.pyenv/bin:/home/alex/.local/bin/:/home/alex/.pyenv/shims:/home/alex/.pyenv/bin:/home/alex/.local/bin/:/usr/lib64/mpi/gcc/openmpi/bin:/home/alex/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin'

When I run "python" from a plain bash, with no Sage involvement, I get
'/usr/bin:/home/alex/.pyenv/libexec:/home/alex/.pyenv/plugins/python-build/bin:/home/alex/.pyenv/shims:/home/alex/.pyenv/bin:/home/alex/.local/bin/:/home/alex/.pyenv/shims:/home/alex/.pyenv/bin:/home/alex/.local/bin/:/usr/lib64/mpi/gcc/openmpi/bin:/home/alex/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin'

Does pyenv actually prefix PATH with /usr/bin? That seems questionable at the best. I think I better get rid of pyenv, then.

Dima Pasechnik

unread,
Mar 5, 2020, 5:23:20 PM3/5/20
to sage-devel
it appears that it does - indeed, compare this PATH with the one shown
by echo at ./sage -sh
prompt.

All bets are off at this point, I think, supporting this seems to be a
tall order.
Perhaps we should add to the docs that pyenv'd Python might cause trouble.


>
> --
> 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/927c0637-96ca-4ea4-bd84-00aa3a24d0b2%40googlegroups.com.

Alexander Kruppa

unread,
Mar 5, 2020, 5:36:16 PM3/5/20
to sage-devel
Agreed, documenting this incompatibility would be good. Maybe even add a test for pyenv to the build system, perhaps by simply checking for the string "pyenv" in $PATH, and in case the build fails, printing a message about pyenv being a possible culprit?

Thanks to all for helping me fix my problem. Build is running now and made it past cypari.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-...@googlegroups.com.

Dima Pasechnik

unread,
Jan 6, 2021, 7:44:43 AM1/6/21
to sage-devel
On Thursday, March 5, 2020 at 10:36:16 PM UTC akr...@gmail.com wrote:
Agreed, documenting this incompatibility would be good. Maybe even add a test for pyenv to the build system, perhaps by simply checking for the string "pyenv" in $PATH, and in case the build fails, printing a message about pyenv being a possible culprit?

Thanks to all for helping me fix my problem. Build is running now and made it past cypari.

I cannot reproduce the issue with the current pyenv, maybe it will just work. The results to be reported on 
Reply all
Reply to author
Forward
0 new messages