How to find the exact version of giac used in sagemath 10.5 binary?

117 views
Skip to first unread message

Nasser M. Abbasi

unread,
Jan 5, 2025, 12:01:44 AMJan 5
to sage-devel
I am on arch linux, and I found that arch pacman package manager has latest sagemath. So I do not have to build sagemath from source, which is much easier.

So I used pacman to install sagemath 10.5 , also used it to install giac.

The issue is that, I do not know if sagemath is using its own builtin giac now or is it using the one I have also installed using pacman on same linux.

Is there a way to find out the exact version of giac that sagemath is using? Is it using one builtin internally inside sagemath binary, or it is using the one I have on linux outside of sagemath?

which sage
/usr/bin/sage
>sage --version
SageMath version 10.5, Release Date: 2024-12-04
>sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 10.5, Release Date: 2024-12-04                    │
│ Using Python 3.13.1. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
sage: print(giac.version())
"giac 1.9.0, (c) B. Parisse and R. De Graeve, Institut Fourier, Universite Grenoble Alpes. Optimization, signalprocessing, graph theory (c) Luka Marohnić"
sage: exit()


>which giac
/usr/bin/giac
>giac --version
1.9.0
>

The problem is that pacman actually installed giac 1.9.0-998, even though the version says 1.9.0 (this is because giac does not update the last 3 digits in the version number).

>pacman -Q| grep giac
giac 1.9.0.998-1
>

And this is the latest giac version.  

I'd like to know if sagemath binary is using its own giac or is it using the system one, which is 1.9.0.998  

Thanks
--Nasser

Nils Bruin

unread,
Jan 5, 2025, 12:33:54 AMJan 5
to sage-devel
Are you interested in the giac that is used by a command like "giac(1)"?  That starts up a separate process, so if you use something like "ps ax" you'll get a line like:

1936931 pts/11   Ssl+   0:00 /usr/bin/giac --sage

which tells you which binary is running.

Nasser M. Abbasi

unread,
Jan 5, 2025, 12:48:07 AMJan 5
to sage-devel
I need to know which giac is used by sagemath when I do this command

>sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 10.5, Release Date: 2024-12-04                    │
│ Using Python 3.13.1. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
sage: x=var('x')
sage: integrate(sin(x),x,algorithm="giac")
-cos(x)
sage:

In the above, is sagemath calling the system installed giac  1.9.0.998 in /usr/bin/giac or is it calling its own (internally) build giac into the sagemath binary?
If it is calling its own giac, how to find the full version number?

I need to document which version of giac I am using and now I am not sure.

The problem is that giac 1.9.0 does not tell the exact version. As you see from


giac 1.9.0 was first released in April 2022, and 1.9.0.998 on December 12, 2024,
that is two years span. But both print 1.9.0 as version number !

So it is important to know the last 3 digits to know how old
or new is the giac used by sagemath.

Thanks
--Nasser

François Bissey

unread,
Jan 5, 2025, 2:20:06 AMJan 5
to sage-...@googlegroups.com
It is very likely that sagemath installed by pacman from AUR uses the
system giac. But you can check the list of files installed by pacman for
sagemath.
pacman -Ql $package_name
if it includes a private copy of giac, it should appear in the list.

François

On 5/01/25 18:48, 'Nasser M. Abbasi' via sage-devel wrote:
> I need to know which giac is used by sagemath when I do this command
>
>>sage
> ┌────────────────────────────────────────────────────────────────────┐
> │ SageMath version 10.5, Release Date: 2024-12-04                    │
> │ Using Python 3.13.1. Type "help()" for help.                       │
> └────────────────────────────────────────────────────────────────────┘
> sage: x=var('x')
> sage: integrate(sin(x),x,algorithm="giac")
> -cos(x)
> sage:
>
> In the above, is sagemath calling the system installed giac  1.9.0.998
> in /usr/bin/giac or is it calling its own (internally) build giac into
> the sagemath binary?
> If it is calling its own giac, how to find the full version number?
>
> I need to document which version of giac I am using and now I am not sure.
>
> The problem is that giac 1.9.0 does not tell the exact version. As you
> see from
>
> https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/
> source/ <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/
> stable/main/source/>
> --
> 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 <mailto:sage-
> devel+un...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/sage-
> devel/b9042c7d-53c5-4693-8985-0c3ff718ae4bn%40googlegroups.com <https://
> groups.google.com/d/msgid/sage-devel/
> b9042c7d-53c5-4693-8985-0c3ff718ae4bn%40googlegroups.com?
> utm_medium=email&utm_source=footer>.

Gonzalo Tornaría

unread,
Jan 5, 2025, 10:05:14 AMJan 5
to sage-devel
You can use one of the changes in behaviour that are in sagemath history (in the form of doctests that we have to change as we upgrade giac). For instance:

---

With giac 1.9.0-998:

