#16149: sage-env exports empty CXXFLAGS
---------------------------------------+--------------------------
Reporter: leif | Owner:
Type: defect | Status: needs_info
Priority: critical | Milestone: sage-6.2
Component: scripts | Resolution:
Keywords: CFLAGS MPIR C++ ABI | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
---------------------------------------+--------------------------
Changes (by leif):
* status: new => needs_info
Old description:
> That happens if `CFLAGS` are empty (or not exported at all, which
> presumably is the most frequent case) and `CXXFLAGS` aren't either:
>
> {{{
> #!sh
> if [ "$CXXFLAGS" = "" ]; then
> export CXXFLAGS="$CFLAGS"
> fi
> }}}
>
> Unintentionally having exported but empty `CXXFLAGS` breaks '''at
> least''' MPIR, because it assumes the user had intentionally set them, so
> leaves them as they are (empty that is), not passing potentially import
> architecture and ABI flags to the C++ compiler (e.g. `-m...` flags to
> `g++`).
>
> The solution is of course simple: Don't (set and) export `CXXFLAGS` if
> `CFLAGS` aren't exported either. Not sure if setting `CXXFLAGS` to
> `CFLAGS` in case the latter are non-empty (or empty but exported) is
> desirable at all.
New description:
That happens if `CFLAGS` are empty (or not exported at all, which
presumably is the most frequent case) and `CXXFLAGS` aren't either:
{{{
#!sh
if [ "$CXXFLAGS" = "" ]; then
export CXXFLAGS="$CFLAGS"
fi
}}}
Unintentionally having exported but empty `CXXFLAGS` breaks '''at least'''
MPIR, because it assumes the user had intentionally set them, so leaves
them as they are (empty that is), not passing potentially important
architecture and ABI flags to the C++ compiler (e.g. `-m...` flags to
`g++`).
The solution is of course simple: Don't (set and) export `CXXFLAGS` if
`CFLAGS` aren't exported either. Not sure if setting `CXXFLAGS` to
`CFLAGS` in case the latter are non-empty (or empty but exported) is
desirable at all.
--
Comment:
Typo.
--
Ticket URL: <http://trac.sagemath.org/ticket/16149#comment:3>
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.
For more options, visit https://groups.google.com/d/optout.