Mathematics tools

Problems installing STACK on Ubuntu Server

 
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Picture of David Black
Problems installing STACK on Ubuntu Server
 

I have been struggling for sometime trying to get STACK to run on a Ubuntu Server therefore I decided to start from a clean system and have re-installed Moodle and STACK but before proceeding any further I wanted to check what I was doing was heading in the correct direction.

The version of Ubuntu that I am using is 14.04 and I have installed Moodle 2.9+ ( everything is working at the Moodle level - big thanks to the people behind the documentation ). I have installed STACK using the Installation Instructions and the plugins installed without any problems. 

Currently I have Maxima 5.32.1 running on the server which was installed using "apt-get install maxima".  Maxima is working and I have generated and displayed plots ( gnuplot version 4.6 patchlevel 4 is installed ) outside of STACK.

My questions are as follows:

1 ) In the documentation it mentions that Maxima 5.25.1 to 5.31.3 are supported - do I need to install one of those version ? or will STACK run with 5.32.1 ?

2 ) Running the STACK healthcheck amongst the errors I get: "loadfile: failed to load /usr/share/maxima/5.32.1/share/draw/draw.lisp". I have loaded the file at the command line without any problems. Also, I have successfully loaded the files suggested in the STACK-Maxima, at the command line, and tested some of the STACK functions. Is it a file permissions problem that I am having ? - if so - any suggestions on how I can resolve.

Grateful for any help.

David


 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Problems installing STACK on Ubuntu Server
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers

The latest version of STACK in git will work with Maxima 5.32.1. However, I keep not getting time to release it to the plugins database. So, if you can install from https://github.com/maths/moodle-qtype_stack please do. If not, hopefully I will get the new version into the Plugins directory this week.

 
Average of ratings: -
Picture of David Black
Re: Problems installing STACK on Ubuntu Server
 

Hi Tim,

Thanks for answering my question.

I am new to Moodle and STACK and therefore I assumed that when I was following the Installation Instructions it would automatically pull in the latest version of STACK. I have checked the modules installed and they are:

STACK ( qtype_stack ) - 3.3.3

STACK Response Analysis ( quiz_stack ) - 3.3.1

Adaptive mode ( multi-part questions ) ( qbehaviour_adaptivemultipart ) - 3.3

Deferred feedback with CBM and explicit validation ( qbehaviour_dfcbmexplicitvaildate ) - 3.3

Deferred feedback with explicit validation ( qbehaviour_dfexplicitvaildate ) - 3.3

If they are incorrect then please can you point me in the direction of the instructions to load the latest plugins - thanks.

Kind regards,

David










 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Problems installing STACK on Ubuntu Server
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers

It all comes down to what you mean by "Latest version".

What really happens it that Chris, and a few other peole, work away at the code on github. So, the very latest code is aways there, but it is being changed, and we may accidentally break stuff from time to time.

Then, every so often, when we are fairly sure that nothing is broken, we take the latest version on github, call it a release, and put that snapshot into the plugins database.

So if you install from github, you have the very latest code, but there is a small risk. If you install from the plugins database, it is safer, but you may be a bit behind the latest developments.

As it happens, I found something broken yesterday, so I am glad I did not do a release last week. I will try to fix it today, then do the release.

 
Average of ratings: -
Picture of David Black
Re: Problems installing STACK on Ubuntu Server
 

Thanks for explaining the situation. 

As I mentioned before I am new to Moodle and therefore clarifying the difference between the official STACK plugin

and the development work on github has cleared up a lot of the confusion that I had.

I will wait for the next release of the STACK plugin.


 
Average of ratings: -
Picture of David Black
Re: Problems installing STACK on Ubuntu Server
 

Hi Tim,

Have you had a chance to fix the problem that you identified during our previous discussion ? 

If you have - when do you plan to release the next version of the plugin ?

Kind regards,

David


 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Problems installing STACK on Ubuntu Server
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers

Sorry, we keep finding different small niggly bugs, and therefore delay the release until they are fixed.

So, the release is still Real Soon Now™

Learning how to install the plugin from git has some advantages.

 
Average of ratings: -
Picture of David Black
Re: Problems installing STACK on Ubuntu Server
 

No problem.

