Subject: Re: [PATCH v2 1/2] gnu: maxima: Compile with ecl instead of sbcl.

From: Guillaume Le Vaillant <[email-masked]>
Date: Fri, 14 Feb 2025 13:13:51 +0000

Andreas Enge <[email-masked]> skribis:

> Hello,
>
> Am Fri, Feb 14, 2025 at 09:47:03AM +0000 schrieb Guillaume Le Vaillant:
>> Have you checked if maxima doesn't become painfully slow with this
>> change, as sbcl is usually much faster than ecl?
>
> I have not checked anything, as I am not using maxima; just that it works
> from sage (with my favourite example "2+2;"). As far as I understood,
> sage requires maxima compiled with ecl. And I do not know if we have other
> users of maxima. If it becomes too slow, we could add the second variant
> maxima-ecl just for sage, as it is still available in the wip-sage branch.
>
> Do you use maxima yourself and could make a test?
>
> Andreas

I tried a few things, like inverting 50 by 50 matrices, and the
performance was not too bad compared to sbcl.

However, there is an issue when trying to load optional maxima packages.
For example when trying to load lapack:

--8<---------------cut here---------------start------------->8---
(%i1) load(lapack);

;;; Internal error:
;;;   ** Error code 1 when executing
;;; (EXT:RUN-PROGRAM "gcc" ("-I." "-I/gnu/store/0c233v22qxc4vg52ck40dn6hm8a0ga5j-ecl-24.5.10/include/" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-g" "-O2" "-fPIC" "-D_THREAD_SAFE" "-Dlinux" "-O2" "-c" "/home/glv/.maxima/binary/5_47_0/ecl/24_5_10/share/lapack/lapack-package.c" "-o" "/home/glv/.maxima/binary/5_47_0/ecl/24_5_10/share/lapack/lapack-package.o")):
;;; Dans le fichier inclus depuis /gnu/store/0c233v22qxc4vg52ck40dn6hm8a0ga5j-ecl-24.5.10/include/ecl/ecl.h:32,
;;;                  depuis /gnu/store/0c233v22qxc4vg52ck40dn6hm8a0ga5j-ecl-24.5.10/include/ecl/ecl-cmp.h:31,
;;;                  depuis /home/glv/.maxima/binary/5_47_0/ecl/24_5_10/share/lapack/lapack-package.c:5:
;;; /gnu/store/0c233v22qxc4vg52ck40dn6hm8a0ga5j-ecl-24.5.10/include/ecl/config.h:54:10: erreur fatale: gmp.h : Aucun fichier ou dossier de ce nom
;;;    54 | #include "gmp.h"
;;;       |          ^~~~~~~
;;; compilation terminée.
;    - Binary file /home/glv/.maxima/binary/5_47_0/ecl/24_5_10/share/lapack/lapack-package.fas is old or does not exist. 
;      Compile (and load) source file /gnu/store/rm1fn7w82v79km720669nqmh03gbvk4h-maxima-5.47.0/share/maxima/5.47.0/share/lapack/lapack-package.lisp instead? y

;    - Should I bother you if this happens again? y

;;; Internal error:
;;;   ** Error code 1 when executing
;;; (EXT:RUN-PROGRAM "gcc" ("-I." "-I/gnu/store/0c233v22qxc4vg52ck40dn6hm8a0ga5j-ecl-24.5.10/include/" "-D_GNU_SOURCE" "-D_FILE_OFFSET_BITS=64" "-g" "-O2" "-fPIC" "-D_THREAD_SAFE" "-Dlinux" "-O2" "-c" "/home/glv/.maxima/binary/5_47_0/ecl/24_5_10/share/lapack/lapack-package.c" "-o" "/home/glv/.maxima/binary/5_47_0/ecl/24_5_10/share/lapack/lapack-package.o")):
;;; Dans le fichier inclus depuis /gnu/store/0c233v22qxc4vg52ck40dn6hm8a0ga5j-ecl-24.5.10/include/ecl/ecl.h:32,
;;;                  depuis /gnu/store/0c233v22qxc4vg52ck40dn6hm8a0ga5j-ecl-24.5.10/include/ecl/ecl-cmp.h:31,
;;;                  depuis /home/glv/.maxima/binary/5_47_0/ecl/24_5_10/share/lapack/lapack-package.c:5:
;;; /gnu/store/0c233v22qxc4vg52ck40dn6hm8a0ga5j-ecl-24.5.10/include/ecl/config.h:54:10: erreur fatale: gmp.h : Aucun fichier ou dossier de ce nom
;;;    54 | #include "gmp.h"
;;;       |          ^~~~~~~
;;; compilation terminée.
loadfile: failed to load /gnu/store/rm1fn7w82v79km720669nqmh03gbvk4h-maxima-5.47.0/share/maxima/5.47.0/share/lapack/load-lapack.lisp
 -- an error. To debug this try: debugmode(true);
--8<---------------cut here---------------end--------------->8---

I guess that it will be necessary to wrap the maxima executable so that
ecl's compiler can find the binaries and libraries that it requires
(see the propagated inputs and 'wrap' phase of the ecl package).