mersenneforum.org  

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

Reply
 
Thread Tools
Old 2016-12-25, 00:05   #1
yoyo
 
yoyo's Avatar
 
Oct 2006
Berlin, Germany

659 Posts
Default compiling a static Linux gmp-ecm version

Hi,
this is the first time I try to compile gmp-ecm. I need a static linked version optimized for core2.

What is your opinion of my used configure options?

Code:
$ ./configure CC="gcc -std=gnu99" CFLAGS="-W -Wall -Wundef -O3 -pedantic -fomit-frame-pointer -m64 -mtune=core2 -march=core2"
$ make LDFLAGS="--static -static-libgcc"
$ strip ecm
$ ldd ecm
        not a dynamic executable
$ ls -l ecm
-rwxrwxr-x 1 yoyoadm yoyoadm 1948104 Dec 25 00:21 ecm
I wasn't able to pass the LDFLAGS to the configure command. But they were used on the make command line.

yoyo
yoyo is offline   Reply With Quote
Old 2016-12-25, 08:13   #2
yoyo
 
yoyo's Avatar
 
Oct 2006
Berlin, Germany

659 Posts
Default

Now the problem with ecm is, that it requires extrem amount of memore already in stage 1 for a c305:

ecm -v -timestamp -chkpnt checkpnt -maxmem 10000 -inp in -savea save 25000000000 1
GNU MP: Cannot allocate memory (size=1074003984)

Can I do something on compile/linking against it?
yoyo is offline   Reply With Quote
Old 2016-12-25, 10:36   #3
xilman
Bamboozled!
 
xilman's Avatar
 
"๐’‰บ๐’ŒŒ๐’‡ท๐’†ท๐’€ญ"
May 2003
Down not across

32·1,303 Posts
Default

Quote:
Originally Posted by yoyo View Post
Now the problem with ecm is, that it requires extrem amount of memore already in stage 1 for a c305:

ecm -v -timestamp -chkpnt checkpnt -maxmem 10000 -inp in -savea save 25000000000 1
GNU MP: Cannot allocate memory (size=1074003984)

Can I do something on compile/linking against it?
you asked for "-maxmem 10000 ". If you don't have 10 gigabytes you are likely to run into troubles. Did you mean "-maxmem 1000" perhaps?
xilman is offline   Reply With Quote
Old 2016-12-25, 11:20   #4
yoyo
 
yoyo's Avatar
 
Oct 2006
Berlin, Germany

10100100112 Posts
Default

The -maxmem is a relict for stage 2. I thought that memory consumption in stage 1 isn't very big.
yoyo is offline   Reply With Quote
Old 2016-12-25, 21:34   #5
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

23·431 Posts
Default

I got Linux installed on my old Core2Quad computer and tried to compile it.

Here is a 64bit version you can try: gmpecm-svn3013-core2-linux.tar.gz

GMP 6.1.2 is compiled with:
./configure ABI=64 CFLAGS="-O3 -m64 -march=core2 -mtune=core2" --enable-static --disable-shared
make
make install
make check

GMPECM svn 3013 compiled with:
autoreconf -i
./configure ABI=64 CFLAGS="-O3 -m64 -march=core2 -mtune=core2" CPPFLAGS="-I/usr/local/include" LDFLAGS="-static -static-libgcc -static-libstdc++" --disable-assert --enable-static --disable-shared
(added stack options, see below)
make
make ecm-params
make check
sudo make install

It would not accept the stack options the normal way in the LDFLAGS, so I opened the Makefile after the configure step. I searched for the line LIBECM_LDFLAGS and replaced the line it was in with:
LIBECM_LDFLAGS = -Wl,--stack,16777216,65536

I tried to add it to the normal LDFLAGS in the line about LIBECM_LDFLAGS in the Makefile, but it would not accept the "--stack" option in that line, I have no idea why.
ATH is offline   Reply With Quote
Old 2016-12-25, 22:03   #6
yoyo
 
yoyo's Avatar
 
Oct 2006
Berlin, Germany

659 Posts
Default

Thank you.
Wat is the reason to increase the stack size from default (2M) to 16M?

Last fiddled with by yoyo on 2016-12-25 at 22:49
yoyo is offline   Reply With Quote
Old 2016-12-25, 22:13   #7
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

344810 Posts
Default

Quote:
Originally Posted by yoyo View Post
Thank you.
Wat is the rease to increas the stack size from default (2M) to 16M?
Jeff Gilchrist found out long ago in this thread that it fixed certain crashes: http://www.mersenneforum.org/showthread.php?t=15327

I'm not sure if it is actually necessary anymore. It might also have fixed and old bug there P+1 could not use B1 > 2^32, but I do not remember exactly.
ATH is offline   Reply With Quote
Old 2016-12-25, 22:31   #8
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

23·431 Posts
Default

I managed to compile a 32bit version as well: gmpecm-svn3013-core2-linux32bit.tar.gz

Using the exact same options for GMP 6.1.2 and GMPECM except I changed ABI=64 to ABI=32 and -m64 to -m32. Though I had to install gcc-multilib to get it to accept 32bit: "sudo apt-get install gcc-multilib"


Do you need Windows binaries as well for Core2?

Last fiddled with by ATH on 2016-12-25 at 22:32
ATH is offline   Reply With Quote
Old 2016-12-25, 22:41   #9
yoyo
 
yoyo's Avatar
 
Oct 2006
Berlin, Germany

659 Posts
Default

I use the Windows binaries from Jeff already.

What about Mac versions?
yoyo is offline   Reply With Quote
Old 2016-12-25, 22:46   #10
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

23×431 Posts
Default

Sorry I have no Mac or access to any Mac and I would not know how to compile on a Mac if I did.

Make sure you test those binaries that they really are static and that the 32 bit version is really 32 bit and that they work on your test cases.
ATH is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error compiling version 29.1 on Arch Linux graysky Software 5 2017-03-22 18:20
compiling ggnfs in Linux framontb Factoring 2 2013-09-13 02:58
Linux static linked version of mprime AlsXZ Software 0 2009-10-07 14:07
Compiling new version of GMP-ECM M0CZY GMP-ECM 3 2006-05-27 09:54
which linux client should I use? static or dynamic linked one? nngs Software 2 2005-01-20 04:05

All times are UTC. The time now is 12:15.


Thu Mar 30 12:15:30 UTC 2023 up 224 days, 9:44, 0 users, load averages: 0.84, 0.69, 0.69

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.

โ‰  ยฑ โˆ“ รท ร— ยท โˆ’ โˆš โ€ฐ โŠ— โŠ• โŠ– โŠ˜ โŠ™ โ‰ค โ‰ฅ โ‰ฆ โ‰ง โ‰จ โ‰ฉ โ‰บ โ‰ป โ‰ผ โ‰ฝ โŠ โА โŠ‘ โŠ’ ยฒ ยณ ยฐ
โˆ  โˆŸ ยฐ โ‰… ~ โ€– โŸ‚ โซ›
โ‰ก โ‰œ โ‰ˆ โˆ โˆž โ‰ช โ‰ซ โŒŠโŒ‹ โŒˆโŒ‰ โˆ˜ โˆ โˆ โˆ‘ โˆง โˆจ โˆฉ โˆช โจ€ โŠ• โŠ— ๐–• ๐–– ๐–— โŠฒ โŠณ
โˆ… โˆ– โˆ โ†ฆ โ†ฃ โˆฉ โˆช โІ โŠ‚ โŠ„ โŠŠ โЇ โŠƒ โŠ… โŠ‹ โŠ– โˆˆ โˆ‰ โˆ‹ โˆŒ โ„• โ„ค โ„š โ„ โ„‚ โ„ต โ„ถ โ„ท โ„ธ ๐“Ÿ
ยฌ โˆจ โˆง โŠ• โ†’ โ† โ‡’ โ‡ โ‡” โˆ€ โˆƒ โˆ„ โˆด โˆต โŠค โŠฅ โŠข โŠจ โซค โŠฃ โ€ฆ โ‹ฏ โ‹ฎ โ‹ฐ โ‹ฑ
โˆซ โˆฌ โˆญ โˆฎ โˆฏ โˆฐ โˆ‡ โˆ† ฮด โˆ‚ โ„ฑ โ„’ โ„“
๐›ข๐›ผ ๐›ฃ๐›ฝ ๐›ค๐›พ ๐›ฅ๐›ฟ ๐›ฆ๐œ€๐œ– ๐›ง๐œ ๐›จ๐œ‚ ๐›ฉ๐œƒ๐œ— ๐›ช๐œ„ ๐›ซ๐œ… ๐›ฌ๐œ† ๐›ญ๐œ‡ ๐›ฎ๐œˆ ๐›ฏ๐œ‰ ๐›ฐ๐œŠ ๐›ฑ๐œ‹ ๐›ฒ๐œŒ ๐›ด๐œŽ๐œ ๐›ต๐œ ๐›ถ๐œ ๐›ท๐œ™๐œ‘ ๐›ธ๐œ’ ๐›น๐œ“ ๐›บ๐œ”