More familiarity with computers is required to build SAGE from source. If you do have all the tools, the process is relativley painless (but potentially time consuming), and has the advantage that you have the latest version of SAGE, and you can change absolutely any part of SAGE or the programs on which it depends and recompile.
wstein@gmail.com
if you desparately need to run
SAGE on Solarisq. (An issue with Solaris is that some components
get compiled 64-bit and others 32-bit.)
Assumptions: You have a computer with about 850 megabytes disk space free running Linux (32-bit or 64-bit), OS X, or Cygwin/Windows1with development tools. In particular, the following standard command-line development tools must be installed on your box:
gcc (with C++ support) lexx (or flex) make m4 perl ranlib tar yacc (or bison) -- relatively recent version.
m4
installed, for example, type
which m4
at a command line. If it gives an error (or
returns nothing), then it is not installed. Note that
bison
is the free version of yacc
, and
flex
is the free version of lexx
.
Note:
On Cygwin you must also install gnuplot
and clisp
(common lisp).
Note:
You must have the GNU version of make
installed.
For example, SAGE won't build on a FreeBSD install that doesn't
have the optional GNU version of make
installed as well
(and named make
).
Although some of SAGE is written in Python, you do not need Python pre-installed on your computer, since the SAGE installation includes everything you need. When the installation program is run, it will check that you have each of the above-listed prerequisites, and inform you of any that are missing.
perl
is required is that both the NTL
and PARI configuration scripts are written in perl.
After extracting the SAGE tarball, the subdirectory source contains the source distributions for everything on which SAGE depends. We emphasize that all of this software is included with SAGE , so you do not have to worry about trying to download and install any one of these packages (such as GAP, for example) yourself.
Installation from source is (potentially) very easy, because the distribution contains (essentially) everything on which SAGE depends.
http://modular.math.washington.edu/SAGE/dist/src/index.html
http://sage.scipy.org/sage/dist/src/
tar xvf sage-x.y.z.tar
sage-x.y.z
.
cd sage-x.y.z
README.txt
file there.
make
sage-x.y.z
directory.2 This command does the usual steps for each of
the packages, but puts all the results in the local build tree.
This can take close to an hour on some machines.
If successful, you will not see the word ERROR in the last
3-4 lines of output.
After you build SAGE, you may optionally copy or move the entire
build tree to /usr/local
. You might also copy the sage-*/sage
script to /usr/local/bin/
and edit ROOT="....."
at the top of that file.
./sage
$ sage ------------------------------------------------------------------- | SAGE Version 0.10.1, Build Date: 2005-12-20-2026 | | Distributed under the terms of the GNU General Public License | | For help type <object>?, <object>??, %magic, or help | ------------------------------------------------------------------- sage:
sage-forum@lists.sourceforge.net
.
Please include in your email the file install.log
. It would
also be helpful to include the type of operating system you have and
the version number (and date) of the copy of SAGE you are using.
(There are no formal requirements for bug reports - just send them;
we appreciate everything.)
After SAGE starts, try a command:
sage: 2 + 2 4
Try something more complicated, which uses the PARI C library:
sage: factor(2005) 5 * 401
Try something simple that uses the Gap, Singular, Maxima and GP/PARI interfaces:
sage: gap('2+2') 4 sage: gp('2+2') 4 sage: maxima('2+2') 4 sage: singular('2+2') 4 sage: pari('2+2') 4
gp
command creates an object in the GP interpreter, and the
pari
command creates an object directly in the PARI C-library.)
Try running Gap, Singular or GP from SAGE:
sage: gap_console() GAP4, Version: 4.4.6 of 02-Sep-2005, x86_64-unknown-linux-gnu-gcc gap> 2+2; 4 [ctrl-d]
sage: gp_console() ... [ctrl-d]
sage: singular_console() SINGULAR / Development A Computer Algebra System for Polynomial Computations / version 3-0-1 0< by: G.-M. Greuel, G. Pfister, H. Schoenemann \ October 2005 FB Mathematik der Universitaet, D-67653 Kaiserslautern \ // ** executing /usr/local/sage/sage-0.8.2/bin/LIB/.singularrc [ctrl-d] > Auf Wiedersehen. sage:
math
, Maple by calling maple
, et cetera. The easiest
way to change this name or perform other customizations is to create
a redirection script in $SAGE_ROOT/local/bin
. SAGE inserts
this directory at the front of your PATH, so your script may need to
use an absolute path to avoid calling itself; also, your script
should use $*
to pass along all of its arguments. For
example, a maple
script might look like:
#!/bin/sh /etc/maple10.2/maple.tty $*
<SAGE_ROOT>/sage
to a location in your PATH.
If you do this, make sure and edit the line with the ....
's
at the top of the sage
script.
sage
containing the lines
#!/bin/bash konsole -T "sage" -e <SAGE_ROOT>/sage
chmod a+x sage
) and
put in your path somewhere. (Note that you have to
change <SAGE_ROOT>
above!) You can also make a
KDE desktop icon with this as the command (under the Application
tab of the Properties of the icon, which you get my right
clicking the mouse on the icon).
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
sage
at a
shell prompt should start SAGE.
./sage -testall
.
This runs most examples in the source code and makes sure that they
run exactly as claimed. To test all examples, use
./sage -testall -optional -long
; this will run examples that
take a long time, and those that depend on optional packages and
software, e.g., Mathematica or Magma. Some (optional) examples will
likely fail because they assume that a database is installed.
spkg/build
contains intermediate
code that is used to build sage. Type make clean
to delete it
and a few other directories (e.g., spkg/archive
and devel/old
).
This is safe and will save you about 500MB disk space.
You may wish to type this periodically.
sage -optional
to see a list or visit
http://modular.math.washington.edu/sage/packages/optional/,
and sage -i <package name>
to automatically download
and install a given package.
Have fun! Discover some amazing conjectures!
This section addresses the question of how a system administrator can install a single copy of SAGE in a multi-user computer network.
This is a compilation of posts to the SAGE support list (in particular those of Luis Finotti).
sage-1.2.0.tar
) at, e.g., /usr/local/
and compile it as root.
Assuming you are in a root shell and the tarball is in your current
directory, type:
cp sage-1.2.0.tar /usr/local cd /usr/local tar xvf sage-1.2.0.tar cd sage-1.2.0/ make
Comment: It's better to build in place. It's a bug if anything goes wrong when relocating the entire tarball - unfortunately there is one bug I haven't fixed along these lines, namely the PARI install hard-codes the location of the "galois data" files. (Fixes welcome!)
sage
script. In other words, edit
SAGE_ROOT="....."
to say SAGE_ROOT="/usr/local/sage-1.2.0"
.
make test
as root to run all the
standard test code). You can stop the tests by pressing
ctrl-z
followed by typing kill %1
(assuming you
had no other jobs in the background of that shell).
sage
script in /usr/local/bin
:
cp /usr/local/sage-1.2.0/sage /usr/local/bin/
sage -upgrade
) overwrites
/usr/local/sage-1.2.0/sage
, hence deleting the
ROOT=...
part of that file.
Make sure that all files in
/usr/local/sage-1.2.0
are readable by all:
chmod a+r -R /usr/local/sage-1.2.0
.ipythonrc
directory is created in your HOME
directory if it
doesn't exist.