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
-
7
1
.. HIGHLIGHT :: shell-session
8
2
9
3
.. _sec-installation-from-sources :
10
4
11
5
Install from Source Code
12
6
========================
13
7
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.
24
12
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.
28
16
29
17
See the file `README.md <https://github.com/sagemath/sage/#readme >`_
30
18
in ``SAGE_ROOT `` for information on supported platforms and
31
19
step-by-step instructions.
32
20
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
+
35
25
36
26
.. _section-prereqs :
37
27
@@ -436,7 +426,6 @@ On other systems, check the documentation for your particular operating system.
436
426
.. _section_conda_compilers :
437
427
438
428
439
-
440
429
Notes on using conda
441
430
^^^^^^^^^^^^^^^^^^^^
442
431
@@ -457,70 +446,12 @@ If you don't want conda to be used by sage, deactivate conda (for the current sh
457
446
operating system, or its own compilers.
458
447
459
448
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
-
516
449
Tcl/Tk
517
450
^^^^^^
518
451
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.
524
455
525
456
On Linux systems, these are usually provided by the **tk ** and **tk-dev **
526
457
(or **tk-devel **) packages which can be installed using::
548
479
549
480
does not raise an :class: `ImportError `, then it worked.
550
481
551
- .. _build-from-source-step-by-step :
552
482
553
- Step-by-step installation procedure
554
- -----------------------------------
483
+ .. _build-from-source-step-by-step :
555
484
556
- General procedure
557
- ^^^^^^^^^^^^^^^^^
485
+ Installation steps
486
+ ------------------
558
487
559
488
#. Follow the procedure in the file `README.md <https://github.com/sagemath/sage/#readme >`_
560
489
in ``SAGE_ROOT ``.
@@ -936,23 +865,6 @@ Here are some of the more commonly used variables affecting the build process:
936
865
Python-level profiling is always available; This option enables
937
866
profiling in Cython modules.
938
867
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
-
956
868
- :envvar: `SAGE_BUILD_DIR ` - the default behavior is to build each spkg in a
957
869
subdirectory of :file: `$SAGE_ROOT/local/var/tmp/sage/build/ `; for
958
870
example, build version 7.27.0 of
@@ -1034,6 +946,66 @@ Here are some of the more commonly used variables affecting the build process:
1034
946
supports :envvar: `SAGE_SUDO `, into a root-owned installation
1035
947
hierarchy (:envvar: `SAGE_LOCAL `).
1036
948
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
+
1037
1009
Environment variables dealing with specific Sage packages:
1038
1010
1039
1011
- :envvar: `SAGE_MATPLOTLIB_GUI ` - if set to anything non-empty except ``no ``,
@@ -1045,14 +1017,14 @@ Environment variables dealing with specific Sage packages:
1045
1017
support (which is disabled by default). See the file
1046
1018
:file: `build/pkgs/pari/spkg-install ` for more information.
1047
1019
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
1049
1021
this can be time-consuming. If you set this variable to "yes", you
1050
1022
will also see this: ``WARNING: Tuning PARI/GP is unreliable. You may
1051
1023
find your build of PARI fails, or PARI/GP does not work properly
1052
1024
once built. We recommend to build this package with
1053
1025
SAGE_CHECK="yes". ``
1054
1026
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
1056
1028
argument to the ``$MAKE `` command when compiling PARI.
1057
1029
1058
1030
Some standard environment variables which are used by Sage:
@@ -1094,7 +1066,7 @@ Some standard environment variables which are used by Sage:
1094
1066
- :envvar: `OPENBLAS_CONFIGURE ` - adds additional configuration flags for
1095
1067
the OpenBLAS package that gets added to the make command. (see :trac: `23272 `)
1096
1068
1097
- Variables dealing with doctesting:
1069
+ Environment variables dealing with doctesting:
1098
1070
1099
1071
- :envvar: `SAGE_TIMEOUT ` - used for Sage's doctesting: the number of seconds
1100
1072
to allow a doctest before timing it out.
@@ -1105,7 +1077,7 @@ Variables dealing with doctesting:
1105
1077
``sage -t --long ``.
1106
1078
If this isn't set, the default is 1800 seconds (30 minutes).
1107
1079
1108
- - :envvar: `SAGE_TEST_GLOBAL_ITER `, :envvar: `SAGE_TEST_ITER `: these can
1080
+ - :envvar: `SAGE_TEST_GLOBAL_ITER `, :envvar: `SAGE_TEST_ITER ` - these can
1109
1081
be used instead of passing the flags ``--global-iterations `` and
1110
1082
``--file-iterations ``, respectively, to ``sage -t ``. Indeed, these
1111
1083
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.
1146
1118
***************************************************************************
1147
1119
1148
1120
1149
- Installation in a Multiuser Environment
1121
+ Installation in a multiuser environment
1150
1122
---------------------------------------
1151
1123
1152
1124
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.
1183
1155
$ sudo chown -R root SAGE_LOCAL
1184
1156
1185
1157
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