mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   GMP-ECM (https://www.mersenneforum.org/forumdisplay.php?f=55)
-   -   compiling a static Linux gmp-ecm version (https://www.mersenneforum.org/showthread.php?t=21868)

yoyo 2016-12-25 00:05

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
[/CODE]

I wasn't able to pass the LDFLAGS to the configure command. But they were used on the make command line.

yoyo

yoyo 2016-12-25 08:13

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?

xilman 2016-12-25 10:36

[QUOTE=yoyo;449899]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?[/QUOTE]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?

yoyo 2016-12-25 11:20

The -maxmem is a relict for stage 2. I thought that memory consumption in stage 1 isn't very big.

ATH 2016-12-25 21:34

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

Here is a 64bit version you can try: [URL="hoegge.dk/mersenne/gmpecm-svn3013-core2-linux.tar.gz"]gmpecm-svn3013-core2-linux.tar.gz[/URL]

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.

yoyo 2016-12-25 22:03

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

ATH 2016-12-25 22:13

[QUOTE=yoyo;449917]Thank you.
Wat is the rease to increas the stack size from default (2M) to 16M?[/QUOTE]

Jeff Gilchrist found out long ago in this thread that it fixed certain crashes: [url]http://www.mersenneforum.org/showthread.php?t=15327[/url]

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 2016-12-25 22:31

I managed to compile a 32bit version as well: [URL="hoegge.dk/mersenne/gmpecm-svn3013-core2-linux32bit.tar.gz"]gmpecm-svn3013-core2-linux32bit.tar.gz[/URL]

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?

yoyo 2016-12-25 22:41

I use the Windows binaries from Jeff already.

What about Mac versions?

ATH 2016-12-25 22:46

Sorry I have no Mac or access to any Mac :smile: 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.


All times are UTC. The time now is 13:18.

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