sage: libgiac.solve('sin(3*x)>2*sin(x)', libgiac('x'))
Inequation on periodic expression without assumptions on variable, adding assumption ((x>=0) and (x<(2*pi)))
list[((x>0) and (x<(pi/6))),((x>(5*pi/6)) and (x<pi)),((x>(7*pi/6)) and (x<(11*pi/6)))]

---

With giac 1.9.0-995:

sage: libgiac.solve('sin(3*x)>2*sin(x)', libgiac('x'))
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
...
RuntimeError: Unable to find numeric values solving equation. For trigonometric equations this may be solved using assumptions, e.g. assume(x>-pi && x<pi) Error: Bad Argument Value

---


For a better long-term solution, maybe sagemath (and arch) could just patch giac so it shows the full version? We do that in void linux:

===
$ giac --version
// Using locale /usr/share/locale/
// C
// /usr/share/locale/
// giac
// UTF-8
// Maximum number of parallel threads 8
// (c) 2001, 2021 B. Parisse & others
1.9.0-998
===

See: https://github.com/void-linux/void-packages/blob/master/srcpkgs/giac/template#L48

Something like this added to build/pkgs/giac/spkg-src might work (untested):

    sed -e '/m4_define(\[giac_micro_version]/ s/\['${VERSION##*.}']/['${VERSION##*.}'-'${VERSIONREV}${PATCHSUFFIX}']/' -i configure.ac

The expanded version of that should be something like

    sed -e '/m4_define(\[giac_micro_version]/ s/\[0]/[0-15p0]/' -i configure.ac

I'm not doing this; some sage-the-distro user feel free to pick it up.


Best,
Gonzalo

Nasser M. Abbasi

unread,
Jan 5, 2025, 10:06:45 AMJan 5
to sage-devel

This link shows the Arch sagemath package info that I installed


There is link at bottom of this page to show list of all files also (click on package content)
I see number of files with giac in them. Here is the list from my linux using the command you gave

>pacman -Ql sagemath | grep -i giac
sagemath /usr/lib/python3.13/site-packages/sage/cython_debug/cython_debug_info_sage.libs.giac.giac
sagemath /usr/lib/python3.13/site-packages/sage/features/__pycache__/giac.cpython-313.opt-1.pyc
sagemath /usr/lib/python3.13/site-packages/sage/features/__pycache__/giac.cpython-313.pyc
sagemath /usr/lib/python3.13/site-packages/sage/features/giac.py
sagemath /usr/lib/python3.13/site-packages/sage/interfaces/__pycache__/giac.cpython-313.opt-1.pyc
sagemath /usr/lib/python3.13/site-packages/sage/interfaces/__pycache__/giac.cpython-313.pyc
sagemath /usr/lib/python3.13/site-packages/sage/interfaces/giac.py
sagemath /usr/lib/python3.13/site-packages/sage/libs/giac/
sagemath /usr/lib/python3.13/site-packages/sage/libs/giac/__init__.py
sagemath /usr/lib/python3.13/site-packages/sage/libs/giac/__pycache__/
sagemath /usr/lib/python3.13/site-packages/sage/libs/giac/__pycache__/__init__.cpython-313.opt-1.pyc
sagemath /usr/lib/python3.13/site-packages/sage/libs/giac/__pycache__/__init__.cpython-313.pyc
sagemath /usr/lib/python3.13/site-packages/sage/libs/giac/auto-methods.pxi
sagemath /usr/lib/python3.13/site-packages/sage/libs/giac/giac.cpython-313-x86_64-linux-gnu.so
sagemath /usr/lib/python3.13/site-packages/sage/libs/giac/giac.pxd
sagemath /usr/lib/python3.13/site-packages/sage/libs/giac/giac.pyx
sagemath /usr/lib/python3.13/site-packages/sage/libs/giac/keywords.pxi
sagemath /usr/lib/python3.13/site-packages/sage/libs/giac/misc.h

That is all. I see the file

/usr/lib/python3.13/site-packages/sage/libs/giac/

Is this the giac sagemath 10.5 is using then?  If so, how to find
the version of giac it is using?

It would be much better if it is using the system giac, but I am still not sure
which giac it is using.  

Will see if I can find more information.

--Nasser

Nasser M. Abbasi

unread,
Jan 5, 2025, 10:23:23 AMJan 5
to sage-devel
And here is the content of   sagemath giac lib that is listed in the sagemath package files

>ls -l /usr/lib/python3.13/site-packages/sage/libs/giac/
total 3572
-rw-r--r-- 1 root root  676302 Dec 22 06:23 auto-methods.pxi
-rwxr-xr-x 1 root root 2840360 Dec 22 06:23 giac.cpython-313-x86_64-linux-gnu.so
-rw-r--r-- 1 root root    8195 Dec 22 06:23 giac.pxd
-rw-r--r-- 1 root root   68611 Dec 22 06:23 giac.pyx
-rw-r--r-- 1 root root   12513 Dec 22 06:23 __init__.py
-rw-r--r-- 1 root root   25689 Dec 22 06:23 keywords.pxi
-rw-r--r-- 1 root root    2500 Dec 22 06:23 misc.h
drwxr-xr-x 2 root root    4096 Jan  1 16:45 __pycache__


And

readelf -V /usr/lib/python3.13/site-packages/sage/libs/giac//giac.cpython-313-x86_64-linux-gnu.so

did not show 1.9.0 anything. Also tried

strings  /usr/lib/python3.13/site-packages/sage/libs/giac//giac.cpython-313-x86_64-linux-gnu.so

And same thing, I could not see 1.9.0 anything on the screen.

But it seems the arch sagemath pacman package is using its own builtin giac, right? Since it is using
giac as shared library in the above .so. Just need to know which version of giac it is using.

someone from Arch should know this, the person who build the sagemath pacman package. It has
the name Antonio Rojas  there. Will try to ask them and see if they would know.

Thanks.

Gonzalo Tornaría

unread,
Jan 5, 2025, 10:24:26 AMJan 5
to sage-...@googlegroups.com
January 5, 2025 12:07 PM, "Nasser M. Abbasi' via sage-devel" <sage-...@googlegroups.com> wrote:
> This link shows the Arch sagemath package info that I installed
>
> https://archlinux.org/packages/extra/x86_64/sagemath/

If you are using arch sagemath, then you are not using sage-the-distro and so you are using arch giac as well.

Try the example from my previous email to see.


> /usr/lib/python3.13/site-packages/sage/libs/giac/
>
> Is this the giac sagemath 10.5 is using then? If so, how to find

This is not giac, this is sagelib code to interface with giac.


> the version of giac it is using?

giac should be in /usr/bin/giac and /usr/lib/libgiac.so.0

You can see that sagelib code links to your system giac library as in:

$ ldd /usr/lib/python3.13/site-packages/sage/libs/giac/giac*.so | grep giac
libgiac.so.0 => /usr/lib/libgiac.so.0 (0x00007fa627e00000)


> On Sunday, January 5, 2025 at 1:20:06 AM UTC-6 François Bissey wrote:
>> It is very likely that sagemath installed by pacman from AUR uses the
>> system giac. But you can check the list of files installed by pacman for
>> sagemath.

BTW, I don't think this is AUR. This is an official arch package afaict; and void linux also has an official sagemath package.

Note that both arch and void are actively updated and usually have more current versions of software than sage-the-distro (for example: pari 2.17 and python 3.13).


Best,
Gonzalo

Nasser M. Abbasi

unread,
Jan 5, 2025, 11:20:51 AMJan 5
to sage-devel
"If you are using arch sagemath, then you are not using sage-the-distro and so you are using arch giac as well."

This is good to know. I am new to using arch and was not sure. I am actually using EOS distro which is arch based,
not arch itself.

I just found the info I wanted is online:


It has dependencies list there. One of them is giac. When I click on giac link it shows 


which says giac 1.9.0.998-1

This way one can find the version number of any software sagemath package uses from pacman website.

Ok, case closed.

From now on, I will just use Arch package manager to install sagemath and other software
instead of building from sources as I used to do. Much easier this way.

Thanks for help everyone.
--Nasser

François Bissey

unread,
Jan 5, 2025, 2:17:06 PMJan 5
to sage-...@googlegroups.com
Instead of "readelf", use "ldd -r" - it will show you the path to the
libgiac used which - given there was no such file in your list - should
turn out to be the system one.
> the name Antonio Rojas <https://archlinux.org/packages/?
> maintainer=arojas>  there. Will try to ask them and see if they would know.
>
> Thanks.
>
> On Sunday, January 5, 2025 at 9:06:45 AM UTC-6 Nasser M. Abbasi wrote:
>
>
> This link shows the Arch sagemath package info that I installed
>
> https://archlinux.org/packages/extra/x86_64/sagemath/ <https://
> archlinux.org/packages/extra/x86_64/sagemath/>
> giac.cpython-313-x86_64-linux-gnu.so <http://giac.cpython-313-
> x86_64-linux-gnu.so>
> stable/main/ <https://www-fourier.ujf-grenoble.fr/~parisse/
> debian/dists/stable/main/>
> > source/ <https://www-fourier.ujf-grenoble.fr/~parisse/debian/
> dists/ <https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/>
> msgid/sage- <https://groups.google.com/d/msgid/sage->
> > devel/
> b9042c7d-53c5-4693-8985-0c3ff718ae4bn%40googlegroups.com
> <http://40googlegroups.com> <https://
> > groups.google.com/d/msgid/sage-devel/ <http://
> groups.google.com/d/msgid/sage-devel/>
> > b9042c7d-53c5-4693-8985-0c3ff718ae4bn%40googlegroups.com
> <http://40googlegroups.com>?
> > utm_medium=email&utm_source=footer>.
>
> --
> 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 <mailto:sage-
> devel+un...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/sage-
> devel/b9431e3e-49c6-49ff-b740-8474f3b3a842n%40googlegroups.com <https://
> groups.google.com/d/msgid/sage-devel/b9431e3e-49c6-49ff-
> b740-8474f3b3a842n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages