Sage Math on the Raspberry Pi


13 posts
by ArchimedesPi » Mon Jun 10, 2013 4:12 pm
I realized that the Raspberry Pi could be an inexpensive tool for teaching mathematics in schools in developing countries, or in schools that have low technology budgets.
There are a lot of open source math programs, but only a few have a Computer Algebra System.
An interesting program is Sage Mathematics, which is actually glue code between other math software.
Sage has many good features:
  • Interactive learning
  • Web interface/server
  • Graphing (2D and 3D)
  • Algebra, Calculus, and up...
  • Web interface has multiple accounts, and is easy to administrate.
When I went to the Sage Math website, they distributed Sage as prebuilt binaries, and there was no armv6l hardfp binary.
They have instructions on the Sage Math website for building from source, so I tried it with the current release, Sage 5.8.
It was not easy to compile, and took a lot of time, so I am distributing a binary tarball so people do not have to build it themselves.
I have not run the doctests yet, but plan to, and will post the results when done.
Chromium is the best browser for using the web interface, because it is fast and supports Javascript.
There are links to the binaries at http://github.com/ArchimedesPi/SageMathematics-raspi/

I *just* finished building/packaging/uploading Sage 6.0, it's great, I have it on the previously mentioned page.
So I've build Sage [5.8, 6.0] currently,
*IF YOU WANT TO BUILD SAGE, CHECK THE WIKI!*
Last edited by ArchimedesPi on Mon Jan 20, 2014 1:45 am, edited 5 times in total.
Posts: 10
Joined: Fri Jun 07, 2013 1:14 am
Location: Somewhere (over the rainbow)
by Jezmo » Mon Jun 10, 2013 4:45 pm
A much nicer package which is very powerful, but free and open source is geogebra, is comes as either a stand alone application or as a HTML5 app
http://www.geogebra.org/cms/en/ I use it for work as a replacement for mathcad.
Posts: 34
Joined: Tue Jun 04, 2013 1:08 pm
by alecthegeek » Thu Nov 21, 2013 8:20 pm
ArchimedesPi wrote:It was not easy to compile, and took a lot of time, so I am distributing a binary tarball so people do not have to build it themselves.

I have not run the doctests yet, but plan to, and will post the results when done.


Do you have any updates on your progress please?
Posts: 37
Joined: Mon Aug 08, 2011 3:11 am
Location: Melbourne, Australia
by ArchimedesPi » Fri Nov 22, 2013 11:45 pm
alecthegeek wrote:
ArchimedesPi wrote:It was not easy to compile, and took a lot of time, so I am distributing a binary tarball so people do not have to build it themselves.

I have not run the doctests yet, but plan to, and will post the results when done.


Do you have any updates on your progress please?


Yep, I do.
I'm still working on the project, but haven't compiled an updated, patched version *yet*.
But I do still have the sources, so I'll work on that.
And I've moved my hosting to Dropbox, but the Github repo is still used for issues and instructions.
I'm glad that people are still interested! :D

~ArchimedesPi
Posts: 10
Joined: Fri Jun 07, 2013 1:14 am
Location: Somewhere (over the rainbow)
by DougieLawson » Fri Nov 22, 2013 11:51 pm
Why not use Mathematica? It arrived this week as a free download and can be used for educational purposes.
Hacker on ZX80 and Microtan65
Unemployed mainframe database specialist.
Linux hacker since 1995.
RPi owner since 2012.
Twitter: @DougieLawson

Gaffer tape is "The Force", it has a dark side and a light side and it holds the Universe together.
User avatar
Posts: 5884
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
by ArchimedesPi » Sat Nov 23, 2013 12:11 am
DougieLawson wrote:Why not use Mathematica?


The comments on the post about Mathematica are full of requests for FOSS math software.
It might not be faster, but tons of people want FOSS.
Sage Math can interface with Mathematica so you might be able to use a bit of both - it can use it as a computational engine. :lol:

