-
-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ecm does not compile on some 32-bit Linux systems #10252
Comments
comment:2
note that GMP-ECM uses CC and CFLAGS from GMP, which ensures both portability and performance. What does Paul |
comment:3
Replying to @zimmermann6:
On my machine (32-bit Gentoo Linux Pentium D), I get with the mpir header installed by Sage:
With the system-wide
|
comment:4
Replying to @jdemeyer:
the spkg should work with the system-wide CFLAGS value. With What is strange is that the GMP-ECM configure checks if SSE2 is really supported, Do you confirm that the upstream package works with Paul |
comment:5
Replying to @zimmermann6:
No, the upstream package does not work with those CFLAGS. The reports in this bug report concerned the upstream sources (built independently of Sage). |
comment:6
I can reproduce the problem on a 32-bit Pentium 4, both with ecm-6.3 and the svn version. I will Paul |
comment:7
with Pierrick Gaudry, we have analyzed and fixed the problem. Long story: the asm volatile instructions without constraints in the configure script compile fine without -msse2, but those from the Short story: apply the following patch
|
comment:8
I can imagine that this bug-fix will make the ecm package work, but I believe that the deeper issue in Sage still needs to be addressed: namely that For example, on sage.math.washington.edu, the upstream mpir package uses the flags |
comment:9
Replying to @jdemeyer:
How does the upstream mpir find these optimized flags? |
comment:11
Replying to @jdemeyer:
I consider such upstream issues, i.e., upstream should IMHO "modify" (Try e.g.
Just for the record: |
comment:12
I disagree. If the user requests CFLAGS=..., upstream should use those flags. Paul Zimmermann |
comment:13
Replying to @zimmermann6:
Yes, but not (necessarily) exclusively. ;-) (Almost all build scripts append or prepend to |
comment:14
So we at least still have the problem of adding ...
# Note that GMP-ECM is written in C (and assembler) - no C++ sources.
if [ "$SAGE64" = yes ]; then
echo "Building a 64-bit version of GMP-ECM"
if [ -z "$CFLAG64" ]; then
CFLAG64=-m64
fi
CFLAGS="$CFLAGS $CFLAG64 -fPIC"
LDFLAGS="$CFLAG64"; export LDFLAGS
else
CFLAGS="$CFLAGS -fPIC"
fi
# We add debug symbols by default;
if [ "$SAGE_DEBUG" = yes ]; then
# Disable optimization:
CFLAGS="$CFLAGS -g -O0"
else
# Enable optimization, may be overridden by user settings:
CFLAGS="-g -O3 $CFLAGS"
fi
export CFLAGS # usually redundant, but safe(r)
... Of course I could add "our" (or worse, also any user-specified) An IMHO better solution is to also add I'm not sure what happens if we configure with |
comment:15
Just for the record: I'll upload a new spkg that also fixes this issue at #5847 (hopefully) soon... |
comment:16
Replying to @nexttime:
not sure. GMP uses 64-bit words if available (even if the system is 32 bit), and GMP-ECM uses Paul |
comment:17
So the solution is easy: don't set any |
comment:18
Replying to @jdemeyer:
that is my advice. Same for MPFR, which also copies CFLAGS from GMP. Paul |
comment:19
Replying to @nexttime:
You know that -march=native is only supported on x86 and amd64 cpus right? |
comment:20
Replying to @kiwifb:
Not only, but ...
I was not going to try to enable SSE2 on PowerPCs (nor SPARC processors). ;-)
There's very little support for other compilers in Sage, and it's easy to add a distinction when the day it gets necessary comes, though I could add it now. |
comment:21
Replying to @nexttime:
Ok, I missed a little bit of context. I guess I didn't pay full attention to the whole thread. Sorry for the noise. |
This comment has been minimized.
This comment has been minimized.
Upstream: Fixed upstream, but not in a stable release. |
comment:23
Replying to @nexttime:
I've updated the p2 package at #5847 (some corrections, some improvements); same place, different md5sum, still or again needing testing (especially on PowerPCs) / review. See #5847 comment:86 . |
comment:24
Replying to @nexttime:
duly tested on PPC, see the other ticket. |
comment:25
Is there any reason this shouldn't be closed as a dup now? |
Changed keywords from ecm spkg-install to ecm spkg-install SSE2 |
Dependencies: #5847 |
This comment has been minimized.
This comment has been minimized.
Reviewer: Leif Leonhardy |
comment:30
for your information, this bug is fixed upstream, but we have no new release yet. The fix Paul Zimmermann |
comment:31
Replying to @zimmermann6:
Thanks. We already apply that patch (I think; from revision 1546) in the .p2 spkg at #5847. |
Merged: sage-4.7.2.alpha3 |
Changed merged from sage-4.7.2.alpha3 to none |
comment:34
this problem is fixed in GMP-ECM 6.4, which has just been released. Paul Zimmermann |
On the Skynet machine cicero and on a 32-bit Gentoo Linux Pentium D machine of my own, the ecm package from #5847 does not install in Sage.
The problem is with Sage's
spkg-install
as the pure upstream sources insrc/
work fine.The following works:
The following (emulating
spkg-install
) does NOT work:It fails with the error
It doesn't actually matter what CFLAGS is set to, it fails even with
This is probably because Sage's CFLAGS overrides ecm's CFLAGS. I think the easiest solution is simply not set any CFLAGS in ecm's
spkg-install
. Since ecm really wants to optimize for a particular machine, I think the fact that ecm's CFLAGS are not used has also bad consequences for speed.Actually an upstream bug... (And not setting
CFLAGS
orCC
is not an option. There are different ways to let the compiler produce processor-specific optimized code. Note that this anyway doesn't affect optimized assembly code, which ECM also comes with.)New spkg (ecm-6.3.p2) fixing this (including the upstream patch) at #5847.
This ticket can be closed when #5847 got merged.
Depends on #5847
Upstream: Fixed upstream, but not in a stable release.
CC: @zimmermann6 @dimpase @nexttime @mwhansen
Component: packages: standard
Keywords: ecm spkg-install SSE2
Reviewer: Leif Leonhardy
Issue created by migration from https://trac.sagemath.org/ticket/10252
The text was updated successfully, but these errors were encountered: