Copy of the official repository of the FriCAS computer algebra system embedding a Julia interface
⚠️ WARNING: This extension to FriCAS is under active development! ⚠️
FriCAS is a general purpose computer algebra system (CAS).
In this work-in-progress repository, a C wrapper using libjulia is embedded in FriCAS to support some Julia specialized operations (for example, hardware architecture optimized BLAS and LAPACK libraries). The build process supports Clozure CL (x86-64) and SBCL (x86-64 and arm64). For SBCL, only Julia 1.10.0, Julia 1.11.* and higher are supported, see Caveats. It must not be considered production-ready. Support of general Julia object is now also supported. An overview of what is added to FriCAS is available here. For binary snapshots see here.
A MCP server is also available in jlFriCAS on Linux, supporting both SBCL and Clozure CL. Here is an example of a session.
The MCP server is also used by fricas-vscode (the Julia interface is not necessary nor the use of a LLM). As of now, Execute in REPL, and consorts in relation to REPL features are not supported on Clozure CL because of stream/thread concurrency issues, the hover/pane documentation is available though. The Yason Common Lisp library is necessary. For Clozure CL, install it with quicklisp for example. With SBCL on Debian based systems, sudo apt install cl-yason should do the trick, it will be used automatically through ASDF.
A general source of information can also be found in HTML format here. Take into account that this is absolutely not the official documentation even though it is highly based on the official FriCAS web site which can be built from the FriCAS source code (thanks to Ralf Hemmecke and Kurt Pagani for their amazing work).
Julia Plots and HyperDoc:
Beware, actually, on WSL you may need to export:
export QT_WAYLAND_SHELL_INTEGRATION=xdg-shell
in your shell first.
Julia Plots on Windows/cmd.exe:
Linear Algebra:
For general installation instructions see INSTALL. For general documentation consult https://fricas.github.io.
To build FriCAS with Julia support, the julia executable needs to be available in your PATH, and a simple ./configure --enable-julia && make && sudo make install should do the trick. We require Julia 1.10 or higher. Please see https://julialang.org/downloads/ for instructions on how to obtain Julia for your system. The required Julia packages are (see the Julia package manager or if you install them later using jlAddPackage restart jlFriCAS):
And optionnally:
--enable-mathlink at configure time)As of now with Clozure CL queues is also required. Use installed quicklisp with queues installed and at configure time use the --with-quicklisp option, see the quicklisp documentation for how to install it. Another possibility, easier, is to use roswell with added ccl-bin and queues. GitHub actions for Clozure CL can help you how to build jlFriCAS with Clozure CL.
If you want to visualize your data using Julia, small support is provided using Plots and eventually LaTeXStrings Julia packages.
If you want to use jFriCAS i.e. Jupyter support for FriCAS built with SBCL, make sure hunchentoot is installed. On a Debian like system you can add hunchentoot with sudo apt install cl-hunchentoot and issue, for example, ./configure --enable-gmp --enable-julia --enable-hunchentoot.
If you want to build and install the HTML documentation,
you need to install Sphinx. On a Debian like system, to add it, issue in a
terminal sudo apt install python3-sphinx.
After building jlFriCAS, and before the installation, issue in your terminal
make htmldoc. Note that the default html theme used is ‘groundwork’ which can be installed with
pip install groundwork-sphinx-theme. If you want to use the default theme used by Official FriCAS itself, edit src/doc/sphinx/source/conf.py and change the line
html_theme = 'groundwork' to html_theme = 'classic', it is included in Sphinx.
The basic goal of FriCAS is to create a free advanced world-class CAS. In 2007 FriCAS forked from Axiom. Currently the FriCAS algebra library is one of the largest and most advanced free general purpose computer algebra systems -- this gives a good foundation to build on. Additionally, the FriCAS algebra library is written in a high level strongly typed language (Spad), which allows natural expression of mathematical algorithms. This makes FriCAS easier to understand and extend.
FriCAS uses lightweight development methodology. Compared to Axiom, FriCAS is significantly restructured -- it is more portable and fixed several defects. FriCAS removed rather large unused parts (without removing functionality).
Current development goals:
Julia support for jlFriCAS built with SBCL is/was erratic, depending on the Julia version used and the loaded libraries used by Julia. The 1.10.0 version seems to have solved some issues related to memory management interactions with SBCL, but with Julia 1.10.1 and 1.10.2 some problems occur again. Note that with Julia 1.11.* and later, FriCAS seems to work fine again. More work needs to be done in this regard. So, if you use SBCL to build FriCAS, imperatively use a version of Julia that is known to be compatible. Additionnaly, if you use WS domains/packages through MathLink,
SBCL is known to crash if you start HyperDoc after loading WS domains/packages. If you need to use
HyperDoc, start it first with the system command )hd.