![]() |
Compile/build guide?
I want to play around with some of the algorithms and understand the program better. Is there a build guide anywhere? I'm having so much difficulty. I have some building experience but this program has so many requirements it seems and no documentation I can find, I just run into one fault after another.
I would prefer to build the visual studio installation, but have also been trying to build the linux64 instance. |
[QUOTE=madderhatter;627923]...
the program ...[/QUOTE] Which program ? |
Prime95...I guess I accidently originally posted in a software section for other programs.
|
[QUOTE=madderhatter;627926]Prime95...I guess I accidently originally posted in a software section for other programs.[/QUOTE]
Moved to a more appropriate subforum. |
[QUOTE=madderhatter;627923]I want to play around with some of the algorithms and understand the program better. Is there a build guide anywhere? I'm having so much difficulty. I have some building experience but this program has so many requirements it seems and no documentation I can find, I just run into one fault after another.
I would prefer to build the visual studio installation, but have also been trying to build the linux64 instance.[/QUOTE] Why try to build prime95 anew, when you can simply download it prebuilt for any of several common target OSes? [url]https://www.mersenne.org/download/[/url] I for one have been using prime95 since 1996 and never built it myself from source code, although I've built some of the other GIMPS apps repeatedly. [QUOTE=S485122;627924]Which program ?[/QUOTE]+100 @OP: Welcome to the forum. Check out the GIMPS computing reference info compilation at [url]https://mersenneforum.org/showthread.php?t=24607[/url]. Including [url]https://www.mersenneforum.org/showpost.php?p=502777&postcount=1[/url] for why custom builds of prime95 are less desirable. |
[QUOTE=kriesel;627937]Why try to build prime95 anew, when you can simply download it prebuilt for any of several common target OSes?[/QUOTE]
There are actually many reasons to do this. Prove the code works. George encourages this. To share... I find it a bit amazing how much everyone fights between people who are actually on the same side. It is almost like many haven't read the prior art... And those who *have* read hope no one else has read... I feel blessed being alive. :chalsall: |
[QUOTE=kriesel;627937]Why try to build prime95 anew, when you can simply download it prebuilt for any of several common target OSes? [url]https://www.mersenne.org/download/[/url] I for one have been using prime95 since 1996 and never built it myself from source code, although I've built some of the other GIMPS apps repeatedly.
+100 @OP: Welcome to the forum. Check out the GIMPS computing reference info compilation at [url]https://mersenneforum.org/showthread.php?t=24607[/url]. Including [url]https://www.mersenneforum.org/showpost.php?p=502777&postcount=1[/url] for why custom builds of prime95 are less desirable.[/QUOTE] Well I want to play with the algorithms. I've done some math I want to try to study to maybe improve it to prove if my math is correct as well, as well as just study how the program works and allows for working with massive numbers and such. Also I like that it automatically reports if a new large prime is found right? If I'm able to adjust the algorithms to my math and my math is more efficient it will at once prove my math and prove my understanding. But stuck on this relatively simple stuff...because apparently there's no documentation I can find? I'm stuck though I can't figure out the dependencies and libraries necessary. I encounter errors related to processor and definitions not being correct currently and no idea how to proceed in both visualstudio and linux. My linux build attempts end with: /usr/bin/ld: i386 architecture of input file `../gwnum/gwnum.a(gianthlp.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `../gwnum/gwnum.a(cpuidhlp.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `../gwnum/gwnum.a(ymult3a_core.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `../gwnum/gwnum.a(ymult3ax.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `../gwnum/gwnum.a(ymult3.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `../gwnum/gwnum.a(ymult1ax_core.o)' is incompatible with i386:x86-64 output ect, a huge error list... And my visualstudio errors end with missing ; ) fatal errors. |
[QUOTE=madderhatter;627957].
My linux build attempts end with: /usr/bin/ld: i386 architecture of input file `../gwnum/gwnum.a(gianthlp.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `../gwnum/gwnum.a(cpuidhlp.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `../gwnum/gwnum.a(ymult3a_core.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `../gwnum/gwnum.a(ymult3ax.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `../gwnum/gwnum.a(ymult3.o)' is incompatible with i386:x86-64 output /usr/bin/ld: i386 architecture of input file `../gwnum/gwnum.a(ymult1ax_core.o)' is incompatible with i386:x86-64 output [/QUOTE] Is your Linux operating system 64 bits? If so run [C]make[/C] in the linux64 directory of the prime95 distribution -- I think that's the place! |
[QUOTE=madderhatter;627957]Well I want to play with the algorithms. I've done some math I want to try to study to maybe improve it to prove if my math is correct as well, as well as just study how the program works and allows for working with massive numbers and such. Also I like that it automatically reports if a new large prime is found right? If I'm able to adjust the algorithms to my math and my math is more efficient it will at once prove my math and prove my understanding. But stuck on this relatively simple stuff...because apparently there's no documentation I can find?
[/QUOTE] I strongly recommend you start with the [URL="https://pari.math.u-bordeaux.fr/"]Pari/GP interpreter[/URL] for prototyping your mathematical ideas. Then move onto learning to program C with the [URL="https://gmplib.org/"]GMP library[/URL]. Finally have a look at gwnum/gwnum.h and gwnum/giants.h with prime95 for FFT use. you might also like to look at OpenPFGW (sourceforge) which can test very large numbers for (probable) primality. I have just given up with trying to compile mprime! |
[QUOTE=paulunderwood;627958]Is your Linux operating system 64 bits? If so run [C]make[/C] in the linux64 directory of the prime95 distribution -- I think that's the place![/QUOTE]
Yes, that's where I am. I get these errors after making the cwnum library and installing all the required libraries I can find, but there's something in the code that wants to use older like 486 architecture for some reason? or something? I don't understand these errors at all. |
[QUOTE=paulunderwood;627959]I strongly recommend you start with the [URL="https://pari.math.u-bordeaux.fr/"]Pari/GP interpreter[/URL] for prototyping your mathematical ideas. Then move onto learning to program C with the [URL="https://gmplib.org/"]GMP library[/URL]. Finally have a look at gwnum/gwnum.h and gwnum/giants.h with prime95 for FFT use. you might also like to look at OpenPFGW (sourceforge) which can test very large numbers for (probable) primality.
I have just given up with trying to compile mprime![/QUOTE] Yes I think the gmp libary is one of the requirements for building right, I looked at that already a bit. |
[QUOTE=paulunderwood;627959]I strongly recommend you start with the [URL="https://pari.math.u-bordeaux.fr/"]Pari/GP interpreter[/URL] for prototyping your mathematical ideas. Then move onto learning to program C with the [URL="https://gmplib.org/"]GMP library[/URL]. Finally have a look at gwnum/gwnum.h and gwnum/giants.h with prime95 for FFT use. you might also like to look at OpenPFGW (sourceforge) which can test very large numbers for (probable) primality.
I have just given up with trying to compile mprime![/QUOTE] Will PARI/GP, handle large numbers? It doesn't sound capable enough to test what I'm looking to. |
For a 64-bit build:
In the gwnum directory, "make -f make64". In the linux directory, simply "make". |
[QUOTE=madderhatter;627957]Well I want to play with the algorithms. I've done some math I want to try to study to maybe improve it to prove if my math is correct as well, as well as just study how the program works and allows for working with massive numbers and such. Also I like that it automatically reports if a new large prime is found right? If I'm able to adjust the algorithms to my math and my math is more efficient it will at once prove my math and prove my understanding. But stuck on this relatively simple stuff...because apparently there's no documentation I can find? [/QUOTE]
Which part of the algorithms do you think you can improve? Do you think you have a (deterministic or probable) primality test faster than LL or Fermat? Do you think you can improve the FFT implementation or have a faster multiplication algorithm? |
[QUOTE=Prime95;627966]For a 64-bit build:
In the gwnum directory, "make -f make64". In the linux directory, simply "make".[/QUOTE] Yes that's what I was doing, but obviously had a lot more difficulty it wasn't that simple for me. I'll try again with -f ...I'm not sure I did that...but can you confirm for me which libraries I need? Is it possible to build it in visualstudio on windows? Ok when I go to the linux directory, I think i was in the linux64 directory before...same thing though issues with the processor/instruction set of some sort? "[ ! -e ../security.h ] && touch ../security.h || true [ ! -e ../security.c ] && touch ../security.c || true [ ! -e ../secure5.c ] && touch ../secure5.c || true gcc -I.. -I../gwnum -I/usr/local/include -std=gnu99 -Wno-unused-result -march=i486 -malign-double -O2 -DPORT=2 -c prime.c cc1: error: CPU you selected does not support x86-64 instruction set cc1: error: ‘-fcf-protection=full’ is not supported for this target make: *** [makefile:66: prime.o] Error 1 " in the linux64 directory appears to be fine until I get: _GWDATA 0x0000000001f57300 0x8800 ../gwnum/gwnum.a(mult.o) collect2: error: ld returned 1 exit status make: *** [makefile:38: mprime] Error 1 |
For a change of pace try Mlucas on linux. Build directions and more at [url]http://www.mersenneforum.org/mayer/README.html[/url] Many have succeeded in building from this. On Ubuntu, Centos, Canonical Ubuntu/WSL, etc.
Back to mprime: linux64 makefile includes the following:[CODE]# [B]Ugh, different linux variants require different makefiles.[/B] # The current makefile is for CentOS 7. We prefer to link against older Linux versions because linking on the latest, greatest version # creates an mprime executable that will not run on older Linux versions because of glibc incompatibilites. # # Some linux versions require some of the variations below: # "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" # CFLAGS = -I.. -I../gwnum -DX86_64 -O2 -Wno-unused-result # LFLAGS = -Wl,-M # LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic $(shell pkg-config --static --libs libhwloc) -Wl,-Bstatic $(shell pkg-config --static --libs libcurl) -lstdc++ -Wl,-Bdynamic -ldl [/CODE]I don't recall you telling us which flavor of Linux you're trying to build mprime on/for yet. As to -march=i486, is that old instruction set still supported in prime95? It would be very limiting, probably 4M max fft in mprime so ~79M max exponent; 2GB ram user virtual space. |
[QUOTE=kriesel;627979]For a change of pace try Mlucas on linux. Build directions and more at [url]http://www.mersenneforum.org/mayer/README.html[/url] Many have succeeded in building from this.[/QUOTE]
Oh interesting it uses the same libraries. I'll look at that thanks! |
[QUOTE=kriesel;627979]For a change of pace try Mlucas on linux. Build directions and more at [url]http://www.mersenneforum.org/mayer/README.html[/url] Many have succeeded in building from this. On Ubuntu, Centos, Canonical Ubuntu/WSL, etc.
Back to mprime: linux64 makefile includes the following:[CODE]# [B]Ugh, different linux variants require different makefiles.[/B] # The current makefile is for CentOS 7. We prefer to link against older Linux versions because linking on the latest, greatest version # creates an mprime executable that will not run on older Linux versions because of glibc incompatibilites. # # Some linux versions require some of the variations below: # "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" # CFLAGS = -I.. -I../gwnum -DX86_64 -O2 -Wno-unused-result # LFLAGS = -Wl,-M # LIBS = ../gwnum/gwnum.a ../gwnum/gwnum.ld -lm -lpthread -Wl,-Bstatic $(shell pkg-config --static --libs libhwloc) -Wl,-Bstatic $(shell pkg-config --static --libs libcurl) -lstdc++ -Wl,-Bdynamic -ldl [/CODE]I don't recall you telling us which flavor of Linux you're trying to build mprime on/for yet. As to -march=i486, is that old instruction set still supported in prime95? It would be very limiting, probably 4M max fft in mprime so ~79M max exponent; 2GB ram user virtual space.[/QUOTE] Oh ok I wasn't aware of that I was just trying ubuntu since I've used it a lot in the past. You think it would build with no problems in centOS7? |
I think installing CentOS 7 would be difficult at this point. When I tried it a year ago, because of a great deal of content having been retired from required repositories, I ended up at CentOS 8 stream instead. Linux is not my forte, but help from assorted Linux fans in the forum did not enable successful install of CentOS 7.9 that I was aiming for.
|
madderhatter, why are you trying to compile mprime? If it is to test your ideas and the numbers involved are far to high for Pari/GP to address in a reasonable amount of time, then I suggest you learn to use the GMP and GWNUM libraries.
If you could be a little more specific about your goals it might make helping you out a little easier. Are your ideas Mersenne related, Fermat PRP related or FFT related? |
[QUOTE=madderhatter;627982]Oh interesting it uses the same libraries. I'll look at that thanks![/QUOTE]
Ok I got done with the current project that was taking a lot of my time up, going to try to focus on this some more now. Yeah interesting reading on that site, I guess this is the problem I've been facing, basically prime95 wants to see a 32 bit operating system am I reading that right? " George Woltman's Prime95 program (a.k.a. mprime for the linux version), but that program is not 100% open-source. Prime95 is also only available for platforms based on the x86 processor architecture." Ok I'll switch to trying to build that then. Are there disadvantages to it vs prime95 though? Like if you discover a prime in prime95 it like automatically reports it or something, I'm not sure how exactly that works but that's what I was given to understand, does that program have the same functionality? |
[QUOTE=paulunderwood;627993]madderhatter, why are you trying to compile mprime? If it is to test your ideas and the numbers involved are far to high for Pari/GP to address in a reasonable amount of time, then I suggest you learn to use the GMP and GWNUM libraries.
If you could be a little more specific about your goals it might make helping you out a little easier. Are your ideas Mersenne related, Fermat PRP related or FFT related?[/QUOTE] You won't believe me if I tell you, I don't believe it myself, hence the test. |
[QUOTE=madderhatter;628023]You won't believe me if I tell you, I don't believe it myself, hence the test.[/QUOTE]
There's no need to be secretive. There are lots of experts here, in both mathematics and programming, who may be able to tell you whether your ideas have merit without anyone having to run a program or write a single line of code. If you're worried about potentially having made a mistake, don't be ashamed to share your ideas; many of us have thought we've discovered something new only to realise that our ideas were either flawed or already known. To err is human, and we all (well, mostly...) learn from our mistakes. |
[QUOTE=madderhatter;628023]You won't believe me if I tell you, I don't believe it myself, hence the test.[/QUOTE]
Too much Hg, eh? Now turning Pb into Au? |
[QUOTE=charybdis;628027]There's no need to be secretive. There are lots of experts here, in both mathematics and programming, who may be able to tell you whether your ideas have merit without anyone having to run a program or write a single line of code. If you're worried about potentially having made a mistake, don't be ashamed to share your ideas; many of us have thought we've discovered something new only to realise that our ideas were either flawed or already known. To err is human, and we all (well, mostly...) learn from our mistakes.[/QUOTE]
Yeah, probably 95% or more you're right, but this is a learning experience for me and I'm having fun so I might as well keep it to myself until I know for sure one way or the other. Thanks for trying to help! |
[QUOTE=madderhatter;628022]" George Woltman's Prime95 program (a.k.a. mprime for the linux version), but that program is not 100% open-source. Prime95 is also only available for platforms based on the x86 processor architecture."[/QUOTE]
For all practical purposes mprime/prime95 is open source. Do the build instructions suck? Most definitely. There is a ton of x86-assembly code involved which make the code only useful on Intel based architectures. To test new theories and ideas a strongly recommend using GMP. Yes it is not as fast, but that should not matter. You are trying to test new algorithms/theories for correctness, not speed. |
[QUOTE=Prime95;628073]You are trying to test new algorithms/theories for correctness, not speed.[/QUOTE]
Happy Easter George et al. Perhaps sometime around now (yearly) we should also celebrate the Scientific Method. 9^) |
[QUOTE=Prime95;628073]For all practical purposes mprime/prime95 is open source. Do the build instructions suck? Most definitely. There is a ton of x86-assembly code involved which make the code only useful on Intel based architectures.
To test new theories and ideas a strongly recommend using GMP. Yes it is not as fast, but that should not matter. You are trying to test new algorithms/theories for correctness, not speed.[/QUOTE] Ok thanks! |
| All times are UTC. The time now is 13:57. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.