#14172: mpir-2.6.0.p0 fails to build on 32-bit architecure
------------------------------------+---------------------------------------
Reporter: tmonteil | Owner: GeorgSWeber
Type: defect | Status: new
Priority: major | Milestone: sage-5.8
Component: build | Resolution:
Keywords: mpir spkg ABI 32 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
------------------------------------+---------------------------------------
Comment (by leif):
For reference, this is the current logic (originally for MPIR 2.4.0):
{{{
#!sh
Linux)
# MPIR fails to build on 32-bit operating systems running on
# 64-bit CPUs if CFLAGS happen to contain '-m32' and ABI is
# *not* set, so we set it here if necessary:
# (Cf. http://groups.google.com/group/mpir-
devel/browse_thread/thread/46ccdc5dfc3485cd#)
# Note: This code snippet could in principle be moved out of the
# Linux branch, but since we already set ABI for other
# OSs above (and print an according message), it's here.
if [ -z "$ABI" ]; then
echo "int main(){return 0;}" > foo.c
# Try building and running a 64-bit executable:
# (Building usually succeeds even on 32-bit systems, unless
e.g. a 32-bit
# CPU is explicitly selected by CFLAGS, while running does
not.)
if $CC $CFLAGS $CFLAG64 -o foo foo.c 2>/dev/null && ./foo
2>/dev/null; then
# We can run 64-bit executables.
# Setting ABI=64 shouldn't be necessary, but shouldn't
hurt either.
echo "Building a 64-bit version of MPIR."
case "`uname -m`" in
ppc64) ABI=mode64;;
*) ABI=64
esac
elif $CC $CFLAGS $CFLAG32 -o foo foo.c 2>/dev/null && ./foo
2>/dev/null; then
# We're on a 32-bit OS which cannot run 64-bit
executables.
echo "Building a 32-bit version of MPIR."
ABI=32
else
# It seems the compiler does not support -m32 nor -m64
(e.g.
# GCC on Itanium rejects both); do not set ABI at all.
echo "Your compiler does not support '$CFLAG32' nor
'$CFLAG64'. Leaving ABI unset."
fi
rm -f foo foo.c
fi
;; # Linux
}}}
----
If only MPIR (2.6.0) requires `ABI=standard` (rather than `ABI=32`, or
left empty/unset), one should presumably only set it for building MPIR:
{{{
$ unset ABI # (or set it to "32" on 32-bit operating systems running on a
64-bit CPU)
$ make -k # continue as far as possible
$ env ABI=standard ./sage -i spkg/standand/mpir-2.6.0.p0.spkg
$ make # build the rest
}}}
That way (not ''globally'' setting `ABI=standard`) shouldn't cause
problems with other spkgs (such as GAP).
We'll see whether we can tweak `spkg-install` (or patch MPIR's
`configure`) to not require this manual intervention, although [from a
previous thread on a similar problem]
{{{
On Dec 24, 1:51 am, Bill Hart <[email protected]> wrote:
> I agree with William's synopsis. You definitely have 64 bit hardware,
> but a 32 bit OS. It's not that your hardware is "old". I was just
> wrong about that. We support much older hardware than Core 2's!
>
> Note that you will get an approximately 2x speedup of much
> mathematical software if you upgrade your linux to a 64 bit linux. So
> it is worth considering.
}}}
(SCNR.)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14172#comment:4>
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.