mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > GMP-ECM

Reply
 
Thread Tools
Old 2022-04-01, 21:50   #23
charybdis
 
charybdis's Avatar
 
Apr 2020

22·3·5·19 Posts
Default

Quote:
Originally Posted by ewmayer View Post
Sorry - too much orthogonal advice flying around. Just grabbed the 7.0.4 release, still don't see the above files:
Code:
[ewmayer@localhost ~]$ tar xjf ecm-7.0.4.tar.bz2 
...
ecm-7.0.4.tar.bz2 is not the "release tarball" that WraithX is referring to. There are four links on that page labelled "source code". Below them is one labelled "release tarball". That is the one that contains configure and install-sh. It compiles successfully for me.
charybdis is offline   Reply With Quote
Old 2022-04-01, 22:36   #24
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de Califo

1175610 Posts
Default

Quote:
Originally Posted by charybdis View Post
ecm-7.0.4.tar.bz2 is not the "release tarball" that WraithX is referring to. There are four links on that page labelled "source code". Below them is one labelled "release tarball". That is the one that contains configure and install-sh. It compiles successfully for me.
I refer to all such compressed-tarchives of e.g. my Mlucas code as "release tarballs" - but finally got the one named so under the 4 you mention, building now. Thx!

Update: Build/test/install completed successfully, but a timing-comparison for the same input and bounds shows a 10x performance hit vs 1 core of my old Haswell - Ugh. I expected "only" a 4-5x hit based on similar comparative timings for the GMP gcd on GIMPS-wavefront-sized inputs.

Last fiddled with by ewmayer on 2022-04-02 at 02:18
ewmayer is offline   Reply With Quote
Old 2022-04-27, 18:45   #25
kotenok2000
 
Mar 2018

22×3×5 Posts
Default

I grabbed 7.0.4 release from https://members.loria.fr/PZimmermann...ecm/devel.html
kotenok2000 is offline   Reply With Quote
Old 2023-09-16, 03:51   #26
PBMcL
 
PBMcL's Avatar
 
Jan 2005

2×5×7 Posts
Default Building GMP-ECM with gwnum on Ubuntu 20.04 or 22.04

I have managed to answer my own question from another thread.
Current sources are gmp-6.3.0, ecm-7.0.4, and p95v308b15.source. My systems are skylake/20.04 and Raptorlake/22.04.

0. Build GMP, if not already available. The following assumes it's installed in the /usr/local folder.
1. Build gwnum per the instructions in the p95v308b15.source/gwnum/readme.txt file. My 64-bit systems use the "make -f make64" Terminal command.
2. Switch to the ecm-7.0.4 folder and run ./configure to include gwnum. On my systems I use

./configure --with-gmp=/usr/local --with-gwnum=../p95v308b15.source/gwnum

3. (The tricky part it took me a while to figure out.) Open the (just created) makefile in the ecm-7.0.4 folder in a text editor. Search for "libgmp.a" and add the following to that line: "[gmp path]libgmp.so". On my systems the line

GMPLIB = /usr/local/lib/libgmp.a

changes to

GMPLIB = /usr/local/lib/libgmp.a /usr/local/lib/libgmp.so

Now search for "-lpthread". Where it appears on the LIBS line, add "-ldl" right after it. On my system the line becomes

LIBS = -lrt -lm -lm -lm -lm -lm ../p95v308b15.source/gwnum/gwnum.a -lpthread -ldl

Save and close the makefile. On the Terminal where you executed ./configure... for ecm-7.0.4, run 'make'.
ecm-7.04 with gwnum should now compile and link without linker errors. (We hope!)

For some reason known only to the linker gods, the libgmp.so file is only needed to resolve ONE reference, to mpz_import.

Running "make check" reveals that there's still work to do. The group order option "-go n" is broken.
PBMcL is offline   Reply With Quote
Old 2023-09-18, 22:36   #27
PBMcL
 
PBMcL's Avatar
 
Jan 2005

2·5·7 Posts
Default ecm-7.0.4 with gwnum Bug Fixes

Open /ecm-7.0.4/Fgw.c in a text editor.
Replace all of the lines from #346 to #368 (inclusive)

Code:
346>  mpz_t gw_x, gw_z, gw_A;
...
368>   mpz_init2 (gw_z, (gw_n+1)*gw_log_2(gw_b)+64);
with the following:

Code:
  mpz_t gw_x, gw_z, gw_A, tmp;
  int youpi;

  /* P->y must never be zero if/when calling ecm_mul */
  if( P->y->_mp_size == 0 )
    mpres_set_ui (P->y, 1, modulus);

  if (mpz_cmp_ui (go, 1) > 0)
    {
      mpres_t b;
      mpres_init (b, modulus);
      mpres_add_ui (b, P->A, 2, modulus);
      mpres_div_2exp (b, b, 2, modulus); /* b == (A+2)/4 */
      ecm_mul (P->x, P->y, go, modulus, b);
      mpres_clear (b, modulus);
    }
  
  outputf (OUTPUT_VERBOSE, 
           "Using gwnum_ecmStage1(%.0f, %d, %d, %d, %.0f, %ld)\n",
           gw_k, gw_b, gw_n, gw_c, B1, gw_B1done);

  /* reconstruct k*b^n+c to get true size */
  mpz_init_set_ui (tmp, gw_b);
  mpz_pow_ui (tmp, tmp, gw_n);
  mpz_mul_ui (tmp, tmp, (unsigned long)gw_k);
  if (gw_c >= 0)
    mpz_add_ui (tmp, tmp, gw_c);
  else
    mpz_sub_ui (tmp, tmp, (gw_c * -1));

  /* Allocate enough memory for any residue (mod k*b^n+c) for x, z */
  mpz_init2 (gw_x, 8*sizeof(mp_size_t)*(tmp->_mp_size));
  mpz_init2 (gw_z, 8*sizeof(mp_size_t)*(tmp->_mp_size));

Last fiddled with by kruoli on 2023-09-19 at 09:00 Reason: Done as requested.
PBMcL is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling mfaktc on Mac OS X dozba GPU Computing 23 2017-10-03 19:50
compiling GMP-ECM ATH GMP-ECM 69 2017-01-04 12:03
Help needed compiling GMP-ECM M0CZY GMP-ECM 76 2009-09-29 15:48
Compiling Phrot rogue Sierpinski/Riesel Base 5 142 2009-01-09 03:42
Compiling 24.14 CBoland Software 6 2007-08-01 00:11

All times are UTC. The time now is 10:44.


Sun Sep 24 10:44:47 UTC 2023 up 11 days, 8:27, 0 users, load averages: 1.43, 1.21, 1.00

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