Grégory Vanuxem
unread,Dec 25, 2024, 12:40:58 PM12/25/24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fricas...@googlegroups.com
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