#13432: add sage/env.py and fix many inappropriate references to SAGE_ROOT
-----------------------------------+----------------------------------------
Reporter: rohana | Owner: jason
Type: task | Status: needs_review
Priority: major | Milestone: sage-5.8
Component: misc | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: R. Andrew Ohana | Merged in:
Dependencies: #13123, #13348 | Stopgaps:
-----------------------------------+----------------------------------------
Comment (by fbissey):
In one of my first attempt I ended up with an unbuildable sage :( but
getting all the variables in an independent file is the big cure for that.
I understand the problem with the logic. I still have one doctest failure
in lazy_import_cache in sage-on-gentoo and I am not sure why.
I didn't create any new variables like SAGE_SRC and SAGE_LIB, that was a
lot of work as it is.
I believe the other instances of SAGE_ROOT in sage/misc/cython.py can go.
{{{
@@ -335,10 +336,10 @@
Before :trac:`12975`, it would have beeen needed to write ``#clang
c++``,
but upper case ``C++`` has resulted in an error::
- sage: from sage.all import SAGE_ROOT
+ sage: from sage.env import SAGE_LOCAL
sage: code = [
... "#clang C++",
- ... "#cinclude %s/local/include/singular
%s/local/include/factory"%(SAGE_ROOT,SAGE_ROOT),
+ ... "#cinclude %s/include/singular
%s/include/singular"%(SAGE_LOCAL,SAGE_LOCAL),
... "#clib m readline singular givaro ntl gmpxx gmp",
... "from sage.rings.polynomial.multi_polynomial_libsingular
cimport MPolynomial_libsin$
... "from sage.libs.singular.polynomial cimport
singular_polynomial_pow",
@@ -449,12 +450,7 @@
import distutils.sysconfig, os, sys
from distutils.core import setup, Extension
-if not os.environ.has_key('SAGE_ROOT'):
- print " ERROR: The environment variable SAGE_ROOT must be
defined."
- sys.exit(1)
-else:
- SAGE_ROOT = os.environ['SAGE_ROOT']
- SAGE_LOCAL = SAGE_ROOT + '/local/'
+from sage.env import SAGE_ROOT, SAGE_LOCAL
extra_link_args = ['-L' + SAGE_LOCAL + '/lib']
extra_compile_args = %s
}}}
I edited it so it is closer to your style.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13432#comment:16>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.