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

From: Andreas Enge <[email-masked]>
Date: Fri, 14 Feb 2025 19:30:42 +0100

Hello Guillaume,

Am Fri, Feb 14, 2025 at 01:13:51PM +0000 schrieb Guillaume Le Vaillant:
> 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"
> 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).

thanks for looking into this! I am wary of adding LD_LIBRARY_PATH to
maxima itself (I sometimes modify LD_LIBRARY_PATH locally to just make
things work for a moment, but it can lead to all kinds of difficult to
debug situations). Even more so if this is then called from inside sage.

So if things become messy, maybe it would be better to use a separate
maxima-ecl only for sage, as defined in the patch in wip-sage?
We could even make this package private (define instead of
define-public); it is not propagated and only called from within sage
through the complete path to the binary.
I use "package/inherit" in the patch, and experimentally it did not work
when I moved the package definition into the different module sagemath.
Is that true? In that case, I would have to use regular inheritance.

Andreas