I originally loaded STACK from git but ran into the Maxima problem discussed earlier in our correspondence. Therefore I was waiting for the latest plugin to make sure that the installation was correct before I dug deeper into the Maxima problem. I will try again installing from git.

 
Average of ratings: -
Picture of Adrian Lehrmann
Re: Problems installing STACK on Ubuntu Server
 

Hi David,

were you successful in connecting Moodle 2.9 / Stack 3.3 / Maxima 5.32.1?

I am asking since I ran into the same problems you did - apparently running a similar setup (Ubuntu 14.04.2 LTS) and thus relying on the same maxima-version which was installed by apt-get.

Could you confirm that the error was caused by a file permission problem?

@Tim Hunt: I installed stack via git (I followed the installation instructions posted on https://github.com/maths/moodle-qtype_stack/blob/master/doc/en/Installation/index.md and chose the 'clone from git'-option). Maxima itself is up and running and I am seeing the same output as David did: 

loadfile: failed to load /usr/share/maxima/5.32.1/share/draw/draw.lisp

I tested a clean install of moodle and put the moodledata-directory below the /var/www - folder (not recommended, I know) as well as outside the /var/www-folder. File permissions on maximalocal.mac are set for www-data/www-data and ugo=rw-.

I would be glad if you, David and Tim, or someone else could provide me with further ideas to get stack to connect to maxima.

Thank you in advance for your help!


 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Problems installing STACK on Ubuntu Server
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers

The file that is not being loaded is /usr/share/maxima/5.32.1/share/draw/draw.lisp. What are the permissions on that file?

If you have enough access to the server, you could test this by trying to run maxima as the Apache user:

sudo -u www-data maxima

Use that when following these instructions https://github.com/maths/moodle-qtype_stack/blob/master/doc/en/CAS/STACK-Maxima_sandbox.md, then should should be able to test running Maxima the same way that Moodle will, but it should be easier to see what is going on.

 
Average of ratings: -
Picture of David Black
Re: Problems installing STACK on Ubuntu Server
 

Tim and Adrian,

The file permissions for the draw.lisp on my server is : -rw-r--r--

Also, I loaded the maximalocal.mac file into maxima ( which I ran using: sudo -u www-data maxima ) and tested its operation with the suggestion described in the Sandbox information and it worked.

However the health check script is still throwing up the problem with the draw.lisp file.


 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Problems installing STACK on Ubuntu Server
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers

Sorry, that has me completely baffled!

Well, one other thought: are you using selinux? If yes, that might be blocking things.

 
Average of ratings: -
Picture of Adrian Lehrmann
Re: Problems installing STACK on Ubuntu Server
 

Hi Tim,

first of all, I want to thank you for your time and effort on helping desperate users like me!

The permissions on the draw.lisp-file were (in a last, desperate try) set to 777 for www-data - but without any effect. SELinux is not active on my server.

But while following your instructions and testing some of the topics from the sandbox-page, I observed the following:

1. When I start maxima as www-data (sudo -u www-data maxima), some process or function tries to access the /root-folder (as can be seen from the following snippet:

Maxima 5.32.1 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.10 (a.k.a. GCL)
[...]
(%i1) load("/var/www/moodledata/stack/maximalocal.mac");
/bin/mkdir: cannot create directory ‘/root’: Permission denied <---- Here!
Compiling /usr/share/maxima/5.32.1/share/draw/grcommon.lisp.
loadfile: failed to load /usr/share/maxima/5.32.1/share/draw/draw.lisp
 -- an error. To debug this try: debugmode(true);
(%i1)

2. When run as root (for the first time), loading the maximalocal.mac causes the compilation of several files (gnuplo.o, gnuplot.data, picture.o, pictrue.data and several more) in /root/.maxima/binary/binary-gcl/share/draw

3. When run as root after the initial compilation, those files are loaded / imported when loading the maximalocal.mac-file:

Maxima 5.32.1 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.10 (a.k.a. GCL)
[...]
(%i1) load ("/var/www/moodledata/stack/maximalocal.mac");
Loading /root/.maxima/binary/binary-gcl/share/draw/grcommon.o
start address -T 0x31877f0 Finished loading /root/.maxima/binary/binary-gcl/share/draw/grcommon.o
Loading /root/.maxima/binary/binary-gcl/share/draw/gnuplot.o
start address -T 0x319b330 Finished loading /root/.maxima/binary/binary-gcl/share/draw/gnuplot.o
Loading /root/.maxima/binary/binary-gcl/share/draw/vtk.o
start address -T 0x31d84f0 Finished loading /root/.maxima/binary/binary-gcl/share/draw/vtk.o
Loading /root/.maxima/binary/binary-gcl/share/draw/picture.o
start address -T 0x31fc390 Finished loading /root/.maxima/binary/binary-gcl/share/draw/picture.o
Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $
[ STACK-Maxima started, library version 2015060800 ]
(%o0) "/var/www/moodledata/stack/maximalocal.mac"
(%i1)

My guess would be that the maxima-process that runs with www-data somehow relies on those (compiled?) files. I think that the following steps happen when maxima is run with www-data rights

a) Check, whether the compiled files exist and are accessible
b) If not, create /root/.maxima/binary/binary-gcl/share/draw and compile those files into that folder.

