Hello, I am giving a try to build FriCAS with gcl27 2.7.0-18 from debian.org (amd64 arch). And first, sorry for this long email, I try to be as precise as possible.
So far, I encountered the following issues: Here is an offending piece of code: =============src/lisp/fricas-lisp.lisp===================== ;; GCL may pass strings by value. 'sock_get_string_buf' should fill ;; string with data read from connection, therefore needs address of ;; actual string buffer. We use 'sock_get_string_buf_wrapper' to ;; resolve the problem (SI::clines "int sock_get_string_buf_wrapper(int i, object x, int j)" "{ if (type_of(x)!=t_string) FEwrong_type_argument(sLstring,x);" " if (x->st.st_fillp<j)" " FEerror(\"string too small in sock_get_string_buf_wrapper\",0);" " return sock_get_string_buf(i, x->st.st_self, j); }") ================================================== Which then produces during the compilation phase: ---------------------------------------------------------------------------------------- In file included from /home/greg/Git/jlfricas/src/lisp/fricas-lisp.c:2: /usr/lib/gcl-2.7.0/unixport/../h/cmpinclude.h:87: note: macro "FEerror" defined here 87 | #define FEerror(a,b,c) Icall_gen_error_handler_noreturn(((object)&Cnil_body),null_string,sLerror,null_string,4,sKformat_control,make_simple_string(a),sKformat_arguments,list(b,c)) | /home/greg/Git/jlfricas/src/lisp/fricas-lisp.c:2159:5: error: ‘FEerror’ undeclared (first use in this function); did you mean ‘sLerror’? 2159 | FEerror("string too small in sock_get_string_buf_wrapper",0); | ^~~~~~~ | sLerror /home/greg/Git/jlfricas/src/lisp/fricas-lisp.c:2160:10: warning: implicit declaration of function ‘sock_get_string_buf’; did you mean ‘sock_get_string_buf_wrapper’? [-Wimplicit-function-declaration] 2160 | return sock_get_string_buf(i, x->st.st_self, j); } | ^~~~~~~~~~~~~~~~~~~ | sock_get_string_buf_wrapper ------------------------------------------------------------------------------------------- As you can see here, the 'FEerror' macro requires three arguments but two previously. Maybe a backward compatible way of handling this is available? That is, something compatible with GCL 2.6.14 and 2.7.0, this snippet compiles smoothly with gcl-2.6.14-4 from debian.org. I commented out these checks to go further. At a stage a temporary image is build using: ================================================== >echo '(compiler::link nil "prelisp" ' \ ' (format nil "(progn (let ((SI::*load-path*' \ ' (cons ~S SI::*load-path*))' \ ' (si::*load-types* ~S))' \ ' (compiler::emit-fn t))' \ ' (when (fboundp (quote si::sgc-on))' \ ' (si::sgc-on nil))' \ ' (setq compiler::*default-system-p* t))' \ ' (setq compiler::*default-large-memory-model-p* t))"' \ ' si::*system-directory* (quote (list ".lsp")))' \ ' "/home/greg/Git/jlfricas/src/lib/bsdsignal.o /home/greg/Git/jlfricas/src/lib/cfuns-c.o /home/greg/Git/jlfricas/src/lib/sockio-c.o ")' \ | gcl27 =================================================== And returns ---------------------------------------------------------------------------------------- GCL (GNU Common Lisp) 2.7.0 Thu Oct 26 12:00:01 PM EDT 2023 ANSI git: Version_2_7_0pre21 Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl) Binary License: GPL due to GPL'ed components: (XGCL UNEXEC) Modifications of this banner must retain notice of a compatible license Dedicated to the memory of W. Schelter Use (help) to get some basic information on how to use GCL. Temporary directory for compiler files set to /tmp/ >GCL (GNU Common Lisp) April 1994 4198612 pages Building symbol table for /home/greg/Git/jlfricas/src/lisp/raw_prelisp .. loading /usr/lib/gcl-2.7.0/unixport/../lsp/gcl_export.lsp loading /usr/lib/gcl-2.7.0/unixport/../lsp/gcl_defmacro.lsp loading /usr/lib/gcl-2.7.0/unixport/../lsp/gcl_evalmacros.lsp loading /usr/lib/gcl-2.7.0/unixport/../lsp/gcl_top.lsp loading /usr/lib/gcl-2.7.0/unixport/../lsp/gcl_autoload.lsp > NIL > MAKE-PACKAGE -- [SNIP] -- SYSTEM> (:RAW-IMAGE :ANSI-CL :COMMON-LISP :LARGE-MEMORY-MODEL :DYNAMIC-EXTENT :INTDIV :64BIT :C99 :GNU-LD :XGCL :UNEXEC :NATIVE-RELOC :EDITLINE :TRUNCATE_USE_C :CLX-LITTLE-ENDIAN :BSD :GNU :LINUX :X86_64 :SGC :IEEE-FLOATING-POINT :UNIX :GMP :GCL :AKCL :COMMON :KCL) SYSTEM>Initializing gcl_s.o Initializing gcl_sf.o Initializing gcl_rm.o Initializing gcl_dl.o Initializing gcl_fle.o Initializing gcl_defmacro.o Initializing gcl_hash.o Initializing gcl_evalmacros.o Initializing gcl_module.o Initializing gcl_predlib.o Initializing gcl_deftype.o -- [SNIP] -- CONDITIONS> (:PCL-STRUCTURES :PORTABLE-COMMONLOOPS :PCL :DEFPACKAGE :SDEBUG :SETF :ANSI-CL :COMMON-LISP :LARGE-MEMORY-MODEL :DYNAMIC-EXTENT :INTDIV :64BIT :C99 :GNU-LD :XGCL :UNEXEC :NATIVE-RELOC :EDITLINE :TRUNCATE_USE_C :CLX-LITTLE-ENDIAN :BSD :GNU :LINUX :X86_64 :SGC :IEEE-FLOATING-POINT :UNIX :GMP :GCL :AKCL :COMMON :KCL) CONDITIONS> #<"SYSTEM" package> SYSTEM> T SYSTEM> #<function 000000000231d310> SYSTEM> NIL SYSTEM> "" SYSTEM> NIL SYSTEM>;; Loading #P"/usr/lib/gcl-2.7.0/lsp/sys-proclaim.lisp" ;; Finished loading #P"/usr/lib/gcl-2.7.0/lsp/sys-proclaim.lisp" ;; Loading #P"/usr/lib/gcl-2.7.0/cmpnew/sys-proclaim.lisp" ;; Finished loading #P"/usr/lib/gcl-2.7.0/cmpnew/sys-proclaim.lisp" ;; Loading #P"/usr/lib/gcl-2.7.0/xgcl-2/sys-proclaim.lisp" ;; Finished loading #P"/usr/lib/gcl-2.7.0/xgcl-2/sys-proclaim.lisp" ;; Loading #P"/usr/lib/gcl-2.7.0/pcl/sys-proclaim.lisp" ;; Finished loading #P"/usr/lib/gcl-2.7.0/pcl/sys-proclaim.lisp" ;; Loading #P"/usr/lib/gcl-2.7.0/clcs/sys-proclaim.lisp" ;; Finished loading #P"/usr/lib/gcl-2.7.0/clcs/sys-proclaim.lisp" ;; Loading #P"/usr/lib/gcl-2.7.0/gcl-tk/tk-package.lsp" Error: Fast links are on: do (si::use-fast-links nil) for debugging Signalled by LOAD. Condition in LOAD [or a callee]: INTERNAL-SIMPLE-FILE-ERROR: File error on #P"/usr/lib/gcl-2.7.0/gcl-tk/tk-package.lsp": File does not exist. Broken at LOAD. Type :H for Help. 1 Return to top level. =============================================== So here "tk-package.lsp" is required by GCL even if it is not used by FriCAS as far as I know. So, what about adding gcl27-tk as a "Suggests" in the Debian package, or maybe better as "Recommended"? Or even better, is "tk-package.lsp" really required here? Wouldn't it be possible to get rid of this to build a GCL image? So, I installed gcl27-tk, and the build process went further, more precisely to the core of FriCAS, algebra files. There it shocks on something I did not understand I can not find the piece of code that generates the following error: ---------------------------------------------------------------------------------- doing stamp-db cp: './boo_db.input' et './boo_db.input' identify the same file Correctable error: Fast links are on: do (si::use-fast-links nil) for debugging Signalled by SETQ. If continued: Do (setq si::*path* "pathname") for path to use then :r to continue SIMPLE-ERROR: Environment variable FRICAS is not valid! Broken at SYSTEM::GCL-TOP-LEVEL. 1 (abort) Return to debug level 3. 2 Return to debug level 2. 3 Return to debug level 1. 4 (continue) Do (setq si::*path* "pathname") for path to use then :r to continue 5 Return to top level. BOOT>>>>>> Correctable error: Fast links are on: do (si::use-fast-links nil) for debugging Signalled by BLOCK. If continued: Do (setq si::*path* "pathname") for path to use then :r to continue Condition in BLOCK [or a callee]: INTERNAL-SIMPLE-READER-ERROR: Stream error on stream #<synonym stream to *TERMINAL-IO*>: Right paren found with no left. Broken at SYSTEM::GCL-TOP-LEVEL. 1 (abort) Return to debug level 4. 2 Return to debug level 3. 3 Return to debug level 2. 4 Return to debug level 1. 5 (continue) Do (setq si::*path* "pathname") for path to use then :r to continue ----------------------------------------------------------------------------------- etc. It does not seem related to FriCAS, but it was late this night, I stopped here, and will look deeper into this last issue later. I guess solving the two previous issues, and this one will allow to _build_ FriCAS. Regards, - Greg