Ask Your Question
1

How to correctly setup sagemath to use external CAS system?

asked 2022-04-07 19:40:46 +0200

Nasser gravatar image

updated 2022-04-07 19:42:32 +0200

I think sagemath handling of using external CAS system is not too clear.

I installed sagemath 9.6 beta 7. It comes with OLD maxima and old GIAC CAS systems.

So I downloaded maxima and giac directly from their websites and build them from sources and installed them. They go to /usr/local/bin

>which maxima
/usr/local/bin/maxima

>maxima --version
Maxima 5.45.1

>which giac
/usr/local/bin/giac

>giac --version
// Maximum number of parallel threads 24
// (c) 2001, 2021 B. Parisse & others
1.7.0
>

The versions that come with sagemath sources tar file are older.

Maxima is 5.45.0 and giac is 1.6.0.47p3. These are old.

The problem is that there is no option in ./configure to tell it _not_ to include or build these old versions so that a user can use the newer versions in /usr/local/bin

Each time I install sagemath I have to go to its $SAGE_ROOT/local/bin and manually delete maxima and giac and make symbolic links to the ones I want to actually use in my /usr/local/bin so I can use these from sagemath.

>cd $SAGE_ROOT/local/bin
>ls -l maxima
lrwxrwxrwx 1 me me 21 Apr  7 12:16 maxima -> /usr/local/bin/maxima
>ls -l giac
lrwxrwxrwx 1 me me 19 Apr  7 12:17 giac -> /usr/local/bin/giac
>

The only problem doing it this way, is that sagemath ver command still thinks it is using the old maxima and giac I deleted, only in terms of displaying the version numbers

>sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.6.beta7, Release Date: 2022-04-02               │
│ Using Python 3.10.3. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘

sage: ver = installed_packages()
sage: ver['maxima']
'5.45.0.p0'
sage: ver['giac']
'1.6.0.47p3'

sage:  print(maxima.version())
WARNING: Maxima is unable to set up the help system.
(Details: CL-INFO::LOAD-PRIMARY-INDEX: Couldn't load
                                       "/mnt/g/nabbasi/data/CDROM/sagemath/sage-9.6.beta7/local/info/./maxima-index.lisp":
                                       file does not exist.)

5.45.1

 sage: print(giac.version())
"giac 1.7.0, (c) B. Parisse and R. De Graeve, Institut Fourier, Universite de Grenoble I"
sage:

So I can just use print(giac.version()) and not use ver['giac'] from now on to get the correct version number.

I just think this whole issue needs better design.

Why not allow users when doing ./configure the ability to _not_ install CAS systems they already have on their system. This will solve all this confusion. I see that one can do this with fricas (it is not on by default, and to install it, one must do ./configure --enable-fricas to install. But not for maxima and not for giac. Why?

Now, I see no option to do this.

Is there a better way to do all of this?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2022-04-07 20:44:16 +0200

updated 2022-04-07 20:44:50 +0200

The short answer: someone has to implement this. Some components of Sage are already handled like this, but not all.

A longer answer: you should check in the top-level "config.log" file to see why it is not recognizing your system installation of giac, because it is supposed to be detected. There is a relevant ./configure option:

--with-system-giac={no|yes (default)|force (exit with an error if no usable version is found)}

The relevant code is located (in the source code) in build/pkgs/giac/, and in particular in build/pkgs/giac/spkg-configure.m4. See also build/pkgs/giac/distros/ for the names of packages that provide giac for various packaging systems.

maxima doesn't have an spkg-configure.m4file, and so there is no corresponding test to see if it's already installed. There is work toward implementing it at https://trac.sagemath.org/ticket/32867.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-04-07 19:40:46 +0200

Seen: 388 times

Last updated: Apr 07 '22