~ArchimedesPi
Posts: 10
Joined: Fri Jun 07, 2013 1:14 am
Location: Somewhere (over the rainbow)
by ArchimedesPi » Wed Nov 27, 2013 3:00 am
I'm wondering if anyone wants a recompile with an updated version?
The current version I compiled is Sage 5.8, Sage's up to 5.12 now.
And they redid their build system.
So, just wondering. :)

~ArchimedesPi
Posts: 10
Joined: Fri Jun 07, 2013 1:14 am
Location: Somewhere (over the rainbow)
by DomasoFan » Tue Dec 10, 2013 6:28 am
ArchimedesPi wrote:I'm wondering if anyone wants a recompile with an updated version?
The current version I compiled is Sage 5.8, Sage's up to 5.12 now.
And they redid their build system.
So, just wondering. :)

~ArchimedesPi


Sure. Updated versions are always good to have :).
By the way maybe its easier now to compile?
Can you maybe post instructions?

It also might be interesting for the Sage devs to know that their software runs on raspberry pis as well so that they might offer precompiled binaries themselves.

greetings,
Simon
Posts: 3
Joined: Wed Oct 10, 2012 7:38 pm
by sdenton4 » Wed Dec 11, 2013 7:00 am
Hey, I built Sage on the Pi about a year ago! I posted a description of the process here:
http://inventingsituations.net/2013/01/17/pisage/

Why do this?

As mentioned above, Sage is FOSS. Except for in graphics, it's actually better than Mathematica at many, many things. It's a bit less user-friendly than Mathematica, but it's all coded in Python, which is cool and goes well with learning Python on the Pi more generally....

It would be cool to go back and build the new version. The big problem when I was compiling was an extremely resource-hungry package which has since reformed itself, and should be able to build easily in 256mb of memory. There was also a small fix to make for Tachyon; this was the only thing keeping it from being able to compile out of the box. I should try this again some time and post a patch as needed. (BTW: Compiling on the Pi took about seven days when I did this last year, and it might be down to four or so now? So it's definitely cool to have binaries...)
Posts: 7
Joined: Wed Dec 11, 2013 6:53 am
by kdilks » Wed Jan 08, 2014 5:41 am
Sage download site now offers binaries for armv6l and armv7l (though for 5.13, not 6.0). I've been chugging along trying to compile 6.0 on my Pi, but if something goes wrong (again), I'll give the binary a shot.
Posts: 1
Joined: Mon Dec 16, 2013 8:23 am
by ArchimedesPi » Wed Jan 08, 2014 5:04 pm
kdilks wrote:Sage download site now offers binaries for armv6l and armv7l (though for 5.13, not 6.0).


Yes, the Washington University mirror does have binaries for armv6l - but it doesn't say that they're hard-float. Sage would be *excruciatingly* slow in soft-float - It *really* needs an FPU.

kdilks wrote:I've been chugging along trying to compile 6.0 on my Pi, but if something goes wrong (again), I'll give the binary a shot.


I'm about to release a fully hard-float Sage 6.0 for the Raspberry Pi - Compiled using the newest Raspbian.
What I was thinking might help Sage (at least on the Pi) is using Collabora/the Foundation's new Web web browser.
That would render pages on the GPU, leaving the CPU (mostly) to Sage.
Posts: 10
Joined: Fri Jun 07, 2013 1:14 am
Location: Somewhere (over the rainbow)
by ArchimedesPi » Thu Jan 09, 2014 3:04 am
Progress report:

Since I'm currently compiling Sage 6.0, I just wanted to let the community know that:
libm4ri(e) has finished! It took only a few hours - the libraries linked into everything *flawlessly*.
Does anyone know why libm4rie compiled so fast?
Posts: 10
Joined: Fri Jun 07, 2013 1:14 am
Location: Somewhere (over the rainbow)
by ArchimedesPi » Mon Jan 20, 2014 1:49 am
Finished building Sage 6.0, check the first post for link!
I'm pretty excited about what we can do with the new Web Web browser,
I've tried it, but it still seems pretty *buggy*... :roll:

> ArchimedesPi
Posts: 10
Joined: Fri Jun 07, 2013 1:14 am
Location: Somewhere (over the rainbow)