Skip to content

Commit 6fa97ea

Browse files
author
Release Manager
committed
gh-37309: README.md: Move all mentions of release tarballs to the installation guide <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> As proposed in https://groups.google.com/g/sage- devel/c/5kmxaw105lg/m/liCPKG4bAQAJ The README.md now starts with instructions to install git and then use `git clone`. - Also fixes #30201 <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #37309 Reported by: Matthias Köppe Reviewer(s): Dima Pasechnik, John H. Palmieri, Matthias Köppe
2 parents 31a08e0 + 3341cdb commit 6fa97ea

File tree

5 files changed

+118
-70
lines changed

5 files changed

+118
-70
lines changed

README.md

Lines changed: 70 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,8 @@ in the Installation Guide.
132132
- On personal computers, any subdirectory of your :envvar:`HOME`
133133
directory should do.
134134

135-
- For example, you could use `SAGE_ROOT=~/sage/sage-x.y`, which we
136-
will use as the running example below, where `x.y` is the
137-
current Sage version.
135+
- For example, you could use `SAGE_ROOT=~/sage/sage`, which we
136+
will use as the running example below.
138137

139138
- You need at least 10 GB of free disk space.
140139

@@ -152,52 +151,64 @@ in the Installation Guide.
152151
capitalization when changing into :envvar:`SAGE_ROOT` can lead to build
153152
errors for dependencies requiring exact capitalization in path names.
154153

155-
2. Download/unpack or clone the sources.
154+
2. Clone the sources with `git`:
156155

157-
- Go to https://www.sagemath.org/download-source.html, select a mirror,
158-
and download the file :file:`sage-x.y.tar.gz`.
156+
- To check that `git` is available, open a terminal and enter
157+
the following command at the shell prompt (`$`):
159158

160-
This compressed archive file contains the source code for Sage and
161-
the source for all programs on which Sage depends.
159+
$ git --version
160+
git version 2.42.0
162161

163-
- After downloading the source tarball `sage-x.y.tar.gz` into
164-
`~/sage/`:
162+
The exact version does not matter, but if this command gives an error,
163+
install `git` using your package manager, using one of these commands:
165164

166-
$ cd ~/sage/
167-
$ tar xf sage-x.y.tar.gz # adapt x.y; takes a while
165+
$ sudo pacman -S git # on Arch Linux
166+
$ sudo apt-get update && apt-get install git # on Debian/Ubuntu
167+
$ sudo yum install git # on Fedora/Redhat/CentOS
168+
$ sudo zypper install git # on openSUSE
169+
$ sudo xbps-install git # on Void Linux
168170

169-
This creates the subdirectory `sage-x.y`. Now change into it:
171+
- Create the directory where `SAGE_ROOT` should be established:
170172

171-
$ cd sage-x.y/ # adapt x.y
173+
$ mkdir -p ~/sage
174+
$ cd ~/sage
172175

173-
- [Git] Alternatively, and required for Sage development, clone the Sage
174-
git repository:
176+
- Clone the Sage git repository:
175177

176-
$ ORIG=https://github.com/sagemath/sage.git
177-
$ git clone -c core.symlinks=true --branch develop --tags $ORIG
178+
$ git clone -c core.symlinks=true --filter blob:none \
179+
--origin upstream --branch develop --tags \
180+
https://github.com/sagemath/sage.git
178181

