Skip to content

Commit 747f3c5

Browse files
committed
Edit installation doc
1 parent 7102fe0 commit 747f3c5

File tree

2 files changed

+142
-118
lines changed

2 files changed

+142
-118
lines changed

src/doc/en/installation/index.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,18 @@ Linux
127127
In the cloud
128128
============
129129

130-
- `CoCalc <https://cocalc.com/>`_: an online service that provides SageMath and
130+
- `Sage Binder repo <https://github.com/sagemath/sage-binder-env>`_ provides a
131+
Binder badge to launch JupyterLab computing environment with Sage.
132+
133+
- `Sage Cell Server <https://sagecell.sagemath.org/>`_ is a free online service for
134+
quick computations with Sage.
135+
136+
- `CoCalc <https://cocalc.com/>`_ is an online commercial service that provides Sage and
131137
many other tools.
132138

133-
- On any system that allows you to bring your own Docker images to run
134-
in a container: Use the `Docker image sagemathinc/cocalc
135-
<https://hub.docker.com/r/sagemathinc/cocalc>`_ or :trac:`another Docker
136-
image providing SageMath <wiki/Distribution#Dockerimages>`.
139+
- `Docker image sagemathinc/cocalc
140+
<https://hub.docker.com/r/sagemathinc/cocalc>`_ can be used on any system with Docker to run CoCalc locally.
137141

138-
- `Sage Cell Server <https://sagecell.sagemath.org/>`_: an online service for
139-
elementary SageMath computations.
140142

141143

142144
More information:

src/doc/en/installation/source.rst

Lines changed: 133 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,27 @@
1-
.. comment:
2-
***************************************************************************
3-
If you alter this document, please change the last line:
4-
**This page was last updated in MONTH YEAR (Sage X.Y).**
5-
***************************************************************************
6-
71
.. HIGHLIGHT:: shell-session
82

93
.. _sec-installation-from-sources:
104

115
Install from Source Code
126
========================
137

14-
.. contents:: Table of contents
15-
:depth: 2
16-
:class: this-will-duplicate-information-and-it-is-still-useful-here
17-
18-
Some familiarity with the use of the Unix command line may be required to
19-
build Sage from the :wikipedia:`source code <Source_code>`.
20-
21-
Building Sage from the source code has the major advantage that your install
22-
will be optimized for your particular computer and should therefore offer
23-
better performance and compatibility than a binary install.
8+
Building Sage from the :wikipedia:`source code <Source_code>` has the major
9+
advantage that your install will be optimized for your particular computer and
10+
should therefore offer better performance and compatibility than a binary
11+
install.
2412

25-
Moreover, it offers you full development capabilities:
26-
you can change absolutely any part of Sage or the programs on which it depends,
27-
and recompile the modified parts.
13+
Moreover, it offers you full development capabilities: you can change
14+
absolutely any part of Sage or the packages on which it depends, and recompile
15+
the modified parts.
2816

2917
See the file `README.md <https://github.com/sagemath/sage/#readme>`_
3018
in ``SAGE_ROOT`` for information on supported platforms and
3119
step-by-step instructions.
3220

33-
The following sections provide some additional details. Most users
34-
will not need to read them.
21+
The following sections provide some additional details. Most users will not
22+
need to read them. Some familiarity with the use of the Unix command line may
23+
be required to build Sage from the source code.
24+
3525

3626
.. _section-prereqs:
3727

@@ -436,7 +426,6 @@ On other systems, check the documentation for your particular operating system.
436426
.. _section_conda_compilers:
437427

438428

439-
440429
Notes on using conda
441430
^^^^^^^^^^^^^^^^^^^^
442431

@@ -457,70 +446,12 @@ If you don't want conda to be used by sage, deactivate conda (for the current sh
457446
operating system, or its own compilers.
458447

459448

