2 Installing SAGE

Installation from source is very easy, because the distribution contains everything on which SAGEdepends.

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

  1. Download the file sage-*-src.tar.gz from
      http://modular.fas.harvard.edu/SAGE/dist/src/index.html
    
    This tarfile contains the source code for SAGEand the source for all programs on which SAGEdepends. Download it into a subdirectory of your home directory into which you want to install SAGE.

  2. Extract:
          gunzip sage-*-src.tar.gz
          tar xf sage-*-src.tar
    
    or just tar zxvf sage-*-src.tar.gz on many systems.

  3. This creates a directory sage-*.

  4. Change into that directory
          cd sage-*
    
    This is SAGE's home directory.

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

  6. Type
          make
    
    This compiles SAGEand all dependencies. Note that you do not need to log in as root. This command does the usual steps for each of the packages, but puts all the results in the local build tree.

    Note: The directory where you built SAGEis now hardcoded into the sage script, so you should not move, delete, or rename that directory. Instead use make install as described below.

    After you build SAGE, you may optionally install the result to /usr/local using su; make install. If you do this, a directory /usr/local/sage/sage-version is created and the parts of SAGEthat you built are copied there. Also, the two files sage and sage-version are placed in /usr/local/bin/. If you install a future version of SAGE, the old version(s) will still be available via the command sage-version. To install to a different prefix than /usr/local/, modify the file source/prefix.

  7. To start SAGE, at a prompt in SAGE's home directory type:
          ./sage
    
    You should see the SAGEprompt:
    SAGE Version *....
    Copyright (C) 2005 William Stein <was@math.harvard.edu>
    Distributed under the terms of the GNU General Public License (GPL)
    
    sage:
    
    If this is not the display (e.g., if you get a big traceback), please report the problem. Please include in your email the type of operating system you have and the version number (and date) of the SAGEyou are using. Try a command:
    sage: factor(2005)
     _1 = 5 * 401
    

  8. Optional: You'll probably want to copy 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 and logging out and in again, typing sage at a shell prompt should 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 SAGEdatabases, 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.