Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
README.md, src/doc/en/installation/source.rst: Update multi-user install
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed May 2, 2022
1 parent eb1a786 commit 60bcbec
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 55 deletions.
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -580,17 +580,10 @@ Relocation

It is not supported to move the `SAGE_ROOT` or `SAGE_LOCAL` directory
after building Sage. If you do move the directories, you will have to
build Sage again from scratch.

If you copy the `sage` script or make a symbolic link to it, you
should modify the script to reflect this (as instructed at the top of
the script). It is important that the path to Sage does not have any
spaces and non-ASCII characters in it.
run ``make distclean`` and build Sage again from scratch.

For a system-wide installation, you have to build Sage as a "normal" user
and then as root you can change permissions. Afterwards, you need to start up
Sage as root at least once prior to using the system-wide Sage as a
normal user. See the [Installation Guide](https://doc.sagemath.org/html/en/installation/source.html#installation-in-a-multiuser-environment)
and then as root you can change permissions. See the [Installation Guide](https://doc.sagemath.org/html/en/installation/source.html#installation-in-a-multiuser-environment)
for further information.

Redistribution
Expand Down
67 changes: 21 additions & 46 deletions src/doc/en/installation/source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1207,60 +1207,35 @@ Installation in a Multiuser Environment
This section addresses the question of how a system administrator can install
a single copy of Sage in a multi-user computer network.

System-wide install
~~~~~~~~~~~~~~~~~~~
#. Using ``sudo``, create the installation directory, for example,
``/opt/sage/sage-x.y``. We refer to it as ``SAGE_LOCAL`` in the
instructions below. Do not try to install into a directory that
already contains other software, such as ``/usr/local``::

In the instructions below, we assume that ``/path/to/sage-x.y`` is
the directory where you want to install Sage.
$ sudo mkdir -p SAGE_LOCAL

#. First of all, extract the Sage source tarball in ``/path/to``
(this will create the directory ``/path/to/sage-x.y``).
After extracting, you can change the directory name if you do not
like ``sage-x.y``.
#. Make the directory writable for you and readable by everyone::

#. Change the ownership of the ``/path/to/sage-x.y`` directory tree
to your normal user account (as opposed to ``root``). This is because
Sage will refuse to compile as ``root``. ::
$ sudo chown $(id -un) SAGE_LOCAL
$ sudo chmod 755 SAGE_LOCAL

$ chown -R user:group /path/to/sage-x.y
#. Build and install Sage, following the instructions in `README.md
<https://github.com/sagemath/sage/#readme>`_, using the
``configure`` option ``--prefix=SAGE_LOCAL``.

#. Using your normal user account, build Sage.
See the :ref:`build-from-source-step-by-step` above.
Do not use ``sudo`` for this step; building Sage must be done using
your normal user account.

#. Make a symbolic link to the ``sage`` script in :file:`/usr/local/bin`::
#. Optionally, create a symbolic link to the installed ``sage`` script
in a directory that is in the users' :envvar:`PATH`, for example
``/usr/local/bin``::

$ ln -s /path/to/sage-x.y/sage /usr/local/bin/sage
$ sudo ln -s SAGE_LOCAL/bin/sage /usr/local/bin/sage

Alternatively, copy the Sage script::
#. Optionally, change permissions to prevent accidental changes to
the installation by yourself::

$ cp /path/to/sage-x.y/sage /usr/local/bin/sage
$ sudo chown -R root SAGE_LOCAL

If you do this, make sure you edit the line:

.. CODE-BLOCK:: bash

#SAGE_ROOT=/path/to/sage-version

at the beginning of the copied ``sage`` script according to the direction
given there to something like:

.. CODE-BLOCK:: bash

SAGE_ROOT=<SAGE_ROOT>

(note that you have to change ``<SAGE_ROOT>`` above!).
It is recommended not to edit the original ``sage`` script, only the copy at
:file:`/usr/local/bin/sage`.

#. Optionally, you can test Sage by running::

$ make testlong

or ``make ptestlong`` which tests files in parallel using multiple
processes.
You can also omit ``long`` to skip tests which take a long time.




**This page was last updated in April 2022 (Sage 9.6).**
**This page was last updated in May 2022 (Sage 9.7).**

0 comments on commit 60bcbec

Please sign in to comment.