Hello Ralf, *

Here is a proof of concept code to run jFriCAS, Jupyter addon to use
FriCAS using official FriCAS on a Debian based Linux:
See attachment for the patch but here is the code:

--- /home/greg/.local/lib/python3.12/site-packages/jfricas/fricaskernel.py
2024-12-25 17:12:11.140703375 +0100
+++ fricaskernel.py 2024-12-25 17:11:52.100711636 +0100
@@ -497,7 +497,7 @@
     # --------------------------------
     # Uncomment or edit as you like.
     # Default:
-    pid = Popen(['fricas','-eval',prereq,'-eval',start])
+    #pid = Popen(['fricas','-eval',prereq,'-eval',start])

     # Start the FriCAS process in a separate terminal.
     # That might be good for controlling FriCAS directly in case
@@ -507,6 +507,19 @@
     ## pid = Popen(['gnome-terminal', '--title=jfricas', '--'] +
     ##             ['fricas','-eval',prereq,'-eval',start])

+    # On Debian-based distributions start the Official FriCAS
+    # without opening the HyperDoc window.
+    # Require sbcl cl-asdf and cl-hunchentoot and SBCL_HOME needs
+    # to be defined.
+    # For example: export SBCL_HOME=/usr/lib/sbcl
+    # Load the Web server.
+    if os.path.isfile('/etc/debian_version'):
+        hunchentoot  = ')lisp (progn (load
"/usr/share/common-lisp/source/cl-asdf/asdf.lisp")'
+        hunchentoot += '(require :hunchentoot))'
+        pid = Popen(['fricas',
'-noht','-eval',hunchentoot,'-eval',prereq,'-eval',start])
+    else:
+        pid = Popen(['fricas','-noht','-eval',prereq,'-eval',start])
+
     # Start the FriCAS process without opening the HyperDoc window.
     ## pid = Popen(['fricas','-eval',prereq,'-eval',start] +
     ##             ['-noht])

Basically it loads the system asdf.lisp to bypass the one provided by
ECL, SBCL uses the system one if memory does not deserve me, and
installs at first run the necessary Common Lisp stuff to run the server in
~/.cache/common-lisp/ (that may take a while). It re-use them on the
next run. The required packages are cl-asdf and cl-hunchentoot. For
SBCL, SBCL_HOME needs to be defined and the sbcl .deb package installed.
SBCL uses its own implementation for several modules which are
installed in the SBCL_HOME/contrib directory. So if sbcl is installed,
in your terminal, 'export SBCL_HOME=/usr/lib/sbcl' before 'jupyter
notebook' should allow you to run jFriCAS with official FriCAS.

Ralf, it'a proof of concept, it should be adapted for other
distributions for example, and/or even commented out to give another
example if the user has built FriCAS using hsbcl.

Regards,

- Greg

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/fricas-devel/CAHnU2dbKEKdyKLqsBby0vNQUJhqX0hTHCXiNJxxif2Omg66YWA%40mail.gmail.com.

Attachment: fricaskernel.patch.gz
Description: application/gzip

Reply via email to