First, download the source to some directory (here */usr/local/sage*) from one of the official repositories (here it’s at U. of Washington, just for an illustration). Move to the directory and then

```
$ wget -c http://boxen.math.washington.edu/sage/src/sage-4.6.tar
$ sudo aptitude install gcc g++ gfortran make m4 perl binutils tar
$ tar -xvf sage-4.6.tar
$ sudo mv sage-4.6 /usr/local
$ sudo ln -s /usr/local/sage-4.6 /usr/local/sage
$ cd /usr/local/sage-4.6
```

If you have a multiprocessor machine,

`$ export MAKE="make -j4"`

in which I used “4” because I have a quad core machine. Then

`$ make`

This is it.

#### Installing the Python package mpi4py

Go to the Sage installation directory, run Sage:

```
$ ./sage
...
sage: optional_packages()
...
sage: install_package('openmpi-XXX')
sage: install_package('mpi4py-YYY')
```

I need to change the versions XXX and YYY of Open MPI and mpi4py depending on the ones found in the list obtained by optional_package().

That’s it.

based on your post, decided to take the leap and try installing sage on a new linode with debian 6, as i wanted to move my sage development off of my laptop onto a vps. really appreciate you taking the time post this. I’m puzzled why, given how popular the OS is, there isn’t a standard sage binary for debian 6. thoughts?

Scott — What I read is that the way Sage is packaged (really a collection of various math libraries) makes it difficult to adapt to the Debian style of packaging. There have been attempts to make an apt package I think, but none have been successful I suppose.

(Just a note to anyone else that does this.) Above instructions worked fine for me, but on a linode VPS it took four hours to install, apparently the majority of which was the ATLAS tuning of the linear algebra package.

You can speed up the install dramatically by setting the SAGE_ATLAS_ARCH environment variable (e.g: SAGE_ATLAS_ARCH=Corei7,SSE3,SSE2,SSE1)

Quote: ‘You drastically reduce the total Sage compile time if you manually select a suitable architecture’ from http://www.sagemath.org/doc/installation/source.html#section-make

Jad — Thanks for the note. It sure helps to do this as compiling SAGE takes the longest time I’ve seen a program.