Skip to content
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

Update GMP-ECM to 6.3 #5847

Closed
sagetrac-mabshoff mannequin opened this issue Apr 21, 2009 · 156 comments
Closed

Update GMP-ECM to 6.3 #5847

sagetrac-mabshoff mannequin opened this issue Apr 21, 2009 · 156 comments

Comments

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Apr 21, 2009

Changes between ecm-6.2.3 and ecm-6.3:
* New assembly code for 64-bit PowerPC (thanks to Philip McLaughlin)
* Allow several processes to write to the same -save file
* More routines in new P+-1 stage 2 use multi-threading in OpenMP build
* Fixed incompatibility with GMP 5.0.0
* Fixed several bugs, and now check return value from malloc() calls
* Fixed linking of GMP which prevented successful builds under Darwin 
  (and presumably other systems)
* Allow use of x86_64 asm code under MinGW

Changes between ecm-6.2.2 and ecm-6.2.3:
* Fixed incompatibility with GMP 4.3.0 when testing version in configure
* SSE2 asm code for Visual C added in stage 2 NTT code
* Small improvement to x86_64 mulredc asm code, slight speedup on Core 2
* Fixed incorrect carry propagation in subquadratic REDC code which
  could lead to incorrect arithmetic in rare cases
* Fixed memory leak with -v parameter when factor was found in ECM stage 1
* Fixed bug which caused only one ECM curve to be run in spite of -c
  parameter if input line did not end in newline
* Assembler mulredc code enabled by default on x86_64

Changes between ecm-6.2.1 and ecm-6.2.2:
* Updated build project files for Visual C by Brian Gladman, also adds
missing NTT_GFP_TWIDDLE_DI[FT]_BREAKOVER defines in VC parameter file
* Fixed uninitialised parameter to P-1 probability computation
* In tune.c : fixed generation of NTT_GFP_TWIDDLE_DI[FT]_BREAKOVER values,
avoid calling cputime() excessively often when timing short functions,
fixed access to uninitialised memory
* Fixed serious split infinitive in configure script (thanks Paul Leyland)
* Removed unnecessary carry propagation in x86_64 mulredc code, slight
speedup (thanks Philip McLaughlin)
* Fixed non-portable PIC code in x86_64/redc.asm
* Fixed problem with pattern matching host type names in configure.in
* Converted binary constants in spv.c and ntt_gfp.c to hexadecimal,
some assembler do not support binary constants

New spkg: http://sage.math.washington.edu/home/leif/Sage/spkgs/ecm-6.3.p2.spkg

md5sum: a19f3d4d0e9881abe076d8a9c0ea7e7f ecm-6.3.p2.spkg

Apply attachment: trac_5847-module_list-fix_execstack-sagelib-rebased_to_4.7.1.alpha4.patch to the Sage library.

(Should be applied after installing the new spkg.)

Note that this patch is only required (i.e., mandatory) on some Fedora and potentially other SELinux-enabled systems, and apparently only in conjunction with more recent versions of GCC (>= 4.6).

I.e., you should be able to use the new GMP-ECM spkg on other systems without installing any patches or other spkgs.

CC: @zimmermann6 @dimpase

Component: packages: standard

Keywords: sd32 MPIR elliptic curves libecm ecm spkg

Author: Mike Hansen, Leif Leonhardy, Jeroen Demeyer

Reviewer: Leif Leonhardy, Dmitrii Pasechnik, Mariah Lenox, Maarten Derickx

Merged: sage-4.7.2.alpha3

Issue created by migration from https://trac.sagemath.org/ticket/5847

@sagetrac-mabshoff sagetrac-mabshoff mannequin added this to the sage-4.6.1 milestone Apr 21, 2009
@sagetrac-mabshoff sagetrac-mabshoff mannequin self-assigned this Apr 21, 2009
@williamstein
Copy link
Contributor

comment:1
I think you may need the latest 6.3

 ./configure --with-gmp=/usr/local/
make -j
make -j check
and it passed
without specifing where gmp/mpir is , it got very confused , , they have their
search paths mixed up.

Jason
- Hide quoted text -

