Need to build sage as root for Slackware package

98 views
Skip to first unread message

cdu...@gmail.com

unread,
Dec 23, 2023, 11:08:48 AM12/23/23
to sage-devel
Hello,
        I am the maintainer for the Slackware package of SageMath. They've recently instituted a policy that all packages must be built in /tmp, which makes things tricky with Sage, as the build directory might get removed at a later point, and Sage needs that. Previously I had just built in /opt/sage, set SAGE_ROOT=/opt/sage, and it worked fine (with some work on the path). I was also building as root (--enable-build-as-root), but everything worked fine. Now I cannot do this.

I've tried to play with --prefix=SAGE_LOCAL and --disable-editable (supposed to make a self-contained installation), but if I run SAGE_LOCAL/bin/sage I get

$ sage
Traceback (most recent call last):
  File "/tmp/SBo/sage-10.1/src/bin/sage-ipython", line 9, in <module>
    from sage.misc.banner import banner
ModuleNotFoundError: No module named 'sage'

That directory is the build directory (not SAGE_ROOT or SAGE_LOCAL), so something has gone wrong with the portable-ness. Possibly because I built as root, for sure.

So is there a solution here? The installation manual does not help a lot with this, I need to build a portable installation as root - or other ideas, like how to fix the error above, where the "portable installation" points to the build directory.

Thanks.

Christopher Duston

unread,
Dec 23, 2023, 1:13:49 PM12/23/23
to sage-...@googlegroups.com
Ugh sorry my mistake, that's the error when running /opt/sage. The error when running from SAGE_LOCAL/bin/sage is

$ pwd
/tmp/SBo/package-sage/INSTALL/bin
$ ./sage
./sage: ././sage-config: /tmp/SBo/package-sage/INSTALL/bin/python3: bad interpreter: No such file or directory
./sage: ././sage-config: /tmp/SBo/package-sage/INSTALL/bin/python3: bad interpreter: No such file or directory
./sage: ././sage-venv-config: /tmp/SBo/package-sage/INSTALL/bin/python3: bad interpreter: No such file or directory
./sage: /tmp/SBo/package-sage/INSTALL/bin/sage-ipython: /tmp/SBo/package-sage/INSTALL/bin/python3: bad interpreter: No such file or directory
./sage: line 310: /tmp/SBo/package-sage/INSTALL/bin/sage-ipython: Success

And indeed. python3 is not in that folder - and not on my system, oops. Why did this install correctly before? Ok let me try --without-system-python3.

Oops: That option doesn't exist any more, contrary to this page: https://doc.sagemath.org/html/en/reference/spkg/python3.html

So I guess I'm trying --with-system-python3=no.....

--
You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/I6YD0rAeIKg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/3d39789b-f214-42d5-8906-aa09d19e7443n%40googlegroups.com.

Matthias Koeppe

unread,
Dec 23, 2023, 1:20:27 PM12/23/23
to sage-devel
The Sage distribution does not support relocation after build and also not DESTDIR-style staged installation.

See https://github.com/sagemath/sage/issues/36860#issuecomment-1854730246 for the suggested method for downstream packaging of Sage.

Dima Pasechnik

unread,
Dec 23, 2023, 3:42:59 PM12/23/23
to sage-...@googlegroups.com
You may also try
https://github.com/sagemath/binary-pkg

to rewrite paths etc. We used to build binary packages using this tool, packages you can install into any prefix.


No ./configure options would help you here.
It's actually less remapping hassle to use as many system packages as possible.
Reply all
Reply to author
Forward
0 new messages