sagemath/sage

Installation manual: Update section "system-wide install"

mkoeppe opened this issue · 26 comments

(split out from #30207)

https://doc.sagemath.org/html/en/installation/source.html#installation-in-a-multiuser-environment should be updated:

  • Don't edit the script
  • Just symlink to the sage script in venv

We also add a link from the README to an optional step described only in the installation manual.

CC: @dimpase @jhpalmieri @slel

Component: documentation

Author: Matthias Koeppe

Branch/Commit: 7bc3394

Reviewer: John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/33787

Author: Matthias Koeppe

Commit: 60bcbec

New commits:

60bcbecREADME.md, src/doc/en/installation/source.rst: Update multi-user install

Branch pushed to git repo; I updated commit sha1. New commits:

2116f9fREADME.md: Update final step 'symlink sage', add jupyter kernel step

Changed commit from 60bcbec to 2116f9f

Description changed:

--- 
+++ 
@@ -5,3 +5,4 @@
 - Don't edit the script
 - Just symlink to the `sage` script in venv
 
+We also add a link from the README to an optional step described only in the installation manual.
comment:6

The suggestion to use

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

is not consistent with the top-level sage script, which has

if [ -x "$SAGE_ROOT/src/bin/sage" ]; then
    exec "$SAGE_ROOT/src/bin/sage" "$@"
elif [ -x "$SAGE_ROOT/local/bin/sage" ]; then # if in a stripped binary
    # Note in this case we assume that SAGE_LOCAL is the "local" subdirectory
    exec "$SAGE_ROOT/local/bin/sage" "$@"
else
    echo >&2 "$0: no Sage installation found in \$SAGE_ROOT=$SAGE_ROOT"
    exit 1
fi

(a) Should the Sage script look in venv/bin rather than local/bin? (b) Should the suggestion be to make a symlink to SAGE_ROOT/src/bin/sage?

comment:7

The local/bin/sage could be changed to venv/bin/sage, yes. But this distinction only matters when configure --prefix is not in use because --prefix implies --without-sage-venv. (In Volker's binary build, --prefix is used.)

The "elif" branch is only relevant in binary builds that don't ship src. Do Volker's binary builds (which we no longer advertise) have src?

comment:8

Do Volker's binary builds (which we no longer advertise) have src?

Actually, this turns out to be irrelevant - it looks like Volker stopped making these binaries altogether, the last one is 9.4 -http://files.sagemath.org/linux/64bit/index.html

comment:9

But for the record, http://files.sagemath.org/linux/64bit/sage-9.4-Ubuntu_20.04-x86_64.tar.bz2 does have src, but it does not have the symbolic link venv (that was introduced in 9.5)

comment:10

"stripped binary" might refer to what make micro_release creates. I have never used, but I think it is in use in the user-facing Docker containers somehow. It deletes a lot of stuff, but it does leave src/bin around.

Branch pushed to git repo; I updated commit sha1. New commits:

59877bdMakefile (micro_release): Fix typo in comment
e537bf3sage: Remove outdated check for SAGE_ROOT/local/bin/sage

Changed commit from 2116f9f to e537bf3

comment:12

So here's a simplification.

comment:13

Replying to @jhpalmieri:

(b) Should the suggestion be to make a symlink to SAGE_ROOT/src/bin/sage?

No. SAGE_ROOT/sage uses src/bin/sage to allow for uses in unconfigured source trees.

After a build of Sage, using the installed version is more canonical.

comment:14

Follow-up = #33841

comment:15

How can you run

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

is sage isn't already in your path?

comment:16

Thanks for catching this

Changed commit from e537bf3 to 7bc3394

Branch pushed to git repo; I updated commit sha1. New commits:

7bc3394README.md: Use ./sage in command line
comment:18

(I had copied this from similar invocations shown in src/doc/en/installation/launching.rst, which however start with "Assuming that SageMath can be invoked by typing sage"

comment:19

Looks good to me.

Reviewer: John Palmieri

comment:20

Thanks!