460-
Additional software
461-
-------------------
462-
463-
Recommended programs
464-
^^^^^^^^^^^^^^^^^^^^
465-
466-
The following programs are recommended.
467-
They are not strictly required at build time or at run time,
468-
but provide additional capabilities:
469-
470-
- **dvipng**.
471-
- **ffmpeg**.
472-
- **ImageMagick**.
473-
- **LaTeX**: highly recommended.
474-
475-
It is highly recommended that you have
476-
:wikipedia:`LaTeX <LaTeX>`
477-
installed, but it is not required.
478-
The most popular packaging is `TeX Live <https://www.tug.org/texlive/>`_,
479-
which can be installed following the directions on their web site.
480-
On Linux systems you can alternatively install your distribution's
481-
texlive packages::
482-
483-
$ sudo apt-get install texlive # debian
484-
$ sudo yum install texlive # redhat
485-
486-
or similar commands. In addition to the base TeX Live install, you may
487-
need some optional TeX Live packages, for example
488-
country-specific babel packages for the localized Sage
489-
documentation.
490-
491-
If you don't have either ImageMagick or ffmpeg, you won't be able to
492-
view animations.
493-
ffmpeg can produce animations in more different formats than ImageMagick,
494-
and seems to be faster than ImageMagick when creating animated GIFs.
495-
Either ImageMagick or dvipng is used for displaying some LaTeX output in the
496-
Sage notebook.
497-
498-
On Debian/Ubuntu, the following system packages are recommended.
499-
500-
- ``texlive-generic-extra`` (to generate pdf documentation)
501-
502-
- ``texlive-xetex`` (to convert Jupyter notebooks to pdf)
503-
504-
- ``latexmk`` (to generate pdf documentation)
505-
506-
- ``pandoc`` (to convert Jupyter notebooks to pdf)
507-
508-
- ``dvipng`` (to render text with LaTeX in Matplotlib)
509-
510-
- ``default-jdk`` (to run the Jmol 3D viewer from the console and generate images for 3D plots in the documentation)
511-
512-
- ``ffmpeg`` (to produce animations)
513-
514-
- ``libavdevice-dev`` (to produce animations)
515-
516449
Tcl/Tk
517450
^^^^^^
518451

519-
If you want to use `Tcl/Tk <https://www.tcl.tk/>`_ libraries in Sage,
520-
you need to install the Tcl/Tk and its development headers before building
521-
Sage.
522-
Sage's Python will then automatically recognize your system's install of
523-
Tcl/Tk.
452+
If you want to use `Tcl/Tk <https://www.tcl.tk/>`_ libraries in Sage, you need
453+
to install the Tcl/Tk and its development headers before building Sage. Sage's
454+
Python will then automatically recognize your system's install of Tcl/Tk.
524455

525456
On Linux systems, these are usually provided by the **tk** and **tk-dev**
526457
(or **tk-devel**) packages which can be installed using::
@@ -548,13 +479,11 @@ If
548479
549480
does not raise an :class:`ImportError`, then it worked.
550481

551-
.. _build-from-source-step-by-step:
552482

553-
Step-by-step installation procedure
554-
-----------------------------------
483+
.. _build-from-source-step-by-step:
555484

556-
General procedure
557-
^^^^^^^^^^^^^^^^^
485+
Installation steps
486+
------------------
558487

559488
#. Follow the procedure in the file `README.md <https://github.com/sagemath/sage/#readme>`_
560489
in ``SAGE_ROOT``.
@@ -936,23 +865,6 @@ Here are some of the more commonly used variables affecting the build process:
936865
Python-level profiling is always available; This option enables
937866
profiling in Cython modules.
938867

939-
- :envvar:`SAGE_SPKG_INSTALL_DOCS` - if set to ``yes``, then install
940-
package-specific documentation to
941-
:file:`$SAGE_ROOT/local/share/doc/PACKAGE_NAME/` when an spkg is
942-
installed.
943-
This option may not be supported by all spkgs.
944-
Some spkgs might also assume that certain programs are available on the
945-
system (for example, ``latex`` or ``pdflatex``).
946-
947-
- :envvar:`SAGE_DOCBUILD_OPTS` - the value of this variable is passed as an
948-
argument to ``sage --docbuild all html`` or ``sage --docbuild all pdf`` when
949-
you run ``make``, ``make doc``, or ``make doc-pdf``.
950-
For example, you can add ``--no-plot`` to this variable to avoid building
951-
the graphics coming from the ``.. PLOT`` directive within the documentation,
952-
or you can add ``--include-tests-blocks`` to include all "TESTS" blocks in the
953-
reference manual. Run ``sage --docbuild help`` to see the full list
954-
of options.
955-
956868
- :envvar:`SAGE_BUILD_DIR` - the default behavior is to build each spkg in a
957869
subdirectory of :file:`$SAGE_ROOT/local/var/tmp/sage/build/`; for
958870
example, build version 7.27.0 of
@@ -1034,6 +946,66 @@ Here are some of the more commonly used variables affecting the build process:
1034946
supports :envvar:`SAGE_SUDO`, into a root-owned installation
1035947
hierarchy (:envvar:`SAGE_LOCAL`).
1036948

