Skip to main content
\(\newcommand{\Z}{\mathbb{Z}} \newcommand{\reals}{\mathbb{R}} \newcommand{\real}[1]{\mathbb{R}^{#1}} \newcommand{\fe}[2]{#1\mathopen{}\left(#2\right)\mathclose{}} \newcommand{\cinterval}[2]{\left[#1,#2\right]} \newcommand{\ointerval}[2]{\left(#1,#2\right)} \newcommand{\cointerval}[2]{\left[\left.#1,#2\right)\right.} \newcommand{\ocinterval}[2]{\left(\left.#1,#2\right]\right.} \newcommand{\point}[2]{\left(#1,#2\right)} \newcommand{\fd}[1]{#1'} \newcommand{\sd}[1]{#1''} \newcommand{\td}[1]{#1'''} \newcommand{\lz}[2]{\frac{d#1}{d#2}} \newcommand{\lzn}[3]{\frac{d^{#1}#2}{d#3^{#1}}} \newcommand{\lzo}[1]{\frac{d}{d#1}} \newcommand{\lzoo}[2]{{\frac{d}{d#1}}{\left(#2\right)}} \newcommand{\lzon}[2]{\frac{d^{#1}}{d#2^{#1}}} \newcommand{\lzoa}[3]{\left.{\frac{d#1}{d#2}}\right|_{#3}} \newcommand{\abs}[1]{\left|#1\right|} \newcommand{\sech}{\operatorname{sech}} \newcommand{\csch}{\operatorname{csch}} \newcommand \dd[1] { \,\textrm d{#1} } \newcommand \de[2] { \frac{\mathrm d{#1}}{\mathrm d{#2}} } \newcommand \intl[4]{ \int\limits_{#1}^{#2}{#3}\dd{#4} } \newcommand\at[2]{\left.#1\right|_{#2}} \newcommand{\lt}{ < } \newcommand{\gt}{ > } \newcommand{\amp}{ & } \)

Section1.2Running From Source

The SageMath source is hosted here SageMath GitHub. To download and build the source you will need the appropriate development environment set up. This is not detailed here and assumes some familiarity with git and make. Full details can be found here. At a minimum you will need a POSIX compliant shell with GCC, make, perl, and python.

Subsection1.2.1Building SageMath

Once you have a build environment setup then grab the source from the git repository. This may take a few minutes depending on your network speed.

--- ~/dev »git clone git://github.com/sagemath/sage.git
Cloning into 'sage'...
remote: Counting objects: 448266, done.
remote: Compressing objects: 100% (268/268), done.
remote: Total 448266 (delta 157), reused 0 (delta 0), pack-reused 447997
Receiving objects: 100% (448266/448266), 152.82 MiB | 11.21 MiB/s, done.
Resolving deltas: 100% (341065/341065), done.
--- ~/dev »cd sage
--- dev/sage ‹master› »git checkout develop
Branch develop set up to track remote branch develop from origin.
Switched to a new branch 'develop'
--- dev/sage ‹develop› »make
make build/make/Makefile
make[1]: Entering directory `/home/dev/sage'
make[1]: `build/make/Makefile' is up to date.
make[1]: Leaving directory `/home/dev/sage'
build/bin/sage-logger \
"cd build/make && ./install 'all'" logs/install.log
*** ALL ENVIRONMENT VARIABLES BEFORE BUILD: ***
...
<and so on, and so forth, for quite some time ...>
...
Testing that Sage starts...
[2016-12-01 14:31:59] SageMath version 7.5.beta4, Release Date: 2016-11-24
Forcing Sage-location, probably because a new package was installed.
Updating various hardcoded paths...
(Please wait at most a few minutes.)
DO NOT INTERRUPT THIS.
Done updating paths.
Yes, Sage starts.
make[2]: Leaving directory `/home/dev/sage/build/make'
make[1]: Leaving directory `/home/dev/sage/build/make'

real 29m58.528s
user 32m33.566s
sys 7m0.240s
Sage build/upgrade complete!

To install small scripts to directly run Sage's versions of GAP,
the PARI/GP interpreter, Maxima, or Singular etc. (by typing e.g.
just 'gap' or 'gp') into a standard 'bin' directory, start Sage
by typing 'sage' (or './sage') and enter something like

install_scripts('/usr/local/bin')

at the Sage command prompt ('sage:').

Subsection1.2.2Running SageMath Notebook from the command line

--- ~/dev »./sage --notebook
Figure1.2.1Starting Sage notebook from the command line.
Figure1.2.2The Notebook session at localhost:8080.

You can now start using this local session equivalently to SageMathCloud sessions with the benefit of gaining the full resources of your local machine and being able to work offline.

Subsection1.2.3Running SageMath From the command line

You can also run SageMath directly from the command line. You may want to do this for quick tests or as part of your development cycle.

Figure1.2.3A sample Sage command line session.