2 Installing SAGE

Installation from source is very easy, because the distribution contains everything on which SAGE depends. These have been tested on some common Linux systems such as Debian, SUSE, and Fedora, along with OS X and Windows (under Cygwin).

WARNING: Make sure there are no spaces in the directory name under which you build SAGE.

  1. Download the file sage-2005-<date>.tar from
      http://modular.fas.harvard.edu/manin/dist/src/index.html
    
    This tarfile contains the source code for SAGE and the source for all programs on which SAGE depends (including GMP 4.1, PARI 2.9, Python 2.4, etc.). Download it into a subdirectory of your home directory into which you want to install SAGE.

  2. Untar:
          tar xf sage-2005-<date>-src.tar
    

  3. This creates a directory sage-2005-<date>. If you want to change the name of this directory (say to sage_0.2_<date>) you must do it at this stage.

  4. Change into that directory
          cd sage-2005-<date>
    
    This is SAGE's home directory.

  5. Optional: Read the README.txt file there.

  6. Type
          make
    
    This compiles SAGE and all dependencies. On average this takes maybe 30 minutes, though it takes over an hour with Cygwin/Windows and just over five minutes on a 64-bit Linux dual-Opteron based machine. Note that you do not need to log in as root and this one command takes the place of the usual ./configure; make; su; make install. In fact, this command does the usual steps for each of the packages, but puts all the results in a local build tree.

    IMPORTANT NOTE: The directory where you built SAGE is now hardcoded into the sage script, so you should not move or delete that directory. This drawback will be fixed in a future release.

  7. To start SAGE, at a prompt in SAGE's home directory type:
          bin/sage
    
    You should see the SAGE prompt:
    >>>
    
    If this is not the display (e.g., if you get a big traceback), please report the problem to was@math.harvard.edu. Please include in your email the type of operating system you have and the version number of SAGE which you downloaded. Try a command:
    >>> factor(2005)
    [(5, 1), (401, 1)]
    

  8. Optional: You'll probably want to copy bin/sage to a location in your PATH. if you are using the bash shell, type echo $PATH and cp sage <your-path-dir> into one of these directories, or else add this bin directory to your PATH variable, e.g., if you use the bash shell, add the line
    PATH="<sage-home-dir>/bin":$PATH
    export PATH
    
    in your .bashrc file). After doing this, typing sage at any shell prompt will start SAGE.

  9. Optional: Test the install by typing make test. This runs all examples in the API documentation and makes sure that they run exactly as claimed. In a few cases there may be some discrepancies because, e.g., 64-bit machines print float numbers to higher precision than 32-bit.

  10. Optional: The directory install/build is created during the install, and can be safely removed:
       rm -rf install/build
    
    or type make clean.

  11. Optional: Install the SAGE databases, as explained in Section 3.

Have fun!

Note: The subdirectory called log contains the logfiles and conf contains the IPython configuration file used by SAGE. The logfiles log every command (not the output) you type in, and the history is persistent between sessions. There is also a file called log/verbose, which is where verbose logging goes when you use the set_verbose command in SAGE.

See About this document... for information on suggesting changes.