949+
Environment variables for documentation build:
950+
951+
- :envvar:`SAGE_DOCBUILD_OPTS` - the value of this variable is passed as an
952+
argument to ``sage --docbuild all html`` or ``sage --docbuild all pdf`` when
953+
you run ``make``, ``make doc``, or ``make doc-pdf``. For example, you can
954+
add ``--no-plot`` to this variable to avoid building the graphics coming from
955+
the ``.. PLOT`` directive within the documentation, or you can add
956+
``--include-tests-blocks`` to include all "TESTS" blocks in the reference
957+
manual. Run ``sage --docbuild help`` to see the full list of options.
958+
959+
- :envvar:`SAGE_SPKG_INSTALL_DOCS` - if set to ``yes``, then install
960+
package-specific documentation to
961+
:file:`$SAGE_ROOT/local/share/doc/PACKAGE_NAME/` when an spkg is installed.
962+
This option may not be supported by all spkgs. Some spkgs might also assume
963+
that certain programs are available on the system (for example, ``latex`` or
964+
``pdflatex``).
965+
966+
- :envvar:`SAGE_USE_CDNS` -- if set to ``yes``, then build the documentation
967+
using CDNs (Content Distribution Networks) for scripts necessary for HTML
968+
documentation, such as `MathJax <https://www.mathjax.org/>`_.
969+
970+
- :envvar:`SAGE_LIVE_DOC` -- if set to ``yes``, then build live Sage
971+
documentation. If the ``Make live`` button on any webpage of the live doc is
972+
clicked, every example code gets a `CodeMirror <https://codemirror.net>`_
973+
code cell runnable via `Thebe <https://thebe.readthedocs.io/en/stable/>`_.
974+
Thebe is responsible in sending the code to the Sage computing environment
975+
built by `Binder <https://mybinder.org/>`_ and showing the output result.
976+
The Sage computing environment can be specified to either a Binder repo or a
977+
local Jupyter server. The environment variable :envvar:`SAGE_JUPYTER_SERVER`
978+
is used for this purpose.
979+
980+
:envvar:`SAGE_JUPYTER_SERVER` - set this to either ``binder``,
981+
``binder:repo`` with ``repo`` specifying a Binder repo or the URL to a local
982+
Jupyter server.
983+
984+
- ``binder`` refers to `Sage's official Binder repo
985+
<https://github.com/sagemath/sage-binder-env>`_. This is assumed if the
986+
environment variable :envvar:`SAGE_JUPYTER_SERVER` is not set.
987+
988+
- ``binder:repo`` specifies a Binder repo with ``repo``, which is a GitHub
989+
repository name, optionally added with a branch name with ``/`` separator.
990+
991+
- If a local Jupyter server is used, then set the URL to
992+
:envvar:`SAGE_JUPYTER_SERVER` and the secret token to environemt variable
993+
:envvar:`SAGE_JUPYTER_SERVER_TOKEN`, which can be left unset if the
994+
default token ``secret`` is used. For this case, run a local Jupyter
995+
server by
996+
997+
.. CODE-BLOCK:: bash
998+
999+
./sage --notebook=jupyterlab \
1000+
--ServerApp.token='secret' \
1001+
--ServerApp.allow_origin='null' \
1002+
--ServerApp.disable_check_xsrf=true \
1003+
--ServerApp.port=8889 \
1004+
--ServerApp.open_browser=false
1005+
1006+
before opening the Sage documentation webpage.
1007+
1008+
10371009
Environment variables dealing with specific Sage packages:
10381010

10391011
- :envvar:`SAGE_MATPLOTLIB_GUI` - if set to anything non-empty except ``no``,
@@ -1045,14 +1017,14 @@ Environment variables dealing with specific Sage packages:
10451017
support (which is disabled by default). See the file
10461018
:file:`build/pkgs/pari/spkg-install` for more information.
10471019

1048-
- :envvar:`SAGE_TUNE_PARI`: If yes, enable PARI self-tuning. Note that
1020+
- :envvar:`SAGE_TUNE_PARI` - if yes, enable PARI self-tuning. Note that
10491021
this can be time-consuming. If you set this variable to "yes", you
10501022
will also see this: ``WARNING: Tuning PARI/GP is unreliable. You may
10511023
find your build of PARI fails, or PARI/GP does not work properly
10521024
once built. We recommend to build this package with
10531025
SAGE_CHECK="yes".``
10541026

