ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 25 Aug 2011 13:50:48 +0200When would sage -sh not work?https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/When is `./sage -sh` NOT supposed to work? That is, where should this work in the spkg build process? My sense is that it should work almost immediately - even before Python, right? - but sometimes I get the message about it not working in the middle of a build I need to `./sage -sh` in to set environment variables correctly.
I should point out that currently I have a lot of stuff built - Python, Pari, GSL, ecl, elliptic curves - but when I do what the message says (edit `$SAGE_ROOT` in `./sage`) then I just get a message about `sage-sage` not existing in `local/bin`, which it is true, it does not.
An acceptable answer to this could include any *other* way to set the appropriate variables during a build.Wed, 24 Aug 2011 14:49:59 +0200https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/Comment by John Palmieri for <p>When is <code>./sage -sh</code> NOT supposed to work? That is, where should this work in the spkg build process? My sense is that it should work almost immediately - even before Python, right? - but sometimes I get the message about it not working in the middle of a build I need to <code>./sage -sh</code> in to set environment variables correctly.</p>
<p>I should point out that currently I have a lot of stuff built - Python, Pari, GSL, ecl, elliptic curves - but when I do what the message says (edit <code>$SAGE_ROOT</code> in <code>./sage</code>) then I just get a message about <code>sage-sage</code> not existing in <code>local/bin</code>, which it is true, it does not.</p>
<p>An acceptable answer to this could include any <em>other</em> way to set the appropriate variables during a build.</p>
https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?comment=21308#post-id-21308Which spkgs give these messages? If they really need "sage -sh" to work, then they should be changed so that they have the scripts spkg as a prerequisite in SAGE_ROOT/spkg/standard/deps.Wed, 24 Aug 2011 23:24:14 +0200https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?comment=21308#post-id-21308Comment by kcrisman for <p>When is <code>./sage -sh</code> NOT supposed to work? That is, where should this work in the spkg build process? My sense is that it should work almost immediately - even before Python, right? - but sometimes I get the message about it not working in the middle of a build I need to <code>./sage -sh</code> in to set environment variables correctly.</p>
<p>I should point out that currently I have a lot of stuff built - Python, Pari, GSL, ecl, elliptic curves - but when I do what the message says (edit <code>$SAGE_ROOT</code> in <code>./sage</code>) then I just get a message about <code>sage-sage</code> not existing in <code>local/bin</code>, which it is true, it does not.</p>
<p>An acceptable answer to this could include any <em>other</em> way to set the appropriate variables during a build.</p>
https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?comment=21306#post-id-21306Oh, I think nearly ALL of them do! That's in the standard error message when an spkg fails to build.Thu, 25 Aug 2011 13:50:48 +0200https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?comment=21306#post-id-21306Answer by benjaminfjones for <p>When is <code>./sage -sh</code> NOT supposed to work? That is, where should this work in the spkg build process? My sense is that it should work almost immediately - even before Python, right? - but sometimes I get the message about it not working in the middle of a build I need to <code>./sage -sh</code> in to set environment variables correctly.</p>
<p>I should point out that currently I have a lot of stuff built - Python, Pari, GSL, ecl, elliptic curves - but when I do what the message says (edit <code>$SAGE_ROOT</code> in <code>./sage</code>) then I just get a message about <code>sage-sage</code> not existing in <code>local/bin</code>, which it is true, it does not.</p>
<p>An acceptable answer to this could include any <em>other</em> way to set the appropriate variables during a build.</p>
https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?answer=12604#post-id-12604The script at `$SAGE_ROOT/local/bin/sage-env` sets the shell environment up for building spks's. Here's what it reads at the top:
###########################################################################
#
# Set environment variables for building and/or running Sage.
# You must *source* this instead of executing; see below!
#
# AUTHORS: William Stein 2005-12
# David Kirkby <david.kirkby@onetel.net> 2005-12-17
#
###########################################################################
##########################################################################
#
# If you want to set all environment variables for your shell like
# they are during the build of Sage packages, type
#
# source local/bin/sage-env
#
# from the SAGE_ROOT directory. To do the same from a /bin/bash
# script use ". local/bin/sage-env".
#
##########################################################################
Note that you should run `source local/bin/sage-env` from `$SAGE_ROOT` for it to work.
Essentially, `sage -sh` calls your shell (say `/bin/bash`) with an option to prevent loading of the user's .profile or rc file (for `/bin/bash` it runs the shell without sourcing `.profile`, `.bash_profile`, `.bashrc`) to ensure that the paths are correct. If you are using Bash, then running `./sage -sh` from `$SAGE_ROOT` should be equivalent to doing:
> /bin/bash --norc
> source local/bin/sage-envWed, 24 Aug 2011 21:22:49 +0200https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?answer=12604#post-id-12604Comment by benjaminfjones for <p>The script at <code>$SAGE_ROOT/local/bin/sage-env</code> sets the shell environment up for building spks's. Here's what it reads at the top:</p>
<pre><code>###########################################################################
#
# Set environment variables for building and/or running Sage.
# You must *source* this instead of executing; see below!
#
# AUTHORS: William Stein 2005-12
# David Kirkby <david.kirkby@onetel.net> 2005-12-17
#
###########################################################################
##########################################################################
#
# If you want to set all environment variables for your shell like
# they are during the build of Sage packages, type
#
# source local/bin/sage-env
#
# from the SAGE_ROOT directory. To do the same from a /bin/bash
# script use ". local/bin/sage-env".
#
##########################################################################
</code></pre>
<p>Note that you should run <code>source local/bin/sage-env</code> from <code>$SAGE_ROOT</code> for it to work. </p>
<p>Essentially, <code>sage -sh</code> calls your shell (say <code>/bin/bash</code>) with an option to prevent loading of the user's .profile or rc file (for <code>/bin/bash</code> it runs the shell without sourcing <code>.profile</code>, <code>.bash_profile</code>, <code>.bashrc</code>) to ensure that the paths are correct. If you are using Bash, then running <code>./sage -sh</code> from <code>$SAGE_ROOT</code> should be equivalent to doing: </p>
<pre><code>> /bin/bash --norc
> source local/bin/sage-env
</code></pre>
https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?comment=21310#post-id-21310Essentially, sage -sh calls your shell (say /bin/bash) with an option to prevent loading of the user's .profile or .XXXrc file (for /bin/bash it runs the shell without sourcing .profile, .bash_profile, .bashrc) to ensure that the paths are correct. If you are using Bash, then running `./sage -sh` from `$SAGE_ROOT` should be equivalent to doing: `/bin/bash --norc; source local/bin/sage-env`Wed, 24 Aug 2011 22:53:11 +0200https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?comment=21310#post-id-21310Comment by kcrisman for <p>The script at <code>$SAGE_ROOT/local/bin/sage-env</code> sets the shell environment up for building spks's. Here's what it reads at the top:</p>
<pre><code>###########################################################################
#
# Set environment variables for building and/or running Sage.
# You must *source* this instead of executing; see below!
#
# AUTHORS: William Stein 2005-12
# David Kirkby <david.kirkby@onetel.net> 2005-12-17
#
###########################################################################
##########################################################################
#
# If you want to set all environment variables for your shell like
# they are during the build of Sage packages, type
#
# source local/bin/sage-env
#
# from the SAGE_ROOT directory. To do the same from a /bin/bash
# script use ". local/bin/sage-env".
#
##########################################################################
</code></pre>
<p>Note that you should run <code>source local/bin/sage-env</code> from <code>$SAGE_ROOT</code> for it to work. </p>
<p>Essentially, <code>sage -sh</code> calls your shell (say <code>/bin/bash</code>) with an option to prevent loading of the user's .profile or rc file (for <code>/bin/bash</code> it runs the shell without sourcing <code>.profile</code>, <code>.bash_profile</code>, <code>.bashrc</code>) to ensure that the paths are correct. If you are using Bash, then running <code>./sage -sh</code> from <code>$SAGE_ROOT</code> should be equivalent to doing: </p>
<pre><code>> /bin/bash --norc
> source local/bin/sage-env
</code></pre>
https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?comment=21312#post-id-21312What would the difference between this and `sage -sh` be? Wed, 24 Aug 2011 22:32:09 +0200https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?comment=21312#post-id-21312Comment by kcrisman for <p>The script at <code>$SAGE_ROOT/local/bin/sage-env</code> sets the shell environment up for building spks's. Here's what it reads at the top:</p>
<pre><code>###########################################################################
#
# Set environment variables for building and/or running Sage.
# You must *source* this instead of executing; see below!
#
# AUTHORS: William Stein 2005-12
# David Kirkby <david.kirkby@onetel.net> 2005-12-17
#
###########################################################################
##########################################################################
#
# If you want to set all environment variables for your shell like
# they are during the build of Sage packages, type
#
# source local/bin/sage-env
#
# from the SAGE_ROOT directory. To do the same from a /bin/bash
# script use ". local/bin/sage-env".
#
##########################################################################
</code></pre>
<p>Note that you should run <code>source local/bin/sage-env</code> from <code>$SAGE_ROOT</code> for it to work. </p>
<p>Essentially, <code>sage -sh</code> calls your shell (say <code>/bin/bash</code>) with an option to prevent loading of the user's .profile or rc file (for <code>/bin/bash</code> it runs the shell without sourcing <code>.profile</code>, <code>.bash_profile</code>, <code>.bashrc</code>) to ensure that the paths are correct. If you are using Bash, then running <code>./sage -sh</code> from <code>$SAGE_ROOT</code> should be equivalent to doing: </p>
<pre><code>> /bin/bash --norc
> source local/bin/sage-env
</code></pre>
https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?comment=21307#post-id-21307Okay, this at least clears up most of what I wanted to know. @benjaminfjones, can you add that info to the main answer so that others could find it more easily? Thu, 25 Aug 2011 13:47:33 +0200https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?comment=21307#post-id-21307Comment by John Palmieri for <p>The script at <code>$SAGE_ROOT/local/bin/sage-env</code> sets the shell environment up for building spks's. Here's what it reads at the top:</p>
<pre><code>###########################################################################
#
# Set environment variables for building and/or running Sage.
# You must *source* this instead of executing; see below!
#
# AUTHORS: William Stein 2005-12
# David Kirkby <david.kirkby@onetel.net> 2005-12-17
#
###########################################################################
##########################################################################
#
# If you want to set all environment variables for your shell like
# they are during the build of Sage packages, type
#
# source local/bin/sage-env
#
# from the SAGE_ROOT directory. To do the same from a /bin/bash
# script use ". local/bin/sage-env".
#
##########################################################################
</code></pre>
<p>Note that you should run <code>source local/bin/sage-env</code> from <code>$SAGE_ROOT</code> for it to work. </p>
<p>Essentially, <code>sage -sh</code> calls your shell (say <code>/bin/bash</code>) with an option to prevent loading of the user's .profile or rc file (for <code>/bin/bash</code> it runs the shell without sourcing <code>.profile</code>, <code>.bash_profile</code>, <code>.bashrc</code>) to ensure that the paths are correct. If you are using Bash, then running <code>./sage -sh</code> from <code>$SAGE_ROOT</code> should be equivalent to doing: </p>
<pre><code>> /bin/bash --norc
> source local/bin/sage-env
</code></pre>
https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?comment=21309#post-id-21309Note also that sage-env is in SAGE_ROOT/spkg/base, so it is there right at the start of the Sage installation.Wed, 24 Aug 2011 23:22:45 +0200https://ask.sagemath.org/question/8290/when-would-sage-sh-not-work/?comment=21309#post-id-21309