mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Linux

Reply
 
Thread Tools
Old 2017-02-08, 23:55   #12
nordi
 
Dec 2016

7×11 Posts
Default

@paulunderwood: I worked around the -lgcc_s problem you had. Remove the " -Wl,-no_pie" option from the makefile. It seems "ld" only has "-pie", not "-no_pie".
nordi is offline   Reply With Quote
Old 2017-02-09, 00:59   #13
nordi
 
Dec 2016

7·11 Posts
Default

I have a pretty well-automated version now: To build PFGW with Docker, get and extract the sources of PFGW. In the directory with the sources, create a Dockerfile with this content:
Code:
FROM gcc
RUN apt-get update && apt-get install -y libgmp-dev wget unzip

RUN mkdir /usr/src/mprime && \
    cd /usr/src/mprime && \ 
    # openpfgw insists on version 28.6
    wget -O mprime.zip --quiet https://www.mersenne.org/ftp_root/gimps/p95v286.source.zip && \
    # unzip produces some warnings and therefore has exit code 1.
    unzip mprime.zip ; \
    rm mprime.zip
RUN cd /usr/src/mprime/gwnum && \
    make -j -f make64

COPY . /usr/src/openpfgw
WORKDIR /usr/src/openpfgw
RUN cp /usr/lib/x86_64-linux-gnu/libgmp.a packages/gmp/64bit/
RUN cp /usr/src/mprime/gwnum/gwnum.a packages/gwnum/64bit/gwnum.a
RUN sed -i 's/-Wl,-no_pie//g' makefile

RUN make -j
Run "docker build -t pfgw ." (mind the dot at the end) to build a new image. Then "docker run -it pfgw" to start a container with that image. The executable is at /usr/src/openpfgw/pfgw64 and it actually works.

This assumes "#include <ctype.h>" fix to PFGW is already applied.
nordi is offline   Reply With Quote
Old 2017-02-09, 01:59   #14
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

2·13·149 Posts
Default

Thanks for the tips, nordi

Incidentally, I added gwset_num_threads ( &gwdata, 4 ); to every line with gwinit2(&gwdata, sizeof(gwhandle), (char *) GWNUM_VERSION); and got a multi-threaded PFGW working at 300% on my Haswell 4770k. Good for speedy proofs, but not so good for overall number-crunching throughput
paulunderwood is offline   Reply With Quote
Old 2017-02-09, 11:31   #15
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

172216 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
Thanks for the tips, nordi

Incidentally, I added gwset_num_threads ( &gwdata, 4 ); to every line with gwinit2(&gwdata, sizeof(gwhandle), (char *) GWNUM_VERSION); and got a multi-threaded PFGW working at 300% on my Haswell 4770k. Good for speedy proofs, but not so good for overall number-crunching throughput
It is more efficient the larger the FFT. There would be people using it if this feature was added to the main source. Please do rouge.
A larger fft can fit in the L3 cache with 1x4threads than 4x1threads
henryzz is offline   Reply With Quote
Old 2021-09-01, 11:20   #16
bur
 
bur's Avatar
 
Aug 2020
79*6581e-4;3*2539e-3

13·31 Posts
Default

I tried compiling the sources from sourceforge, but get the following error:
Code:
g++: error: packages/gwnum/64bit/gwnum.a: File or directory not found
make: *** [makefile:8: pfgw64] Error 1
The gwnum/64bit/ directory is indeed empty. Any idea how to get it to compile? Or is it unnceccessary anyway and I should just use the precompiled binaries? I have an i9-10900k.
bur is offline   Reply With Quote
Old 2021-09-01, 12:44   #17
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

2·3·29·37 Posts
Default

Quote:
Originally Posted by bur View Post
I tried compiling the sources from sourceforge, but get the following error:
Code:
g++: error: packages/gwnum/64bit/gwnum.a: File or directory not found
make: *** [makefile:8: pfgw64] Error 1
The gwnum/64bit/ directory is indeed empty. Any idea how to get it to compile? Or is it unnceccessary anyway and I should just use the precompiled binaries? I have an i9-10900k.
You have to d/l gwnum separately. This is part of Prime95, so d/l the Prime95 source. You will likely need to build the 64-bit Linux version of gwnum.a (if it isn't included) then copy to the directory specified above. There should be a linux makefile in the Prime95 sources.
rogue is online now   Reply With Quote
Old 2021-09-01, 17:13   #18
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

2×3×19×67 Posts
Default

Quote:
Originally Posted by rogue View Post
You have to d/l gwnum separately. This is part of Prime95, so d/l the Prime95 source. You will likely need to build the 64-bit Linux version of gwnum.a (if it isn't included) then copy to the directory specified above. There should be a linux makefile in the Prime95 sources.
In the gwnum directory, type "make -f make64"
Prime95 is online now   Reply With Quote
Old 2021-09-02, 06:08   #19
bur
 
bur's Avatar
 
Aug 2020
79*6581e-4;3*2539e-3

13·31 Posts
Default

Ok, thanks, it worked.

Are there any flags I could use to optimize e.g. for avx2? The makefile didn't look like it, but I'm far from being an expert there.
bur is offline   Reply With Quote
Old 2021-09-02, 16:22   #20
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

2·3·29·37 Posts
Default

Quote:
Originally Posted by bur View Post
Ok, thanks, it worked.

Are there any flags I could use to optimize e.g. for avx2? The makefile didn't look like it, but I'm far from being an expert there.
No. gwnum will choose the best FFT based upon the available hardware. If the best FFT uses AVX2, then it will use that FFT. If AVX2 is not available, then any FFT that requires AVX2 will not be used.
rogue is online now   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
(Open)PFGW 32 bit linux Rincewind Software 0 2016-03-10 09:18
PFGW latest well-tested version mdettweiler Conjectures 'R Us 109 2010-09-29 20:20
Linux newpgen pfgw llr jasong Linux 10 2008-02-16 23:55
src2414 how to compile 64 bit in Linux Unregistered Software 1 2005-08-22 13:19
How to Compile mprime Under Linux Blaise Pascal Software 12 2005-01-13 14:40

All times are UTC. The time now is 00:20.


Tue Oct 26 00:20:05 UTC 2021 up 94 days, 18:49, 0 users, load averages: 1.78, 1.54, 1.94

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.