#13150: Create an optional GCC-4.7.1 package
-------------------------------------+--------------------------------------
Reporter: jdemeyer | Owner: tbd
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.3
Component: optional packages | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Jeroen Demeyer | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Comment (by leif):
Replying to [comment:6 leif]:
> Looks like we just have to extend the following part of `spkg/bin/sage-
env`:
>
> {{{
> ...
>
> # Override CC and CXX if the gcc spkg was installed.
> if [ -x "$SAGE_LOCAL/bin/gcc" ]; then
> CC=gcc
> fi
> if [ -x "$SAGE_LOCAL/bin/g++" ]; then
> CXX=g++
> fi
> export CC CXX
> }}}
Something along these lines:
{{{
#!diff
diff --git a/spkg/bin/sage-env b/spkg/bin/sage-env
--- a/spkg/bin/sage-env
+++ b/spkg/bin/sage-env
@@ -418,6 +418,8 @@
if [ -z "$CXX" ]; then
CXX=g++
fi
+# We may set CPP, FC, F77 (to sage_fortran?) etc. here as well;
+# letting at least CPP have a default value ('cpp') probably makes sense.
# An Objective-C compiler is needed for R on Darwin.
# On Darwin, /usr/bin/cc supports Objective-C. The gcc shipped with
@@ -431,14 +433,24 @@
fi
fi
-# Override CC and CXX if the gcc spkg was installed.
+# Override CC, CPP, CXX, FC, F77 and F95 if the GCC spkg was installed:
+# (We *may* also just unset FC/F77/F95 in case $SAGE_LOCAL/bin/gfortran
is
+# present.)
if [ -x "$SAGE_LOCAL/bin/gcc" ]; then
CC=gcc
fi
+if [ -x "$SAGE_LOCAL/bin/cpp" ]; then
+ CPP=cpp
+fi
if [ -x "$SAGE_LOCAL/bin/g++" ]; then
CXX=g++
fi
-export CC CXX
+export CC CPP CXX
+if [ -x "$SAGE_LOCAL/bin/gfortran" ]; then
+ for var in FC F77 F95; do
+ export ${var}=gfortran
+ done
+fi
if [ "$LD" = "" ]; then
}}}
Don't know whether that interferes / is consistent with the `SAGE_FORTRAN`
variable and/or the odd `sage_fortran` script (which should IMHO get
removed anyway).
Setting / overriding `OBJC` etc. may not be necessary at the moment, but
certainly would make sense, too, if we build compilers for more languages
(as is currently the case with the GCC 4.7.x spkg).
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13150#comment:8>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.