mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Linux

Reply
 
Thread Tools
Old 2017-02-08, 09:25   #1
carpetpool
 
carpetpool's Avatar
 
"Sam"
Nov 2016

11×29 Posts
Lightbulb Compile Linux version for PFGW

The Windows version, it is the newest version of PFGW. The Linux version is outdated by half a year. Is someone able to compile a Linux version of the newest version of PFGW which is 3.8.3? Thanks to someone who is advanced at Linux and can do it, I am just a beginner at it for now. I can spare CPUs on my upgraded Linux computer as I cannot for Windows. The upgrade to PFGW is listed in this thread.
carpetpool is offline   Reply With Quote
Old 2017-02-08, 21:04   #2
nordi
 
Dec 2016

3·13 Posts
Default

I gave it a try. First, the source code needs a bit of adjustment to compile:


Code:
--- pform/pfio/pfdecimalfile.cpp    (revision 642)
+++ pform/pfio/pfdecimalfile.cpp    (working copy)
@@ -2,6 +2,7 @@
 #include "pfiopch.h"
 #include <stdio.h>
 #include <string.h>
+#include <ctype.h>
 
 // also includes pffile.h but defines PFNewPGenFile class which is needed for the openInputFile() function.
 #include "pfnewpgenfile.h"
Without that, it complains about isdigit() not being defined.

But then, "make" still fails with

Code:
g++ -O3 -m64 -DX86_64 -D_64BIT  -I../../packages/gmp/64bit -I../../pfconfig/headers    \
    pform/pfgw/.libs/pfgw_main.a  pform/pfio/.libs/pfio.a pform/pfoo/.libs/pfoo.a pform/pfgwlib/.libs/pfgwlib.a \
    pform/pfmath/.libs/pfmath.a pform/pflib/.libs/pflib.a \
    packages/gmp/64bit/libgmp.a packages/gwnum/64bit/gwnum.a  -Wl,-no_pie -lpthread -lstdc++ -o pfgw64
g++: error: packages/gmp/64bit/libgmp.a: No such file or directory
g++: error: packages/gwnum/64bit/gwnum.a: No such file or directory
makefile:8: recipe for target 'pfgw64' failed
These packages are not fetched/built by the makefile.
nordi is offline   Reply With Quote
Old 2017-02-08, 21:26   #3
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

136258 Posts
Default

You need to build gwnum and gmp on your own and move the libraries to the correct folders in order for it to build. Fortunately that should be fairly easy to do.

If you can point me to the correct source file for isdigit(), I can add it to the source. I have a couple of pending changes that I haven't committed yet so I will include it with those.
rogue is offline   Reply With Quote
Old 2017-02-08, 21:40   #4
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

DB116 Posts
Default

After installing gwnum.a and libgmp.a, and adding "#include <ctype.h>", my make gets me to:

Code:
g++ -O3 -m64 -DX86_64 -D_64BIT  -I../../packages/gmp/64bit -I../../pfconfig/headers	\
	pform/pfgw/.libs/pfgw_main.a  pform/pfio/.libs/pfio.a pform/pfoo/.libs/pfoo.a pform/pfgwlib/.libs/pfgwlib.a \
	pform/pfmath/.libs/pfmath.a pform/pflib/.libs/pflib.a \
	packages/gmp/64bit/libgmp.a packages/gwnum/64bit/gwnum.a  -Wl,-no_pie -lpthread -lstdc++ -o pfgw64
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
makefile:8: recipe for target 'pfgw64' failed
make: *** [pfgw64] Error 1

Last fiddled with by paulunderwood on 2017-02-08 at 21:57
paulunderwood is offline   Reply With Quote
Old 2017-02-08, 22:03   #5
nordi
 
Dec 2016

3×13 Posts
Default

Quote:
Originally Posted by rogue View Post
If you can point me to the correct source file for isdigit()
isdigit() is already there, you just need to include it as shown in the diff.

@paulunderwood: Do you have some commands I can run? I'm trying to automate the build using a Docker container. So far, my Dockerfile is still quite modest:

Code:
FROM gcc
RUN apt-get update && apt-get install -y libgmp-dev
COPY . /usr/src/openpfgw
WORKDIR /usr/src/openpfgw
RUN make
nordi is offline   Reply With Quote
Old 2017-02-08, 22:09   #6
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

5·701 Posts
Default

I get libgmp.a from a recent installation of the latest GMP, and gwnum.a from compiling mprime -- so I guess you can wget it and make it to get GWNUM. HTH.

Last fiddled with by paulunderwood on 2017-02-08 at 22:30
paulunderwood is offline   Reply With Quote
Old 2017-02-08, 22:36   #7
nordi
 
Dec 2016

