mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2016-01-18, 19:55   #1
Stargate38
 
Stargate38's Avatar
 
"Daniel Jackson"
May 2011
14285714285714285714

32×67 Posts
Question Need help compiling YAFU from SVN.

Can someone help me with compiling yafu in MinGW on Win7 64-bit? I'm using the msys terminal, and this is what comes out when I use "sh make_all-mingw.sh" (SVN 345):

Code:
Username@ComputerName-PC /c/VBox/yafu-code-345-trunk/yafu-code-345-trunk
$ sh make_all-mingw.sh
rm -f factor/qs/msieve/lanczos.o factor/qs/msieve/lanczos_matmul0.o factor/qs/msieve/lanczos_matmul1.o factor/qs/msieve/lanczos_
matmul2.o factor/qs/msieve/lanczos_pre.o factor/qs/msieve/sqrt.o factor/qs/msieve/savefile.o factor/qs/msieve/gf2.o top/driver.o
 top/utils.o top/stack.o top/calc.o top/test.o top/aprcl/mpz_aprcl.o factor/factor_common.o factor/rho.o factor/squfof.o factor/
trialdiv.o factor/tune.o factor/qs/filter.o factor/qs/tdiv.o factor/qs/tdiv_small.o factor/qs/tdiv_large.o factor/qs/tdiv_scan.o
 factor/qs/large_sieve.o factor/qs/new_poly.o factor/qs/siqs_test.o factor/tinyqs/tinySIQS.o factor/qs/siqs_aux.o factor/qs/smal
lmpqs.o factor/qs/SIQS.o factor/gmp-ecm/ecm.o factor/gmp-ecm/pp1.o factor/gmp-ecm/pm1.o factor/nfs/nfs.o arith/arith0.o arith/ar
ith1.o arith/arith2.o arith/arith3.o top/eratosthenes/count.o top/eratosthenes/offsets.o top/eratosthenes/primes.o top/eratosthe
nes/roots.o top/eratosthenes/linesieve.o top/eratosthenes/soe.o top/eratosthenes/tiny.o top/eratosthenes/worker.o top/eratosthen
es/soe_util.o top/eratosthenes/wrapper.o factor/qs/tdiv_med_32k.o factor/qs/tdiv_med_64k.o factor/qs/tdiv_resieve_32k.o factor/q
s/tdiv_resieve_64k.o factor/qs/med_sieve_32k.o factor/qs/med_sieve_64k.o factor/qs/poly_roots_32k.o factor/qs/poly_roots_64k.o f
actor/qs/update_poly_roots_32k.o factor/qs/update_poly_roots_64k.o
gcc -march=core2 -mtune=core2 -DUSE_NFS -O3 -fomit-frame-pointer -Wall  -I. -Iinclude -Itop/aprcl -I../gmp/include -I../gmp-ecm/
include -I/d/Programming/gmp-ecm/svn_2529_mw64_gmp512   -c -o factor/qs/msieve/lanczos.o factor/qs/msieve/lanczos.c
In file included from include/yafu.h:48:0,
                 from include/factor.h:24,
                 from include/lanczos.h:21,
                 from factor/qs/msieve/lanczos.c:18:
include/types.h:38:22: fatal error: intrin.h: No such file or directory
  #include <intrin.h>
                      ^