179-
This will create the directory `sage`. (See the section
182+
This command obtains the most recent development release.
183+
Replace `--branch develop` by `--branch master` to select
184+
the most recent stable release instead.
185+
186+
This will create the subdirectory `~/sage/sage`. (See the section
180187
[Setting up git](https://doc.sagemath.org/html/en/developer/git_setup.html)
181188
and the following sections in the Sage Developer's Guide
182189
for more information.)
183190

184-
Change into it and pick the branch you need, typically
185-
the latest development branch:
191+
- Change into the created subdirectory:
186192

187193
$ cd sage
188-
$ git checkout develop
189194

190195
- [Windows] The Sage source tree contains symbolic links, and the
191196
build will not work if Windows line endings rather than UNIX
192197
line endings are used.
193198

194-
Therefore it is crucial that you unpack the source tree from the
195-
WSL `bash` using the WSL `tar` utility and not using other
196-
Windows tools (including mingw). Likewise, when using `git`, it
197-
is recommended (but not necessary) to use the WSL version of
198-
`git`.
199+
Therefore it is recommended (but not necessary) to use the
200+
WSL version of `git`.
201+
202+
3. Install system packages.
203+
204+
Either refer for this to the [section on installation from
205+
source](https://doc.sagemath.org/html/en/installation/source.html) in the
206+
Sage Installation Manual for compilations of system packages
207+
that you can install. When done, skip to step 7 (bootstrapping).
199208

200-
3. [Linux, WSL] Install the required minimal build prerequisites.
209+
Alternatively, follow the more fine-grained approach below.
210+
211+
4. [Linux, WSL] Install the required minimal build prerequisites:
201212

202213
- Compilers: `gcc`, `gfortran`, `g++` (GCC versions from 8.4.0 to 13.x
203214
and recent versions of Clang (LLVM) are supported).
@@ -206,12 +217,12 @@ in the Installation Guide.
206217
for a discussion of suitable compilers.
207218

208219
- Build tools: GNU `make`, GNU `m4`, `perl` (including
209-
``ExtUtils::MakeMaker``), `ranlib`, `git`, `tar`, `bc`.
220+
`ExtUtils::MakeMaker`), `ranlib`, `git`, `tar`, `bc`.
210221
See [build/pkgs/_prereq/SPKG.rst](build/pkgs/_prereq/SPKG.rst) for
211222
more details.
212223

213224
- Python 3.4 or later, or Python 2.7, a full installation including
214-
`urllib`; but ideally version 3.9.x, 3.10.x, or 3.11.x, which
225+
`urllib`; but ideally version 3.9.x, 3.10.x, 3.11.x, 3.12.x, which
215226
will avoid having to build Sage's own copy of Python 3.
216227
See [build/pkgs/python3/SPKG.rst](build/pkgs/python3/SPKG.rst)
217228
for more details.
@@ -230,22 +241,25 @@ in the Installation Guide.
230241
[void.txt](build/pkgs/_prereq/distros/void.txt), or visit
231242
https://doc.sagemath.org/html/en/reference/spkg/_prereq.html#spkg-prereq
232243

233-
4. [Git] If you plan to do Sage development or otherwise work with ticket branches
234-
and not only releases, install the bootstrapping prerequisites. See the
235-
files in the folder
244+
5. Optional: It is recommended that you have both LaTeX and
245+
the ImageMagick tools (e.g. the "convert" command) installed
246+
since some plotting functionality benefits from them.
247+
248+
6. [Development] If you plan to do Sage development or otherwise work with
249+
ticket branches and not only releases, install the bootstrapping
250+
prerequisites. See the files in the folder
236251
[build/pkgs/_bootstrap/distros](build/pkgs/_bootstrap/distros), or
237252
visit
238253
https://doc.sagemath.org/html/en/reference/spkg/_bootstrap.html#spkg-bootstrap
239254

240-
5. [Git] If you cloned the Sage repository using `git`, bootstrap the
241-
source tree using the following command:
255+
7. Bootstrap the source tree using the following command:
242256

243257
$ make configure
244258

245-
(If the bootstrapping prerequisites are not installed, this command will
246-
download a package providing pre-built bootstrap output instead.)
259+
(If the bootstrapping prerequisites are not installed, this command
260+
will download a package providing pre-built bootstrap output instead.)
247261

248-
6. Sanitize the build environment. Use the command
262+
8. Sanitize the build environment. Use the command
249263

250264
$ env
251265

@@ -277,7 +291,7 @@ in the Installation Guide.
277291
can also add it to your shell profile so that it gets run
278292
automatically in all future sessions.)
279293

280-
7. Optionally, decide on the installation prefix (`SAGE_LOCAL`):
294+
9. Optionally, decide on the installation prefix (`SAGE_LOCAL`):
281295

282296
- Traditionally, and by default, Sage is installed into the
283297
subdirectory hierarchy rooted at `SAGE_ROOT/local/`.
@@ -295,15 +309,11 @@ in the Installation Guide.
295309
installs (`make install` is a no-op). Therefore the
296310
installation hierarchy must be writable by the user.
297311

298-
- See the installation manual for options if you want to
312+
- See the Sage Installation Manual for options if you want to
299313
install into shared locations such as `/usr/local/`.
300314
Do not attempt to build Sage as `root`.
301315

302-
8. Optional: It is recommended that you have both LaTeX and
303-
the ImageMagick tools (e.g. the "convert" command) installed
304-
since some plotting functionality benefits from them.
305-
306-
9. Optionally, review the configuration options, which includes
316+
10. Optionally, review the configuration options, which includes
307317
many optional packages:
308318

309319
$ ./configure --help
@@ -321,7 +331,7 @@ in the Installation Guide.
321331
a great speedup when switching between different branches, at the
322332
expense of disk space use.
323333

324-
10. Optional, but highly recommended: Set some environment variables to
334+
11. Optional, but highly recommended: Set some environment variables to
325335
customize the build.
326336

327337
For example, the `MAKE` environment variable controls whether to
@@ -343,7 +353,7 @@ in the Installation Guide.
343353
building Sage, see [the installation
344354
guide](https://doc.sagemath.org/html/en/installation/source.html#environment-variables).
345355

346-
11. Type `./configure`, followed by any options that you wish to use.
356+
12. Type `./configure`, followed by any options that you wish to use.
347357
For example, to build Sage with `gf2x` package supplied by Sage,
348358
use `./configure --with-system-gf2x=no`.
349359

@@ -363,60 +373,60 @@ in the Installation Guide.
363373
available; only the most recent releases of your distribution will
364374
have all of these recommended packages.
365375

366-
12. Optional: If you choose to install the additional system packages,
376+
13. Optional: If you choose to install the additional system packages,
367377
a re-run of `./configure` will test whether the versions installed
368378
are usable for Sage; if they are, this will reduce the compilation
369379
time and disk space needed by Sage. The usage of packages may be
370380
adjusted by `./configure` parameters (check again the output of
371381
`./configure --help`).
372382

373-
13. Type `make`. That's it! Everything is automatic and
383+
14. Type `make`. That's it! Everything is automatic and
374384
non-interactive.
375385

376386
If you followed the above instructions, in particular regarding the
377387
installation of system packages recommended by the output of
378-
`./configure` (step 10), and regarding the parallel build (step 9),
388+
`./configure` (step 11), and regarding the parallel build (step 10),
379389
building Sage takes less than one hour on a modern computer.
380390
(Otherwise, it can take much longer.)
381391

382392
The build should work fine on all fully supported platforms. If it
383393
does not, we want to know!
384394

385-
14. Type `./sage` to try it out. In Sage, try for example `2 + 2`,
395+
15. Type `./sage` to try it out. In Sage, try for example `2 + 2`,
386396
`plot(x^2)`, `plot3d(lambda x, y: x*y, (-1, 1), (-1, 1))`
387397
to test a simple computation and plotting in 2D and 3D.
388398
Type <kbd>Ctrl</kbd>+<kbd>D</kbd> or `quit` to quit Sage.
389399

390-
15. Optional: Type `make ptestlong` to test all examples in the documentation
400+
16. Optional: Type `make ptestlong` to test all examples in the documentation
391401
(over 200,000 lines of input!) -- this takes from 10 minutes to
392402
several hours. Don't get too disturbed if there are 2 to 3 failures,
393403
but always feel free to email the section of `logs/ptestlong.log` that
394404
contains errors to the [sage-support mailing list](https://groups.google.com/group/sage-support).
395405
If there are numerous failures, there was a serious problem with your build.
396406

397-
16. The HTML version of the [documentation](https://doc.sagemath.org/html/en/index.html)
407+
17. The HTML version of the [documentation](https://doc.sagemath.org/html/en/index.html)
398408
is built during the compilation process of Sage and resides in the directory
399409
`local/share/doc/sage/html/`. You may want to bookmark it in your browser.
400410

401-
17. Optional: If you want to build the PDF version of the documentation,
411+
18. Optional: If you want to build the PDF version of the documentation,
402412
run `make doc-pdf` (this requires LaTeX to be installed).
403413

404-
18. Optional: Install optional packages of interest to you:
414+
19. Optional: Install optional packages of interest to you:
405415
get a list by typing `./sage --optional` or by visiting the
406416
[packages documentation page](https://doc.sagemath.org/html/en/reference/spkg/).
407417

408-
19. Optional: Create a symlink to the installed `sage` script in a
409-
directory in your `PATH`, for example ``/usr/local``. This will
418+
20. Optional: Create a symlink to the installed `sage` script in a
419+
directory in your `PATH`, for example `/usr/local`. This will
410420
allow you to start Sage by typing `sage` from anywhere rather than
411421
having to either type the full path or navigate to the Sage
412422
directory and type `./sage`. This can be done by running:
413423

414424
$ sudo ln -s $(./sage -sh -c 'ls $SAGE_ROOT/venv/bin/sage') /usr/local/bin
415425

416-
20. Optional: Set up SageMath as a Jupyter kernel in an existing Jupyter notebook
426+
21. Optional: Set up SageMath as a Jupyter kernel in an existing Jupyter notebook
417427
or JupyterLab installation, as described in [section
418428
"Launching SageMath"](https://doc.sagemath.org/html/en/installation/launching.html)
419-
in the installation manual.
429+
in the Sage Installation Manual.
420430

421431
Alternative Installation using PyPI
422432
---------------
@@ -505,7 +515,7 @@ Directory Layout
505515

506516
Simplified directory layout (only essential files/directories):
507517
```
508-
SAGE_ROOT Root directory (sage-x.y in Sage tarball)
518+
SAGE_ROOT Root directory (create by git clone)
509519
├── build
510520
│ └── pkgs Every package is a subdirectory here
511521
│ ├── 4ti2/

src/doc/en/developer/doctesting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ this syntax:
2626

2727
.. CODE-BLOCK:: text
2828
29-
/path/to/sage-x.y.z/sage -t [--long] /path/to/sage-x.y.z/path/to/module.py[x]
29+
/path/to/sage_root/sage -t [--long] /path/to/sage_root/path/to/module.py[x]
3030
3131
where ``--long`` is an optional argument (see :ref:`section-options`
3232
for more options). The version of ``sage`` used must match the version

src/doc/en/developer/git_setup.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ Installing Git
1212

1313
Depending on your platform, use the following to install Git:
1414

15-
Debian / Ubuntu
16-
Run ``sudo apt-get install git-core``
17-
18-
Fedora
19-
Run ``sudo yum install git-core``
15+
Linux
16+
See :ref:`spkg_git` for the installation command on your
17+
Linux distribution.
2018

2119
Windows (WSL)
2220
We strongly recommend to install the package using the Linux

src/doc/en/developer/walkthrough.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ Obtaining the Sage source code
6161
==============================
6262

6363
Obviously one needs the Sage source code to develop. You can use your
64-
local installation of Sage, or (to start from scratch) download it
65-
from our Sage repository on GitHub::
64+
local installation of Sage (if you installed Sage from source), or
65+
(to start from scratch) download it from our Sage repository on GitHub::
6666

6767
[alice@localhost ~]$ git clone --origin upstream https://github.com/sagemath/sage.git
6868
Cloning into 'sage'...

src/doc/en/installation/source.rst

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,49 @@ Installation steps
373373
#. Follow the procedure in the file `README.md <https://github.com/sagemath/sage/#readme>`_
374374
in ``SAGE_ROOT``.
375375

376+
#. If you wish to prepare for having to build Sage in an environment
377+
without sufficient Internet connectivity:
378+
379+
- After running ``configure``, you can use ``make download`` to force
380+
downloading packages before building. After this, the packages
381+
are in the subdirectory ``upstream``.
382+
383+
- Alternatively, instead of cloning the git repository, you
384+
can download a self-contained release tarball for any
385+
stable release from the Sage project's
386+
`GitHub Releases <https://github.com/sagemath/sage/releases>`_.
387+
Use the file named ``sage-x.y.tar.gz`` (1.25 GB as of Sage 10.2)
388+
in the Release Assets, which contains a prepopulated subdirectory
389+
``upstream``.
390+
391+
After downloading the source tarball ``sage-x.y.tar.gz`` into
392+
a directory ``~/sage/``::
393+
394+
$ cd ~/sage/
395+
$ tar xf sage-x.y.tar.gz # adapt x.y; takes a while
396+
397+
This creates the subdirectory ``sage-x.y``. Now change into it::
398+
399+
$ cd sage-x.y/ # adapt x.y
400+
401+
.. note::
402+
403+
On Windows, it is crucial that you unpack the source tree from the
404+
WSL `bash` using the WSL `tar` utility and not using other
405+
Windows tools (including mingw).
406+
407+
This is because the Sage source tree contains symbolic links, and the
408+
build will not work if Windows line endings rather than UNIX
409+
line endings are used.
410+
411+
- The Sage mirrors also provide such self-contained tarballs
412+
for all `stable releases <https://www.sagemath.org/download-source.html>`_
413+
and additionally for all `development releases
414+
<https://www.sagemath.org/download-latest.html>`_.
415+
376416
#. Additional remarks:
377417
You do not need to be logged in as root, since no files are
378-
changed outside of the :file:`sage-x.y` directory.
418+
changed outside of the :file:`SAGE_ROOT` directory.
379419
In fact, **it is inadvisable to build Sage as root**, as the root account
380420
should only be used when absolutely necessary and mistyped commands can have
381421
serious consequences if you are logged in as root.
@@ -490,7 +530,7 @@ Installation steps
490530
- Make a symbolic link from :file:`/usr/local/bin/sage` (or another
491531
directory in your :envvar:`PATH`) to :file:`$SAGE_ROOT/sage`::
492532

493-
$ ln -s /path/to/sage-x.y/sage /usr/local/bin/sage
533+
$ ln -s /path/to/sage_root/sage /usr/local/bin/sage
494534

495535
Now simply typing ``sage`` from any directory should be sufficient to run
496536
Sage.

0 commit comments

Comments
 (0)