1055-
- :envvar:`PARI_MAKEFLAGS`: The value of this variable is passed as an
1027+
- :envvar:`PARI_MAKEFLAGS` - The value of this variable is passed as an
10561028
argument to the ``$MAKE`` command when compiling PARI.
10571029

10581030
Some standard environment variables which are used by Sage:
@@ -1094,7 +1066,7 @@ Some standard environment variables which are used by Sage:
10941066
- :envvar:`OPENBLAS_CONFIGURE` - adds additional configuration flags for
10951067
the OpenBLAS package that gets added to the make command. (see :trac:`23272`)
10961068

1097-
Variables dealing with doctesting:
1069+
Environment variables dealing with doctesting:
10981070

10991071
- :envvar:`SAGE_TIMEOUT` - used for Sage's doctesting: the number of seconds
11001072
to allow a doctest before timing it out.
@@ -1105,7 +1077,7 @@ Variables dealing with doctesting:
11051077
``sage -t --long``.
11061078
If this isn't set, the default is 1800 seconds (30 minutes).
11071079

1108-
- :envvar:`SAGE_TEST_GLOBAL_ITER`, :envvar:`SAGE_TEST_ITER`: these can
1080+
- :envvar:`SAGE_TEST_GLOBAL_ITER`, :envvar:`SAGE_TEST_ITER` - these can
11091081
be used instead of passing the flags ``--global-iterations`` and
11101082
``--file-iterations``, respectively, to ``sage -t``. Indeed, these
11111083
variables are only used if the flags are unset. Run ``sage -t -h``
@@ -1146,7 +1118,7 @@ see a list, execute ``sage.env.[TAB]`` while running Sage.
11461118
***************************************************************************
11471119
11481120
1149-
Installation in a Multiuser Environment
1121+
Installation in a multiuser environment
11501122
---------------------------------------
11511123

11521124
This section addresses the question of how a system administrator can install
@@ -1183,4 +1155,54 @@ a single copy of Sage in a multi-user computer network.
11831155
$ sudo chown -R root SAGE_LOCAL
11841156

11851157

1186-
**This page was last updated in September 2022 (Sage 9.8).**
1158+
Additional software
1159+
-------------------
1160+
1161+
The following programs are not strictly required at build time or at run time,
1162+
but provide additional capabilities to Sage. We highly recommend a Sage user to
1163+
install them.
1164+
1165+
LaTeX
1166+
^^^^^
1167+
1168+
It is highly recommended that you have :wikipedia:`LaTeX <LaTeX>` installed,
1169+
but it is not required. The most popular packaging is `TeX Live
1170+
<https://www.tug.org/texlive/>`_, which can be installed following the
1171+
directions on their web site. On Linux systems you can alternatively install
1172+
your distribution's texlive packages::
1173+
1174+
$ sudo apt-get install texlive # debian
1175+
$ sudo yum install texlive # redhat
1176+
1177+
or similar commands. In addition to the base TeX Live install, you may
1178+
need some optional TeX Live packages, for example
1179+
country-specific Babel packages for the localized Sage
1180+
documentation.
1181+
1182+
Additionally, the following system packages are recommended on Debian/Ubuntu:
1183+
1184+
- ``texlive-generic-extra`` (to generate pdf documentation)
1185+
1186+
- ``texlive-xetex`` (to convert Jupyter notebooks to pdf)
1187+
1188+
- ``latexmk`` (to generate pdf documentation)
1189+
1190+
- ``dvipng`` (to render text with LaTeX in Matplotlib)
1191+
1192+
pandoc
1193+
^^^^^^
1194+
1195+
This is useful to convert Jupyter notebooks to pdf.
1196+
1197+
ffmpeg, ImageMagick
1198+
^^^^^^^^^^^^^^^^^^^
1199+
1200+
If you don't have either ImageMagick or ffmpeg, you won't be able to view
1201+
animations. ffmpeg can produce animations in more different formats than
1202+
ImageMagick, and seems to be faster than ImageMagick when creating animated
1203+
GIFs.
1204+
1205+
``libavdevice-dev`` is a component of ffmpeg to produce animations, and
1206+
recommended to install on Debian/Ubuntu.
1207+
1208+

0 commit comments

Comments
 (0)