Do you have any thoughts about this?

Thank you in advance again for your support

Adrian

 
Average of ratings: -
Picture of Adrian Lehrmann
Re: Problems installing STACK on Ubuntu Server
 
I just wanted to let you know that I "solved" the problem by bypassing the maxima 5.32.1 that is installed automatically by Ubuntu 14.04 LTS via apt-get.


I compiled maxima 5.36.0 from sourceforge-sources with sbcl enabled and all healtscript-problems vanished. I now have a functioning environment. So I attribute the problems to the exact configuration Ubuntu 14.04 - Stack 3.3 - Maxima 5.32.1...


So thank you again for your effort, have a nice day


Adrian

 
Average of ratings: Useful (2)
Picture of Fabrizio Mancini
Re: Problems installing STACK on Ubuntu Server
 
Same problem here. Could you please explain how to compile maxima 5.36.0 with sbcl?

Thanks Adrian!

Fabrizio

 
Average of ratings: -
Picture of Christopher Sangwin
Re: Problems installing STACK on Ubuntu Server
Group Particularly helpful MoodlersGroup Plugin developers

I've added minimal instructions here

https://github.com/maths/moodle-qtype_stack/blob/master/doc/en/Installation/Maxima.md

Please do read the Maxima docs for compiling....

I'm being a bit lazy here.  There is no need to install SBCL or Maxima system-wide if you are not root.  It just complicates things, and you will need to specify the complete path to the SBCL binary in the command 

./configure  --with-sbcl=....

Does this help?



 
Average of ratings: Useful (1)
Picture of Ruslan Kabalin
Re: Problems installing STACK on Ubuntu Server
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Might be useful for someone, we managed to make default version of Maxima in Debian Jessie (Maxima 5.34.1 and GCL 2.6.12) work without any issues, thus no need to compile anything or backport. You need optimised version of maxima bundle created using documentation, then it works smooth and there are no errors in health-check.

Step-by step guide for you, courtesy of Lancaster University CIS:

1. In Moodle STACK configuration set "Platform type" to "Linux" (not optimised) and "Maxima command" to empty value. Run the health-check script. It may contain errors which could be ignored, scroll to "Debug info" > "Context use", it should contain something similar to:

Platform: unix-optimised
Maxima shell command: maxima
Maxima initial command: load("/srv/data/moodle/stack/maximalocal.mac");


Maxima timeout: 10

The Maxima initial command above is the one we need to produce optimised version.

2. Login to one of the web-servers, become root. Check what maxima version we have and what the LISP implementation is in use:

root@moodle:~# maxima --list-avail
Available versions:
version 5.34.1, lisp gcl

gcl is the default implementation in Debian, and we will use it. Thus, the portion of maxima optimising documentation we need is GCL.

3. Run maxima and load /srv/data/moodle/stack/maximalocal.mac using command in step 1 above:

root@moodle:~# maxima
Maxima 5.34.1 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12 (a.k.a. GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) load("/srv/data/moodle/stack/maximalocal.mac");

It should output something similar to:

Compiling /usr/share/maxima/5.34.1/share/draw/grcommon.lisp.
End of Pass 1.  
End of Pass 2.  
OPTIMIZE levels: Safety=2, Space=3, Speed=3
Finished compiling /root/.maxima/binary/binary-gcl/share/draw/grcommon.o.
Loading /root/.maxima/binary/binary-gcl/share/draw/grcommon.o
start address -T 0x25e31a0 Finished loading /root/.maxima/binary/binary-gcl/share/draw/grcommon.o
Compiling /usr/share/maxima/5.34.1/share/draw/gnuplot.lisp.
End of Pass 1.  

