This page is mostly intended for those wishing to install GAP and Sage in Linux.

Installing Sage

There are many options for installing Sage. I'll assume you have some common Linux distribution such as Ubuntu. As is common in these distributions, any popular program will be available in the Ubuntu repositories. Thus, you could simply open your program manager and search for Sage, click "install" (or whatever) and be done with it. I don't recommend doing this if you're planning on using Sage seriously. Sage is under active development, is updated very frequently, and Ubuntu's repository version is a bit out-of-date.

This leaves two options. You can download the current release of Sage for your specific operating system + architecture or you can compile Sage yourself.


Downloading a Pre-Compiled Binary

This instruction set is current as of October 14, 2010.

  • Visit and click on the big download link, then select the appropriate location.
  • You should now have a 32-bit/64-bit/Itanium option. Select one of these. This reflects the specific architecture of your machine. Most computers these days are 64-bit capable, but may be running a 32-bit operating system for various reasons. In most systems, opening a terminal and typing "uname -m" will tell you which bit structure your OS has. E.g., "x86_64" is 64-bit and "i686" is 32-bit.
  • Download the file corresponding to your distribution and version. If you're using Ubuntu, make sure you select the version that is specific to your version of Ubuntu (i.e., 10.04 or 10.10.)
  • This may seem a bit strange for new Linux users, but the terminal is by far the easiest and fastest way to continue, so I'll walk though that process and copy/paste my commands as I go. Open a terminal.
  • I use Debian-based Linux distributions (such as Ubuntu), which tend to have a "/opt" directory. This is where I personally install Sage (among other things). You're free to install wherever you like, but this is what I would do.
  • Move your sage download to the /opt directory. If you've saved your sage download to your home directory, then something like the following will do the trick, assuming that you are currently in your home directory.
    hilljb@tarski:~$ sudo cp sage* /opt
  • Move to the /opt directory:
    hilljb@tarski:~$ cd /opt
  • In order to do much in this /opt directory, you'll need super-user powers. Keeping that in mind, we'll unpack our download. This code may differ if you have a "lzma" or "tar.gz" file. Respectively:
    hilljb@tarski:/opt$ sudo tar --lzma -xvf sage-*
    hilljb@tarski:/opt$ sudo tar -zxvf sage-*
  • Change the owner of the entire Sage directory once it is unpacked.
    hilljb@tarski:/opt$ sudo chown -R your-user-name-here sage-*
  • You should now be capable of running sage: (change the version number accordingly)
    hilljb@tarski:/opt$ cd sage-4.5.3
    hilljb@tarski:/opt/sage-4.5.3$ ./sage
    | Sage Version 4.5.3, Release Date: 2010-09-04
    | Type notebook() for the GUI, and license() for information.

    Compiling Your Own Sage

    Instructions for this are included in the README.txt located at the download page for Sage sources. All of the dependencies for Ubuntu (e.g., gcc, g++, m4, perl, ranlib, etc.) are either already installed in Ubuntu or are in the Ubuntu repositories (so they essentially need to be turned on). If you're at CU-Boulder and have questions about this, feel free to either e-mail me or stop by my office (MATH340).

    Depending on your machine's capabilities, this can take a while. My server compiles Sage in about an hour, while my single-core laptop does it in about 7 hours.


    Installing Sage Combinat

    Sage Combinat is a collection of additions to Sage that are in testing phase and are focused around algebraic combinatorics. It is based on a Mercurial queue that modifies an existing collection of Sage libraries. For Sage Combinat to work, you will need an up-to-date version of Sage (otherwise, the libraries are too far out of date). So, either install a new version of Sage following the instructions above (do not install from the Ubuntu repositories), or update your sage:

    hilljb@tarski:/opt/sage-4.5.3$ ./sage -upgrade

    Then, issuing the following command will download the Sage Combinat queue and install it. This may take some time.

    hilljb@tarski:/opt/sage-4.5.3$ ./sage -combinat install

    After that is done, you can switch between Sage and Sage Combinat by rebuilding Sage with either the main Sage libraries or with the Combinat queue:

    hilljb@tarski:/opt/sage-4.5.3$ ./sage -b main
    hilljb@tarski:/opt/sage-4.5.3$ ./sage -b combinat

    One can update the Combinat queue (get the latest patches) by using the command

    hilljb@tarski:/opt/sage-4.5.3$ ./sage -combinat update


    Contributions to Sage

    My goal for this section, which I should probably move to another page when I have time, is to document my contributions to Sage. One of my goals is to help make Sage more usable for both deterministic and random methods in large domain permutation groups. To be brief, Sage and GAP view permutation actions differently, and much of my work here is in trying to bring those two views into alignment. The following are currently implemented in Sage Combinat for calculations in permutation groups.

  • Added "self.non_fixed_points()" to determine the support of a permutation action.
  • Added "self.fixed_points()" to determine the complement of the support of a permutation action with respect to Sage's larger assumed domain.
  • Rewrote "self.is_transitive()" to allow for optional domain input, mainly considering the support of the action. Previously, Sage would always consider the group generated by (2,3) to be intransitive, since Sage considers the domain to be [1,2,3].
  • Rewrote "self.is_primitive()" to also allow optional domain input. Previously, this method really didn't make sense, since (2,3) would be considered as imprimitive by Sage but there is no corresponding block system satisfying the rules given in existing literature.
  • Added "self.is_semi_regular()" with optional domain input.
  • Added "self.is_regular()" with optional domain input.
  • Added "self.socle()" to calculate the socle of a permutation group.
  • Added "self.frattini_subgroup()" to calculate the frattini subgroup of a permutation group.
  • Added "self.fitting_subgroup()" to calculate the fitting subgroup of a permutation group.
  • Added "self.solvable_radical()" to calculate the solvable radical of a permutation group.
  • Rewrote "self.base()" to calculate an actual base.
  • Added "self.is_base()" to determine if a subset of the domain is a base.
  • I've also been working on some shell scripting for Sage installations, mainly to determine OS/hardware information upon installation failure.

    © 2011 Jason B. Hill. All Rights Reserved.