On Wednesday 02 June 2010 02:59:21 Bill Hart wrote:
> There's an open ticket by Michael Abshoff to update to 6.2.2: :-)
>
> https://github.com/sagemath/sage-prod/issues/5847
>
> Bill.
>
> On 2 June 2010 02:54, Jason Moxham <jason@njkfrudils.plus.com> wrote:
> > I had forgotten about this , gmp-ecm-6.2.1 is 2 years old , what is it
> > doing in sage ? :) , they fixed it in a later release , perhaps about a
> > year ago
> >
> > Jason
> >
> > On Wednesday 02 June 2010 02:46:58 Bill Hart wrote:
> >> On 2 June 2010 02:40, William Stein <wstein@gmail.com> wrote:
> >> > Hi,
> >> >
> >> > Building Sage fails with GMP-ECM, as before.   Yes, I know this is
> >> > because of deprecation, etc...
> >>
> >> Sure. We announced a list of deprecated symbols on sage-devel and
> >> mpir-devel. Then we permanently removed mpz_random and mpz_random2
> >> *only* , the worst offenders.
> >>
> >> Bill.
> >>
> >> > ar cru .libs/libecm.a  ecm.o ecm2.o pm1.o pp1.o getprime.o listz.o
> >> > lucas.o stage2.o toomcook.o mpmod.o mul_l
> >> > o.o polyeval.o median.o schoen_strass.o ks-multiply.o rho.o bestd.o
> >> > auxlib.o random.o factor.o sp.o spv.o sp
> >> > m.o mpzspm.o mpzspv.o ntt_gfp.o ecm_ntt.o pm1fs2.o mul_fft.o
> >> > sets_long.o auxarith.otune-tune.o: In function `tune_mpres_mul':
> >> > tune.c:(.text+0xd1): undefined reference to `mpz_random'
> >> > collect2: ld returned 1 exit status
> >> > make[4]: *** [tune] Error 1
> >> > make[4]: *** Waiting for unfinished jobs....
> >> > ranlib .libs/libecm.a
> >> > creating libecm.la
> >> > (cd .libs && rm -f libecm.la && ln -s ../libecm.la libecm.la)
> >> > make[4]: Leaving directory
> >> > `/mnt/usb1/scratch/wstein/build/mpir2/sage-4.4.3.alpha1/spkg/build/ecm
> >> >-6. 2.1.p2/s rc'
> >> > make[3]: *** [all-recursive] Error 1
> >> > make[3]: Leaving directory
> >> > `/mnt/usb1/scratch/wstein/build/mpir2/sage-4.4.3.alpha1/spkg/build/ecm
> >> >-6. 2.1.p2/src' make[2]: *** [all] Error 2make[2]: Leaving directory
> >> > `/mnt/usb1/scratch/wstein/build/mpir2/sage-4.4.3.alpha1/spkg/build/ecm
> >> >-6. 2.1.p2/s rc'
> >> > There was a problem building GMP ECM.
> >> >
> >> > real    0m9.633s
> >> > user    0m8.510s
> >> > sys     0m8.950s
> >> > sage: An error occurred while installing ecm-6.2.1.p2
> >> > Please email sage-devel http://groups.google.com/group/sage-devel

@mwhansen mwhansen changed the title Update GMP-ECM to 6.2.2 Update GMP-ECM to 6.3 Aug 17, 2010
@mwhansen
Copy link
Contributor

Author: Mike Hansen

@mwhansen
Copy link
Contributor

comment:3

There is a 6.3 spkg at http://sage.math.washington.edu/home/mhansen/ecm-6.3.spkg

I've checked that it works with MPIR 2.1.1 and all tests pass.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 27, 2010

comment:4

Since Sage with MPIR 2.1.1 (#8664) requires updating to this package, I report at that ticket.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 2, 2010

comment:5

Since MPIR 2.1.1 has a bug (see #9837), I've (successfully) built and tested Sage 4.6.prealpha3 (see #9343 and the NewPARI Wiki page) with GMP 5.0.1 and this new ECM 6.3 spkg on Ubuntu 10.04 x86_64 (Core2, gcc 4.4.3; parallel build from scratch with 32 jobs; native code with O3).

ptestlong passed all tests.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 2, 2010

comment:6

It also passed ptestlong on the same machine with Sage 4.5.3.alpha2 and MPIR 2.1.1 (because the MPIR bug apparently only shows up in combination with the new PARI package, which isn't included in that Sage version).

Same for Fedora 13 x86 (Pentium 4 Prescott, gcc 4.4.4, parallel build with 6 jobs, rest dito).

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 3, 2010

Attachment: trac_5847-GMP-ECM-6.3_spkg_update-reviewer.patch.gz

Suggested changes - NOT (yet) a Mercurial patch. (Minor fixes, some comments added, some clean-up.)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 3, 2010

comment:7

I've added a reviewer patch (ordinary context diff) with some changes:

  • Remove also the manual page of previous installations.
  • Typo: rm -r -> rm -f (header file)
  • Removed setting of CXXFLAGS, since we don't have C++ code.
  • Don't overwrite CFLAGS if SAGE64=yes (instead, append). Removed -O2 -g in that case. Make use of CFLAG64 if set.
  • Quote $SAGE_LOCAL in the parameters to configure, too.
  • Use $MAKE in spkg-check, too.
  • Some messages changed (e.g. all failures now starting with "Error"), some added.
  • A few comments/notes added (SPKG.txt, spkg-install).

If you're ok with the changes, I can replace the diff with a Mercurial patch. Or simply merge them...

@nexttime
Copy link
Mannequin

nexttime mannequin commented Nov 4, 2010

Reviewer: Leif Leonhardy

@nexttime
Copy link
Mannequin

nexttime mannequin commented Nov 4, 2010

comment:8

New spkg: http://spkg-upload.googlecode.com/files/ecm-6.3.p0.spkg

md5sum: b9b1fcd5ebc2e3689fd379c1dba3a372 ecm-6.3.p0.spkg

New spkg based on Mike's with some more changes (than mentioned above).

Should be installed with the MPIR 2.1.3 spkg from #8664. See instructions there.

(Tested with Sage 4.6.1.alpha0 on Ubuntu 9.04 x86 and Ubuntu 10.04 x86_64.)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Nov 4, 2010

Changed author from Mike Hansen to Mike Hansen, Leif Leonhardy

@nexttime nexttime mannequin added t: enhancement and removed t: bug labels Nov 4, 2010
@nexttime
Copy link
Mannequin

nexttime mannequin commented Nov 4, 2010

SPKG "reviewer" patch, based on Mike's, i.e. ecm-6.3 vs. ecm-6.3.p0. For reference/review.

@jdemeyer
Copy link

jdemeyer commented Nov 4, 2010

comment:9

Attachment: trac_5847-ecm-6.3_vs._ecm-6.3.p0-spkg.patch.gz

Built and tested on sage.math.washington.edu without problems.

@nexttime nexttime mannequin assigned nexttime and unassigned sagetrac-mabshoff Nov 4, 2010
@jdemeyer
Copy link

jdemeyer commented Nov 4, 2010

comment:11

This fails to compile on my OS X 10.4 powerpc G5 machine, full log attached but here is the interesting part:

****************************************************
Host system
uname -a:
Darwin moufang.ugent.be 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power         Macintosh powerpc
****************************************************
****************************************************
CC Version
gcc -v
Using built-in specs.
Target: powerpc-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5367.obj~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man -- enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-    slibdir=/usr/lib --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5367)
****************************************************
...
checking build system type... powerpc-apple-darwin8.11.0
checking host system type... powerpc-apple-darwin8.11.0
...
configure: Configuration:
configure: Build for host type powerpc-apple-darwin8.11.0
configure: CC=gcc, CFLAGS=-g -O3  -fPIC
configure: Linking GMP with -lgmp
configure: Using asm redc code from directory powerpc64
configure: Not using SSE2 instructions in NTT code
configure: Assertions disabled
configure: Shell command execution disabled
configure: OpenMP disabled
configure: Memory debugging disabled
make  all-recursive
Making all in powerpc64
m4 -I../ -DOPERATION_mulredc1 `test -f mulredc1.asm || echo './'`mulredc1.asm >mulredc1.s
/bin/sh ../libtool   --mode=compile gcc  -g -O3  -fPIC -c -o mulredc1.lo mulredc1.s
libtool: compile:  gcc -g -O3 -fPIC -c mulredc1.s -o mulredc1.o
mulredc1.s:40:mulld instruction is only for 64-bit implementations (not allowed without -force_cpusubtype_ALL option)
mulredc1.s:41:mulhdu instruction is only for 64-bit implementations (not allowed without -force_cpusubtype_ALL option)
mulredc1.s:42:mulld instruction is only for 64-bit implementations (not allowed without -force_cpusubtype_ALL option)
mulredc1.s:43:mulld instruction is only for 64-bit implementations (not allowed without -force_cpusubtype_ALL option)
mulredc1.s:44:mulhdu instruction is only for 64-bit implementations (not allowed without -force_cpusubtype_ALL option)
mulredc1.s:47:std instruction is only for 64-bit implementations (not allowed without -force_cpusubtype_ALL option)
make[4]: *** [mulredc1.lo] Error 1
rm mulredc1.s
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
Error building GMP-ECM.

@jdemeyer
Copy link

jdemeyer commented Nov 4, 2010

Log file for failed build on OS X 10.4 powerpc G5

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

jdemeyer commented Nov 4, 2010

comment:12

Attachment: ecm-6.3.p0.log

@nexttime
Copy link
Mannequin

nexttime mannequin commented Nov 5, 2010

comment:13

Well, I think these are the relevant parts:

...
checking whether we can link against GMP... yes
checking if gmp.h version and libgmp version are the same... (5.0.1/5.0.1) yes
checking for __gmpn_add_nc... yes
checking for __gmpn_mod_34lsub1... yes
checking for __gmpn_redc_1... no
...
configure: Using asm redc code from directory powerpc64
...

So it's probably an upstream problem, either MPIR or ECM.

Or should we pass -force_cpusubtype_ALL? (To the assembler?) I think rather not.

What happens on other PPCs?

Can you try installing it with GMP 5.0.1?

@nexttime
Copy link
Mannequin

nexttime mannequin commented Nov 5, 2010

comment:14

Paul, perhaps you have an idea what's going wrong there (ECM trying to use "64-bit" instructions on MacOS X 10.4 PPC [G5], with MPIR 2.1.3).

@jdemeyer jdemeyer added this to the sage-4.7.2 milestone Jun 15, 2011
@jdemeyer
Copy link

Work Issues: rebase

@jdemeyer
Copy link

comment:119

attachment: trac_5847-module_list-fix_execstack-sagelib.patch needs to be rebased to #11377.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jun 18, 2011

comment:120

Replying to @jdemeyer:

attachment: trac_5847-module_list-fix_execstack-sagelib.patch needs to be rebased to #11377.

I can of course rebase the (one-line!) patch (or provide an alternate patch based on some later development version of Sage), but I don't really see a point in rebasing it [now] to an "unstable" version that hasn't been released or announced yet (cf. this comment).

Though positively reviewed (and independent of other tickets / spkgs), this ticket has been further postponed to Sage 4.7.2 anyway, for reasons I don't know. Doesn't make much sense to me to revert it to "needs work" at this point, also since people might want to use it or give it a try with current or older versions of Sage. (They most probably won't if it is tagged "needs work".)

@nexttime

This comment has been minimized.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jul 5, 2011

Attachment: trac_5847-module_list-fix_execstack-sagelib-rebased_to_4.7.1.alpha4.patch.gz

Sage library patch. Fixes 'execstack' issue on Fedora with GCC 4.6.0. Rebased to Sage 4.7.1.alpha4. (Cf. #11377)

@nexttime

This comment has been minimized.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jul 5, 2011

Changed work issues from rebase to none

@nexttime nexttime mannequin added s: needs review and removed s: needs work labels Jul 5, 2011
@nexttime
Copy link
Mannequin

nexttime mannequin commented Jul 5, 2011

comment:123

I've added a rebased version of the patch to module_list.py, for Sage versions >= 4.7.1.alpha4.

@koffie
Copy link

koffie commented Aug 23, 2011

Changed reviewer from Leif Leonhardy, Dima Pasechnik, Mariah Lenox to Leif Leonhardy, Dima Pasechnik, Mariah Lenox, Maarten Derickx

@koffie
Copy link

koffie commented Aug 23, 2011

comment:124

The patch now applies clean and everything passes so it again can have a positive preview.

@ohanar
Copy link
Member

ohanar commented Aug 23, 2011

comment:125

Replying to @koffie:

The patch now applies clean and everything passes so it again can have a positive preview.

I'm testing this on a few of the skynet machines as well. So far all looks good. :)

@ohanar
Copy link
Member

ohanar commented Aug 24, 2011

comment:126

Replying to @ohanar:

Replying to @koffie:

The patch now applies clean and everything passes so it again can have a positive preview.

I'm testing this on a few of the skynet machines as well. So far all looks good. :)

I've verified that all tests pass with 4.7.1 stable on all the systems mariah tested, so +1 for positive review.

@williamstein
Copy link
Contributor

Changed keywords from MPIR elliptic curves libecm ecm spkg to sd32 MPIR elliptic curves libecm ecm spkg

@nexttime

This comment has been minimized.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 12, 2011

Merged: sage-4.7.2.alpha3

@nexttime nexttime mannequin removed the s: positive review label Sep 12, 2011
@nexttime nexttime mannequin closed this as completed Sep 12, 2011
@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 23, 2011

comment:130

Had to fix some old changelog entry.

Corrected spkg at new location.

@nexttime

This comment has been minimized.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 23, 2011

Changed reviewer from Leif Leonhardy, Dima Pasechnik, Mariah Lenox, Maarten Derickx to Leif Leonhardy, Dmitrii Pasechnik, Mariah Lenox, Maarten Derickx

@zimmermann6
Copy link

comment:132

GMP-ECM 6.4 has just been released.

Paul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants