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

25116 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

59310 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

290616 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 online now   Reply With Quote
Old 2016-12-25, 11:20   #4
yoyo
 
yoyo's Avatar
 
Oct 2006
Berlin, Germany

593 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

3·17·59 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

25116 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

300910 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

3·17·59 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

10010100012 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

3·17·59 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 13:09.

Tue Jan 19 13:09:09 UTC 2021 up 47 days, 9:20, 0 users, load averages: 1.74, 1.47, 1.45

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, 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.