On Sun, Jul 03, 2022 at 03:43:23PM -0400, Bill Page wrote:
> On Sun, 3 Jul 2022 at 06:38, Qian Yun <[email protected]> wrote:
> >
> > I find the idea of pure lisp build of FriCAS very interesting and
> > useful. I did some improvement of Kurt's fricas0 at
> > https://github.com/oldk1331/fricas0
> >
> > The biggest advantage is that you can start FriCAS quickly and
> > do computation right away.
> > ...
>
> Clasp is a new implementation of Lisp based on LLVM similar to the way
> that ABCL is based on the Java VM.
>
> https://github.com/clasp-developers/clasp
>
> I was interested to see whether Clasp could run fricas0 since one of
> the selling points for Clasp is the ability to directly and easily
> link with c++ libraries. Apparently Clasp can run maxima. See
>
> https://github.com/clasp-developers/clasp/wiki/How-to-run-maxima-in-clasp
>
> Building Clasp from source is quite time consuming so I ran Clasp
> using the pre-compiled docker image:
> ----
> wspage@strix:~$ docker run -it ghcr.io/clasp-developers/clasp:latest
> To run a command as administrator (user "root"), use "sudo <command>".
> See "man sudo_root" for details.
>
> app@48e1623454d5:~$ git clone https://github.com/oldk1331/fricas0.git
> Cloning into 'fricas0'...
> remote: Enumerating objects: 5550, done.
> remote: Counting objects: 100% (1531/1531), done.
> remote: Compressing objects: 100% (926/926), done.
> remote: Total 5550 (delta 1024), reused 657 (delta 603), pack-reused 4019
> Receiving objects: 100% (5550/5550), 23.91 MiB | 1.83 MiB/s, done.
> Resolving deltas: 100% (4484/4484), done.
>
> app@48e1623454d5:~$ cd fricas0
>
> app@48e1623454d5:~/fricas0$ clasp --load fricas
> Starting cclasp-boehmprecise-1.0.0-313-gea5c624d9-cst ... loading image...
> Loading resource file /home/app/.clasprc
> ; caught STYLE-WARNING:
> ; The variable OPTIONS is defined but never used.
> ; at unknown location
> ;
> ;
> ; compilation unit finished
> ; caught 1 STYLE-WARNING condition
> ;
> ; caught STYLE-WARNING:
> ; The variable CORE-IMAGE is defined but never used.
> ; at unknown location
> ;
> ; caught STYLE-WARNING:
> ; The variable RESTART is defined but never used.
> ; at unknown location
> ;
> ;
> ; compilation unit finished
> ; caught 2 STYLE-WARNING conditions
> ;
> ; caught STYLE-WARNING:
> ; Undefined function EXIT-WITH-STATUS
> ; at unknown location
> ;
> ;
> ; compilation unit finished
> ; caught 1 STYLE-WARNING condition
> ;
> ; caught STYLE-WARNING:
> ; The variable VAR-NAME is defined but never used.
> ; at unknown location
> ;
> ;
> ; compilation unit finished
> ; caught 1 STYLE-WARNING condition
> ;
> ; caught STYLE-WARNING:
> ; The variable S is defined but never used.
> ; at unknown location
> ;
> ;
> ; compilation unit finished
> ; caught 1 STYLE-WARNING condition
> ;
> ; caught WARNING:
> ; Undefined variable |writeablep|
> ; at unknown location
> ;
> ; caught WARNING:
> ; Undefined variable INT
> ; at unknown location
> ;
> ; caught WARNING:
> ; Undefined variable C-STRING
> ; at unknown location
> ;
> ; caught STYLE-WARNING:
> ; Undefined function FILENAME
> ; at unknown location
> ;
> ; caught STYLE-WARNING:
> ; Undefined function FRICAS-FOREIGN-CALL
> ; at unknown location
> ;
> ;
> ; compilation unit finished
> ; caught 3 WARNING conditions
> ; caught 2 STYLE-WARNING conditions
> ;
>
> Condition of type: UNBOUND-VARIABLE
> The variable FRICAS-LISP:|writeablep| is unbound.
> No restarts available.
>
> Top level in: #<PROCESS TOP-LEVEL @0x7efdd244cf09 (Running)>.
>
> ----
>
> But the result is an error when FriCAS tries to call an external
> routine via FFI. I don't know much about this except that after a
> quick search of the FriCAS mailing list suggests that a apparently
> similar problem involving |writeablep was reported at one point with
> ECL The resolution of the problem had something to do with implicit
> declarations and external function calls.
>
> https://github.com/fricas/fricas/issues/59
>
> Does anyone have any suggestions on what to try?
FriCAS sources assume that quite early there is definition
of macro called 'fricas-foreign-call'. When code tries
to use undefined macro Lisp treats it as a function which
leads to weird error. 'writeablep' is first thing defined
using this macro...
You should be able to go far using fake definition like:
#+:poplog
(eval-when (:compile-toplevel :load-toplevel :execute)
(defmacro fricas-foreign-call (name c-name return-type &rest arguments)
nil)
)
Note: the above is for Poplog, replace 'poplog' above by
whatever string clasp uses for conditional compilation.
Note2: The snippet above is from 'fricas-lisp.lisp". You can
put clasp snippet just after Poplog snippet.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/20220703225023.GA26562%40fricas.math.uni.wroc.pl.