;; Note: Tail-recursive call of BIPART was replaced by iteration.
;; Note: Tail-recursive call of BIPART was replaced by iteration.
End of Pass 2.  
OPTIMIZE levels: Safety=2, Space=3, Speed=3
Finished compiling /root/.maxima/binary/binary-gcl/share/draw/gnuplot.o.
Loading /root/.maxima/binary/binary-gcl/share/draw/gnuplot.o
start address -T 0x25faf00 Finished loading /root/.maxima/binary/binary-gcl/share/draw/gnuplot.o
Compiling /usr/share/maxima/5.34.1/share/draw/vtk.lisp.
End of Pass 1.  
End of Pass 2.  
OPTIMIZE levels: Safety=2, Space=3, Speed=3
Finished compiling /root/.maxima/binary/binary-gcl/share/draw/vtk.o.
Loading /root/.maxima/binary/binary-gcl/share/draw/vtk.o
start address -T 0x263de70 Finished loading /root/.maxima/binary/binary-gcl/share/draw/vtk.o
Compiling /usr/share/maxima/5.34.1/share/draw/picture.lisp.
End of Pass 1.  
End of Pass 2.  
OPTIMIZE levels: Safety=2, Space=3, Speed=3
Finished compiling /root/.maxima/binary/binary-gcl/share/draw/picture.o.
Loading /root/.maxima/binary/binary-gcl/share/draw/picture.o
start address -T 0x26640b0 Finished loading /root/.maxima/binary/binary-gcl/share/draw/picture.o
Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $
[ STACK-Maxima started, library version 2015090900 ] 
(%o0) "/srv/data/moodle/stack/maximalocal.mac"

If you have already run the load command before and graphical libraries (/usr/share/maxima/5.34.1/share/draw/grcommon.lisp) have been compiled already, the output might be shorter:

(%i1) load("/srv/data/moodle/stack/maximalocal.mac");

Loading /root/.maxima/binary/binary-gcl/share/draw/grcommon.o
start address -T 0x25e0ee0 Finished loading /root/.maxima/binary/binary-gcl/share/draw/grcommon.o
Loading /root/.maxima/binary/binary-gcl/share/draw/gnuplot.o
start address -T 0x25f8cd0 Finished loading /root/.maxima/binary/binary-gcl/share/draw/gnuplot.o
Loading /root/.maxima/binary/binary-gcl/share/draw/vtk.o
start address -T 0x263dcd0 Finished loading /root/.maxima/binary/binary-gcl/share/draw/vtk.o
Loading /root/.maxima/binary/binary-gcl/share/draw/picture.o
start address -T 0x2663f10 Finished loading /root/.maxima/binary/binary-gcl/share/draw/picture.o
Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $
[ STACK-Maxima started, library version 2015090900 ] 
(%o0) "/srv/data/moodle/stack/maximalocal.mac"

Notice, that compiling /usr/share/maxima/5.34.1/share/draw/grcommon.lisp require gcc to be installed in the system.

4. Without leaving maxima console, same optimised binary in Moodle data directory:

(%i1) :lisp (si::save-system "/srv/data/moodle/stack/maxima-optimised")

5. Now it is time to reconfigure Moodle. In Moodle STACK configuration set "Platform type" to "Linux (optimised)". Set "Maxima command" to:

timeout --kill-after=10s 10s /srv/data/moodle/stack/maxima-optimised -eval '(cl-user::run)'

The above format will make sure that command is never run for more than 10 seconds, thus will not cause performance issues. Save the configuration. Now run the health-check script, scroll down and press "Clear the cache". The loaded health check result should contain no errors. If you see some broken formula images, but health-check does not report errors, this has nothing to do with maxima or STACK, check TeX Notation filter settings, you most likely do not have texlive package installed on your system.

(sorry for styling issues, pasting it from internal wiki)

 
Average of ratings: Useful (1)
Tim at Lone Pine Koala Sanctuary
Re: Problems installing STACK on Ubuntu Server
Group Core developersGroup Documentation writersGroup Particularly helpful MoodlersGroup Plugin developers

Just to note that if you want a high performance install of STACK, https://github.com/maths/stack_util_maximapool/tree/multiple-pools is highly recommended. It also adds an extra layer of security. However, it is another thing to set up.

 
Average of ratings: -