3·13 Posts
Default

I did get the libgmp.a, but cannot compile mprime:

Code:
/usr/src/mprime/linux64# make 
[ ! -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 -DX86_64 -O2  -c prime.c
gcc -I.. -I../gwnum -I/usr/local/include -DX86_64 -O2  -c menu.c
make: *** No rule to make target 'factor64.o', needed by 'mprime'.  Stop.
nordi is offline   Reply With Quote
Old 2017-02-08, 22:42   #8
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

5×701 Posts
Default

Please try make in the gwnum directory.

Code:
/Downloads/p95/gwnum$ make -f make64
gcc -I.. -DX86_64 -O2 -c cpuid.c
gcc -I.. -DX86_64 -O2 -c gwnum.c
gcc -I.. -DX86_64 -O2 -c gwtables.c
gcc -I.. -DX86_64 -O2 -c gwthread.c
gcc -I.. -DX86_64 -O2 -c gwini.c
gcc -I.. -DX86_64 -O2 -c gwutil.c
g++ -I.. -I../qd -DX86_64 -O2 -c gwdbldbl.cpp
gcc -I.. -DX86_64 -O2 -c giants.c
gcc -I.. -DX86_64 -O2 -c ecmstag1.c
cp linux64/gwnum.a .
ar -rs gwnum.a cpuid.o gwnum.o gwtables.o gwthread.o gwini.o gwutil.o gwdbldbl.o giants.o ecmstag1.o

Last fiddled with by paulunderwood on 2017-02-08 at 23:05
paulunderwood is offline   Reply With Quote
Old 2017-02-08, 23:06   #9
nordi
 
Dec 2016

478 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
Please try make in the gwnum directory.
I also tried this, it also failed:

Code:
/usr/src/mprime/gwnum# make -f make64
gcc -I.. -DX86_64 -O2 -c cpuid.c
gcc -I.. -DX86_64 -O2 -c gwnum.c
gcc -I.. -DX86_64 -O2 -c gwtables.c
gcc -I.. -DX86_64 -O2 -c gwthread.c
gcc -I.. -DX86_64 -O2 -c gwutil.c
g++ -I.. -I../qd -DX86_64 -O2 -c gwdbldbl.cpp
gcc -I.. -DX86_64 -O2 -c giants.c
gcc -I.. -DX86_64 -O2 -c ecmstag1.c
cp linux64/gwnum.a .
cp: cannot stat 'linux64/gwnum.a': No such file or directory
make64:19: recipe for target 'gwnum.a' failed
make: *** [gwnum.a] Error 1
Funny part is: There's not even a "linux64" directory in this directory. There's a linux64 directory at the top level of the project, but it also does not contain gwnum.a.
nordi is offline   Reply With Quote
Old 2017-02-08, 23:13   #10
nordi
 
Dec 2016

3·13 Posts
Default

Thanks for posting the example output! Turns out the repo on Github was missing a file. So far, it works now.
nordi is offline   Reply With Quote
Old 2017-02-08, 23:19   #11
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

5·701 Posts
Default

Quote:
Originally Posted by nordi View Post
I also tried this, it also failed:

Code:
/usr/src/mprime/gwnum# make -f make64
gcc -I.. -DX86_64 -O2 -c cpuid.c
gcc -I.. -DX86_64 -O2 -c gwnum.c
gcc -I.. -DX86_64 -O2 -c gwtables.c
gcc -I.. -DX86_64 -O2 -c gwthread.c
gcc -I.. -DX86_64 -O2 -c gwutil.c
g++ -I.. -I../qd -DX86_64 -O2 -c gwdbldbl.cpp
gcc -I.. -DX86_64 -O2 -c giants.c
gcc -I.. -DX86_64 -O2 -c ecmstag1.c
cp linux64/gwnum.a .
cp: cannot stat 'linux64/gwnum.a': No such file or directory
make64:19: recipe for target 'gwnum.a' failed
make: *** [gwnum.a] Error 1
Funny part is: There's not even a "linux64" directory in this directory. There's a linux64 directory at the top level of the project, but it also does not contain gwnum.a.
I just downloaded p95v2810.source.zip and zipinfo gives

Code:
.....
drwx---     6.3 fat      102 bx stor 16-Oct-30 14:42 gwnum/linux64/
-rw----     6.3 fat 35851474 bx defN 16-Oct-30 10:33 gwnum/linux64/gwnum.a
-rw----     6.3 fat 30960362 bx defN 16-Oct-30 10:32 gwnum/linux/gwnum.a
.....
paulunderwood is offline   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 16:52.

Wed Dec 2 16:52:04 UTC 2020 up 83 days, 14:03, 2 users, load averages: 3.26, 2.55, 2.09

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