compilation terminated.
<builtin>: recipe for target `factor/qs/msieve/lanczos.o' failed
make: *** [factor/qs/msieve/lanczos.o] Error 1
rm -f factor/qs/msieve/lanczos.o factor/qs/msieve/lanczos_matmul0.o factor/qs/msieve/lanczos_matmul1.o factor/qs/msieve/lanczos_
matmul2.o factor/qs/msieve/lanczos_pre.o factor/qs/msieve/sqrt.o factor/qs/msieve/savefile.o factor/qs/msieve/gf2.o top/driver.o
 top/utils.o top/stack.o top/calc.o top/test.o top/aprcl/mpz_aprcl.o factor/factor_common.o factor/rho.o factor/squfof.o factor/
trialdiv.o factor/tune.o factor/qs/filter.o factor/qs/tdiv.o factor/qs/tdiv_small.o factor/qs/tdiv_large.o factor/qs/tdiv_scan.o
 factor/qs/large_sieve.o factor/qs/new_poly.o factor/qs/siqs_test.o factor/tinyqs/tinySIQS.o factor/qs/siqs_aux.o factor/qs/smal
lmpqs.o factor/qs/SIQS.o factor/gmp-ecm/ecm.o factor/gmp-ecm/pp1.o factor/gmp-ecm/pm1.o factor/nfs/nfs.o arith/arith0.o arith/ar
ith1.o arith/arith2.o arith/arith3.o top/eratosthenes/count.o top/eratosthenes/offsets.o top/eratosthenes/primes.o top/eratosthe
nes/roots.o top/eratosthenes/linesieve.o top/eratosthenes/soe.o top/eratosthenes/tiny.o top/eratosthenes/worker.o top/eratosthen
es/soe_util.o top/eratosthenes/wrapper.o factor/qs/tdiv_med_32k.o factor/qs/tdiv_med_64k.o factor/qs/tdiv_resieve_32k.o factor/q
s/tdiv_resieve_64k.o factor/qs/med_sieve_32k.o factor/qs/med_sieve_64k.o factor/qs/poly_roots_32k.o factor/qs/poly_roots_64k.o f
actor/qs/update_poly_roots_32k.o factor/qs/update_poly_roots_64k.o

Username@ComputerName /c/VBox/yafu-code-345-trunk/yafu-code-345-trunk
I'm new to MinGW, so I may need some help on this.
Stargate38 is offline   Reply With Quote
Old 2016-01-18, 20:20   #2
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·33·61 Posts
Default

I'm glad you decided to try this!

It's not clear that you are using mingw-64 from your post, so just a reminder that you need 64-bit mingw.

That said, it looks like there is currently at least one issue with building the most recent SVN using mingw64, although a workaround has been identified. Or you could go back in revision until it works.

Before you do any of that, you'll need to have built GMP, GMP-ECM, and MSIEVE. So if you haven't already, download those projects into parallel folders to yafu, like this, and try to build them:

Code:
top_folder
    yafu_src_folder
    msieve_src_folder
    gmp_src_folder
    gmp_ecm_src_folder
both gmp and gmp-ecm should just be a
./configure
make
make install

msieve I think has a mingw makefile. or the linux makefile could be modified.
bsquared is offline   Reply With Quote
Old 2016-01-18, 21:33   #3
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

3·577 Posts
Default

Just wanted to pop in and confirm that YAFU can be built in MinGW-64 with a little bit of finagling. I'm not going to try and write out a how-to here or anything, but if you have questions, I'll definitely try and help.
wombatman is offline   Reply With Quote
Old 2016-01-18, 23:45   #4
Stargate38
 
Stargate38's Avatar
 
"Daniel Jackson"
May 2011
14285714285714285714

32×67 Posts
Default

I can't get GMP-ECM to compile, even though I made the GMP libraries beforehand. It says "no makefile found. Stop.", and when I try using the "makefile.am" or "makefile.in" file as input, I get "makefile.am:14: *** missing separator. Stop." or "makefile.in:16: *** missing separator. Stop.". Which makefile is the right one to use, and how do I fix it? I'm using the most recent packages.
Stargate38 is offline   Reply With Quote
Old 2016-01-18, 23:51   #5
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

3·577 Posts
Default

If you mean the latest SVN version, you probably want to use the VS Studio solution, not MinGW. I'm pretty sure you're meant to do autoconf or something, and I've never had any success with MinGW doing that. Alternatively, you can use the 6.4.4 package, which comes with a working Makefile.
wombatman is offline   Reply With Quote
Old 2016-01-19, 01:01   #6
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

1101001001112 Posts
Default

Quote:
Originally Posted by Stargate38 View Post
I can't get GMP-ECM to compile, even though I made the GMP libraries beforehand. It says "no makefile found. Stop.", and when I try using the "makefile.am" or "makefile.in" file as input, I get "makefile.am:14: *** missing separator. Stop." or "makefile.in:16: *** missing separator. Stop.". Which makefile is the right one to use, and how do I fix it? I'm using the most recent packages.
Did you run ./configure? That's what creates the Makefile...
EdH is offline   Reply With Quote
Old 2016-01-19, 01:47   #7
WraithX
 
WraithX's Avatar
 
Mar 2006

1110110002 Posts
Default

Quote:
Originally Posted by Stargate38 View Post
I can't get GMP-ECM to compile, even though I made the GMP libraries beforehand. It says "no makefile found. Stop.", and when I try using the "makefile.am" or "makefile.in" file as input, I get "makefile.am:14: *** missing separator. Stop." or "makefile.in:16: *** missing separator. Stop.". Which makefile is the right one to use, and how do I fix it? I'm using the most recent packages.
If you have downloaded the latest GMP-ECM svn, then you need to run autoreconf -i before running ./configure

You will need to run these commands inside of an MSYS shell. I use the MSYS that you can get from here:
http://sourceforge.net/projects/ming...nary-packages/
Download the 2013-05-15 version and extract it somewhere, I have mine extracted to c:\msys-20130515\. It contains autoreconf under \bin. Actually, my folder has several autoreconf's. If the included one doesn't work let us know and we can try to help find a recent version that will work. Also, after extracting the MSYS environment, be sure to edit the c:\msys-20130515\etc\profile file and set the following:
Code:
if [ $MSYSTEM == MINGW32 ]; then
#  export PATH=".:/usr/local/bin:/mingw/bin:/bin:$PATH"
  export PATH=".:/c/mingw64-20141222/bin:/usr/local/bin:/bin:$PATH"
else
  export PATH=".:/usr/local/bin:/bin:/mingw/bin:$PATH"
fi
Of course, change the PATH so that it points to where you have your MinGW64 located. Then, run the MSYS environment by double-clicking msys.bat in your MSYS folder. Then you can cd into the GMP-ECM directory and do:
Code:
autoreconf -i
./configure (you may want to add the --disable-assert option)
make
make check
make check is useful to make sure your copy of GMP-ECM is working. Let us know if you need any more details, or if you run into any problems with this.
WraithX is offline   Reply With Quote
Old 2016-01-19, 15:37   #8
Stargate38
 
Stargate38's Avatar
 
"Daniel Jackson"
May 2011
14285714285714285714

32×67 Posts
Default

I ran "./Configure --disable-assert", but it said it couldn't find gmp.h, even though I copied it into the GMP-ECM source directory.

Last fiddled with by Stargate38 on 2016-01-19 at 15:42
Stargate38 is offline   Reply With Quote
Old 2016-01-19, 15:42   #9
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2×33×61 Posts
Default

Leave gmp.h where it was and run this to configure gmp-ecm:

./configure --with-gmp=<gmpdir>

BTW, this info is in the INSTALL readme file in the gmp-ecm package.
bsquared is offline   Reply With Quote
Old 2016-01-19, 17:04   #10
Stargate38
 
Stargate38's Avatar
 
"Daniel Jackson"
May 2011
14285714285714285714

25B16 Posts
Default

OK. I got ECM to compile, but now I'm doing Msieve, and I'm getting the following errors:

Code:
c:/mingw-w64/x86_64-5.3.0-posix-seh-rt_v4-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bi
n/ld.exe: cannot find -lecm
c:/mingw-w64/x86_64-5.3.0-posix-seh-rt_v4-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bi
n/ld.exe: cannot find -ldl
c:/mingw-w64/x86_64-5.3.0-posix-seh-rt_v4-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bi
n/ld.exe: cannot find -lgmp
Collect2.exe: error: ld returned 1 exit status
makefile: 274: recipe for target 'all' failed
make: *** [all] Error 1
Stargate38 is offline   Reply With Quote
Old 2016-01-20, 01:26   #11
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

348710 Posts
Default

Msieve only very recently was ported to run in 64-bit windows, and that used MSYS2 not the old Msys with mingw64. The makefile expects a prebuilt GMP and GMP-ECM library in the default library path. I don't know if mingw-w64 has a libdl.a anywhere, it may be 32-bit only.

Edit: actually you don't need the demo binary that gets created, only libmsieve.a to link into YAFU, and you got past that point so you can probably ignore the compile error and move on to building the YAFU binary.

Last fiddled with by jasonp on 2016-01-20 at 01:34
jasonp is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling YAFU for Windows using mingw bsquared YAFU 59 2020-08-21 16:31
Running YAFU via Aliqueit doesn't find yafu.ini EdH YAFU 8 2018-03-14 17:22
Guide to compiling YAFU Mr. Odd YAFU 4 2017-04-24 15:40
Compiling YAFU under MinGW wombatman YAFU 10 2016-01-21 19:48
Compiling 24.14 CBoland Software 6 2007-08-01 00:11

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

Tue Oct 20 07:13:36 UTC 2020 up 40 days, 4:24, 0 users, load averages: 1.39, 1.58, 1.58

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.