robert-dodier / maxima-jupyter

A Maxima kernel for Jupyter, based on CL-Jupyter (Common Lisp kernel)
Other
185 stars 31 forks source link

Install instructions #111

Open jackdyson31 opened 2 years ago

jackdyson31 commented 2 years ago

Hello Robert, Thank you very much for writing this important plug-in, Unfortunately, the installation is really difficult to follow and I spent a lot of time learning to get to grips with it. I finally managed to install it on several platforms with ground up compiles of Maxima fro 5.43 to 5.46 and thought I might write up some improvements to the existing installation instructions which you might modify and include to make things easier for other prospective users.

Please let me know,

Regards, Jack.

robert-dodier commented 2 years ago

Hi Jack, thanks for your message, and sorry for the late reply. Yes, I would be interested to hear what you have figured out about installation, I know that's a common problem that users run into, and I know the existing instructions are pretty complex. If you have suggestions about how to clarify that, I would be very interested to hear.

best, Robert.

jackdyson31 commented 2 years ago

Hello Robert, thanks for getting back to me, absolutely no problem - I'll be glad to get you a description sorted for next week. I have managed to get it working on WSL2 Ubuntu 20.04 as well as Debian 10 native for three different Maxima versions. The way you have done the notebook is of fundamental importance imo given that Maxima (along with Octave) is now a pretty complete system for professional work - and I really think it ought to be (somehow) packaged on conda (like octave_engine) once CodeMirror has sorted the syntax highlighting. I am very grateful for all your work on Maxima, but in particular, this notebook means that I can use the system as a distributed research tool now.

best for now, Jack

jackdyson31 commented 2 years ago

Hello Robert,

I wrote up some of the missing or hidden details I had to find out and I will paste that separately in the message immediately below this one. Just give me an idea if it is clear enough or perhaps if it needs some more work. I leave to you where exactly to insert the points in the original instructions on the main page.

Just very quickly if I may:

1) is there a way of centering the maxima graphical svg output image on the notebooks ?

I have seen that you can tinker with jupyter's css file but it didn't work. For normal image import into the notebook you can center them like this in a markdown cell :

 <div style="text-align:center">
    <img src="image-folder/image.png" width=640>
 </div>

This might be a useful example to include anyway in your images example ipynb on the online reader.

2) How did you get the code highlights working on the online examples ?

I downloaded and installed npm and the packages from codemirror - I can also follow the little html example but beyond that I don't know what to do for the actual notebooks being served on my machines here.

Ok, be glad if you could give me some pointers.

Kind regards (instructions in message below this one)

Jack

jackdyson31 commented 2 years ago

Installation Addendum for Maxima-Jupyter

Step insert 1: Rebuilding Maxima with SBCL

Rebuilding Maxima on Linux Debian 10 or Ubuntu 20.04 is relatively civilised. One needs a source copy of Maxima source that one can get from the GNU Maxima site. And then you would need to install SBCL for your particular Linux distribution.

To install SBCL one can refer to guides online but it should be as simple as doing:

sudo apt update sudo apt install sbcl

on a debian/ubuntu based system.

You also have to make sure you have the "automake" utilities as well the usual linux developmental system on board.

Given that that is all done, then we just extract the maxima source to some directory e.g.

tar -zxvf maxima.tar.gz

and:

cd maxima

Now in here usually maxima has been configured using some particular version of the native tools at the developer's end. We need to sort that out for our system. So in the maxima directory just do:

aclocal automake

which regenerates the ./configure file. Now if there were no errors do:

./configure

and this step regenerates the configuration for the make commands. MAKE CERTAIN ANY NATIVE MAXIMA IS UNINSTALLED/PURGED and then next we have:

make sudo make install

which will compile and install the maxima source for your particular version of SBCL.

Done.

Step insert 2: Installing QuickLisp under SBCL

The trickiest part of installing Maxima Jupyter on a Linux machine is the process of installing QucikLisp.

If that can be done it correctly the rest is just procedure.

To sort that step out it is vital to have a "clean" connection to the Quicklisp website here:

https://www.quicklisp.org/beta/#installation

Download the "quicklisp.lisp" file from here. They suggest two methods on the page, one is the "curl" command and the other the simple download. I'd recommend the second since this file HAS to get downloaded correctly and the connection is not always guaranteed in my experience especially if you are using firewalls, office networks, vpns or any other filter systems for your networking traffic.

If you can turn off any vpn and unecessary network wall (excluding firewalls) between you and the router. Keep it that way for the duration of the entire install.

So once "quicklisp.lisp" is say in your Downloads folder then all you need to do is change into that directory and assuming that your particular distribution SBCL version is already installed (see above) all you have to do now is start it up at the command prompt:

sbcl

The next steps are going to be a few LISP commands to download and setup the Quicklisp environment:

(load "/home//Downloads/quicklisp.lisp") (quicklisp−quickstart: install: path "/home//quicklisp/") (load "/home//quicklisp/setup.lisp") (ql: add−to−init−file)

during all this should you get any weird errors that it couldn't find this or that or time out etc - that's a flaky internet connection most likely. Make sure you have a simplistic and fast connection to the Quicklisp site and start again with this step (you can delete the "/home//quicklisp" distro directory if you have to).

Assuming all that got done ok the next step is simple. Still in SBCL type:

(ql:update−client) (ql:update−dist "quicklisp")

and then that should complete and youi can ctrl-D out of SBCL. All these instructions can be found on page 224 from Roland Salz's excellent Maxima workbook:

https://roland-salz.de/Maxima_Workbook.pdf

Done.

Step insert 3: Installing load-maxima-jupyter.lisp

Once the steps above complete you should have a rebuilt version of Maxima (I recommend Maxima 5.44 for most systems) and a Quicklisp distro installed properly. The rest should be automatic.

Just start up Maxima in the directory where you extracted load-maxima-jupyter.lisp etc and type:

lisp: (load "load-maxima-jupyter.lisp")

and it will download any Quicklisp extras it needs. Then, I would do:

jupyter_install()

as opposed to:

jupyter_install_image()

because it doesn't always work (some issue with the LaTeX typography) with the newer Maxima builds.

So far with this approach I have Maxima 5.43, 5.44, 5.46 all running on WSL 2 Ubuntu 20.04 and Maxima 5.43, 5.44 on a standard Debian 10 system. The 5.46 version of Maxima has an issue compiling on it since it can't seem to find all the documentation nodes or whatever.

I hope these extra details will help people install the requirements easier and make the excellent maxima-jupyter plugin more popular.

jackdyson31 commented 2 years ago

Hi Robert,

any feedback on this ??

Regards

robert-dodier commented 2 years ago

Hi Jack, thanks for the reminder. I think I need to figure out how to incorporate the new text into the existing instructions. The whole picture is fairly complex so I feel like I need to be careful to make it as straightforward as possible under the circumstances. Thanks for your contribution, I appreciate it, and I will take the time soon to merge it in.

cameronraysmith commented 2 years ago

@jackdyson31 your instructions look very helpful. fwiw I have been using the installation procedure mentioned here for a couple of years with minimal issues.