mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2021-04-21, 13:54   #23
kruoli
 
kruoli's Avatar
 
"Oliver"
Sep 2017
Porta Westfalica, DE

32×5×11 Posts
Default

It looks like there are still some libraries missing? Msieve is version 1.53.

Code:
gcc -O3 -march=native -DUSE_AVX2 -DUSE_SSE41 -DUSE_SSE2 -DUsenFS -I../ytools -I../ysieve -Iinclude -Ifactor -Itop/cmdParser -I. -I../gmpecm -I../gmp-6.2.1 -Itop/aprcl -L../ytools -L../ysieve top/driver.o top/test.o factor/tune.o factor/autofactor.o top/cmdParser/cmdOptions.o top/cmdParser/calc.o -o yafu -lysiqs  -lyecm  -lynfs -L../../ysieve.git/trunk -L../../ytools.git/trunk -L. -L../gmp/lib/ -L../gmp-ecm/lib/ -L../msieve-1.53 -lmsieve ../gmpecm/.libs/libecm.a ../gmp-6.2.1/.libs/libgmp.a -lytools -lysieve -lpthread -lm -ldl
/usr/bin/ld: factor/autofactor.o: in function `schedule_work':
autofactor.c:(.text+0x2233): undefined reference to `snfs_find_form'
/usr/bin/ld: autofactor.c:(.text+0x2319): undefined reference to `snfs_find_form'
/usr/bin/ld: autofactor.c:(.text+0x238e): undefined reference to `est_gnfs_size_via_poly'
/usr/bin/ld: factor/autofactor.o: in function `factor':
autofactor.c:(.text+0x4001): undefined reference to `snfs_find_form'
/usr/bin/ld: ./libysiqs.a(SIQS.o): in function `siqs_static_init':
SIQS.c:(.text+0x4e65): undefined reference to `resieve_medprimes_32k_avx2'
/usr/bin/ld: SIQS.c:(.text+0x4e73): undefined reference to `tdiv_medprimes_32k_avx2'
/usr/bin/ld: SIQS.c:(.text+0x4e8f): undefined reference to `med_sieveblock_32k_avx2'
/usr/bin/ld: SIQS.c:(.text+0x4ea7): undefined reference to `nextRoots_32k_avx2'
/usr/bin/ld: SIQS.c:(.text+0x5363): undefined reference to `nextRoots_32k_sse41'
/usr/bin/ld: SIQS.c:(.text+0x5371): undefined reference to `med_sieveblock_32k_sse41'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `snfs_init':
snfs.c:(.text+0xa9): undefined reference to `mpz_polys_init'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `snfs_clear':
snfs.c:(.text+0x145): undefined reference to `mpz_polys_free'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `print_snfs':
snfs.c:(.text+0x76e): undefined reference to `print_poly'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `snfs_test_sieve':
snfs.c:(.text+0x28a7): undefined reference to `IGNOrenFS_ABORT'
/usr/bin/ld: snfs.c:(.text+0x28b0): undefined reference to `test_sieve'
/usr/bin/ld: snfs.c:(.text+0x28b6): undefined reference to `IGNOrenFS_ABORT'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `approx_norms':
snfs.c:(.text+0x2e53): undefined reference to `ggnfs_table'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `gen_xyyxf_poly':
snfs.c:(.text+0x3c14): undefined reference to `mpz_polys_free'
/usr/bin/ld: snfs.c:(.text+0x4657): undefined reference to `mpz_polys_free'
/usr/bin/ld: snfs.c:(.text+0x4727): undefined reference to `mpz_polys_free'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `gen_brent_poly':
snfs.c:(.text+0x5e66): undefined reference to `mpz_polys_free'
/usr/bin/ld: snfs.c:(.text+0x5eed): undefined reference to `mpz_polys_free'
/usr/bin/ld: ./libynfs.a(snfs.o):snfs.c:(.text+0x6296): more undefined references to `mpz_polys_free' follow
/usr/bin/ld: ./libynfs.a(snfs.o): in function `skew_snfs_params':
snfs.c:(.text+0x8c1): undefined reference to `get_ggnfs_params'
/usr/bin/ld: ../msieve-1.53/libmsieve.a(savefile.o): in function `savefile_open':
savefile.c:(.text+0x118): undefined reference to `gzopen64'
/usr/bin/ld: savefile.c:(.text+0x21b): undefined reference to `gzopen64'
/usr/bin/ld: savefile.c:(.text+0x251): undefined reference to `gzopen64'
/usr/bin/ld: ../msieve-1.53/libmsieve.a(savefile.o): in function `savefile_close':
savefile.c:(.text+0x2f1): undefined reference to `gzclose'
/usr/bin/ld: ../msieve-1.53/libmsieve.a(savefile.o): in function `savefile_write_line':
savefile.c:(.text+0x3d0): undefined reference to `gzputs'
/usr/bin/ld: ../msieve-1.53/libmsieve.a(savefile.o): in function `savefile_flush':
savefile.c:(.text+0x454): undefined reference to `gzputs'
/usr/bin/ld: ../msieve-1.53/libmsieve.a(savefile.o): in function `savefile_eof':
savefile.c:(.text+0x321): undefined reference to `gzeof'
/usr/bin/ld: ../msieve-1.53/libmsieve.a(savefile.o): in function `savefileread_line':
savefile.c:(.text+0x36c): undefined reference to `gzgets'
/usr/bin/ld: ../msieve-1.53/libmsieve.a(savefile.o): in function `savefilerewind':
savefile.c:(.text+0x491): undefined reference to `gzrewind'
collect2: error: ld returned 1 exit status
make: *** [Makefile:424: yafu] Error 1
kruoli is offline   Reply With Quote
Old 2021-04-21, 14:03   #24
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·32·191 Posts
Default

It should be -DUSE_NFS to define yafu's nfs functions (not -DUsenFS). Also, I usually build msieve with NO_ZLIB; otherwise you might have to find/build/link a zlib library.
bsquared is offline   Reply With Quote
Old 2021-04-21, 14:08   #25
kruoli
 
kruoli's Avatar
 
"Oliver"
Sep 2017
Porta Westfalica, DE

32×5×11 Posts
Default

The call was make CC=gcc CFLAGS="-O3 -march=native -DUSE_AVX2 -DUSE_SSE41 -DUSE_SSE2 -DUSE_NFS -I../ytools -I../ysieve -Iinclude -Ifactor -Itop/cmdParser -I. -I../gmpecm -I../gmp-6.2.1 -Itop/aprcl -L../ytools -L../ysieve" NFS=1. The small letters came from an extension in my browser (there are also a lot of identifiers that got mixed up on posting). I double checked this in the compilation output and it is fine there. I'll try again using NO_ZLIB.

Last fiddled with by kruoli on 2021-04-21 at 14:14 Reason: Additions.
kruoli is offline   Reply With Quote
Old 2021-04-21, 14:13   #26
kruoli
 
kruoli's Avatar
 
"Oliver"
Sep 2017
Porta Westfalica, DE

7578 Posts
Default

Having -DNO_ZLIB or NO_ZLIB=1, it gives:
Code:
gcc -O3 -march=native -DUSE_AVX2 -DUSE_SSE41 -DUSE_SSE2 -DUSE_NFS -DNO_ZLIB -I../ytools -I../ysieve -Iinclude -Ifactor -Itop/cmdParser -I. -I../gmpecm -I../gmp-6.2.1 -Itop/aprcl -L../ytools -L../ysieve -c -o factor/qs/msieve/lanczos.o factor/qs/msieve/lanczos.c
In file included from include/factor.h:28,
                 from include/qs_impl.h:23,
                 from include/lanczos.h:21,
                 from factor/qs/msieve/lanczos.c:18:
include/msieve_common.h:6: warning: "NO_ZLIB" redefined
 #define NO_ZLIB

<command-line>: note: this is the location of the previous definition
In file included from include/factor.h:28,
                 from include/qs_impl.h:23,
                 from include/lanczos.h:21,
                 from factor/qs/msieve/lanczos.c:18:
include/msieve_common.h:35:5: error: unknown type name ‘gzFile’
     gzFile* fp;
     ^~~~~~
In file included from include/qs_impl.h:20,
                 from include/lanczos.h:21,
                 from factor/qs/msieve/lanczos.c:18:
include/monty.h:86:19: warning: inline function ‘_umul128’ declared but never defined
 __inline uint64_t _umul128(uint64_t x, uint64_t y, uint64_t* hi);
                   ^~~~~~~~
make: *** [Makefile:449: factor/qs/msieve/lanczos.o] Error 1
kruoli is offline   Reply With Quote
Old 2021-04-21, 14:28   #27
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·32·191 Posts
Default

Sorry, I meant I build msieve with NO_ZLIB=1.

You might still have to point to a zlib.h. msieve has one; I have this in my makefile
"-I../../msieve/zlib"
bsquared is offline   Reply With Quote
Old 2021-04-21, 14:42   #28
kruoli
 
kruoli's Avatar
 
"Oliver"
Sep 2017
Porta Westfalica, DE

32×5×11 Posts
Default

Quote:
Originally Posted by bsquared View Post
Sorry, I meant I build msieve with NO_ZLIB=1.
Blast! You wrote that, I was not paying enough attention. I thought that I already had compiled msieve using that option; to make sure, I just recompiled it and then ran the yafu-compile again. Indeed, some of the errors vanished, so my brain failed me yet again. But there are still a lot of undefined references:
Code:
/usr/bin/ld: factor/autofactor.o: in function `schedule_work':
autofactor.c:(.text+0x2233): undefined reference to `snfs_find_form'
/usr/bin/ld: autofactor.c:(.text+0x2319): undefined reference to `snfs_find_form'
/usr/bin/ld: autofactor.c:(.text+0x238e): undefined reference to `est_gnfs_size_via_poly'
/usr/bin/ld: factor/autofactor.o: in function `factor':
autofactor.c:(.text+0x4001): undefined reference to `snfs_find_form'
/usr/bin/ld: ./libysiqs.a(SIQS.o): in function `siqs_static_init':
SIQS.c:(.text+0x4e65): undefined reference to `resieve_medprimes_32k_avx2'
/usr/bin/ld: SIQS.c:(.text+0x4e73): undefined reference to `tdiv_medprimes_32k_avx2'
/usr/bin/ld: SIQS.c:(.text+0x4e8f): undefined reference to `med_sieveblock_32k_avx2'
/usr/bin/ld: SIQS.c:(.text+0x4ea7): undefined reference to `nextRoots_32k_avx2'
/usr/bin/ld: SIQS.c:(.text+0x5363): undefined reference to `nextRoots_32k_sse41'
/usr/bin/ld: SIQS.c:(.text+0x5371): undefined reference to `med_sieveblock_32k_sse41'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `snfs_init':
snfs.c:(.text+0xa9): undefined reference to `mpz_polys_init'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `snfs_clear':
snfs.c:(.text+0x145): undefined reference to `mpz_polys_free'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `print_snfs':
snfs.c:(.text+0x76e): undefined reference to `print_poly'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `snfs_test_sieve':
snfs.c:(.text+0x28a7): undefined reference to `IGNORE_NFS_ABORT'
/usr/bin/ld: snfs.c:(.text+0x28b0): undefined reference to `test_sieve'
/usr/bin/ld: snfs.c:(.text+0x28b6): undefined reference to `IGNORE_NFS_ABORT'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `approx_norms':
snfs.c:(.text+0x2e53): undefined reference to `ggnfs_table'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `gen_xyyxf_poly':
snfs.c:(.text+0x3c14): undefined reference to `mpz_polys_free'
/usr/bin/ld: snfs.c:(.text+0x4657): undefined reference to `mpz_polys_free'
/usr/bin/ld: snfs.c:(.text+0x4727): undefined reference to `mpz_polys_free'
/usr/bin/ld: ./libynfs.a(snfs.o): in function `gen_brent_poly':
snfs.c:(.text+0x5e66): undefined reference to `mpz_polys_free'
/usr/bin/ld: snfs.c:(.text+0x5eed): undefined reference to `mpz_polys_free'
/usr/bin/ld: ./libynfs.a(snfs.o):snfs.c:(.text+0x6296): more undefined references to `mpz_polys_free' follow
/usr/bin/ld: ./libynfs.a(snfs.o): in function `skew_snfs_params':
snfs.c:(.text+0x8c1): undefined reference to `get_ggnfs_params'
collect2: error: ld returned 1 exit status
make: *** [Makefile:424: yafu] Error 1
kruoli is offline   Reply With Quote
Old 2021-04-21, 14:50   #29
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

2·32·191 Posts
Default

Ok, no worries. At least now the undefined references are all in yafu.

From your build line earlier it looks like they should be getting included. The best bet in situations like this is to start fresh. Do a make clean with your CFLAGS line included. You want to make sure all files, including those built only when AVX2 and NFS are enabled, are reset. Then try building yafu again.
bsquared is offline   Reply With Quote
Old 2021-04-21, 15:25   #30
kruoli
 
kruoli's Avatar
 
"Oliver"
Sep 2017
Porta Westfalica, DE

32·5·11 Posts
Default

Wonderful, we are getting nearer. The list of undefined references is getting smaller and smaller:
Code:
gcc -O3 -march=native -DUSE_AVX2 -DUSE_SSE41 -DUSE_SSE2 -DUSE_NFS -I../ytools -I../ysieve -Iinclude -Ifactor -Itop/cmdParser -I. -I../gmpecm -I../gmp-6.2.1 -Itop/aprcl -L../ytools -L../ysieve top/driver.o top/test.o factor/tune.o factor/autofactor.o top/cmdParser/cmdOptions.o top/cmdParser/calc.o -o yafu -lysiqs  -lyecm  -lynfs -L../../ysieve.git/trunk -L../../ytools.git/trunk -L. -L../gmp/lib/ -L../gmp-ecm/lib/ -L../msieve-1.53 -lmsieve ../gmpecm/.libs/libecm.a ../gmp-6.2.1/.libs/libgmp.a -lytools -lysieve -lpthread -lm -ldl
/usr/bin/ld: ./libysiqs.a(SIQS.o): in function `siqs_static_init':
SIQS.c:(.text+0x4e65): undefined reference to `resieve_medprimes_32k_avx2'
/usr/bin/ld: SIQS.c:(.text+0x4e73): undefined reference to `tdiv_medprimes_32k_avx2'
/usr/bin/ld: SIQS.c:(.text+0x4e8f): undefined reference to `med_sieveblock_32k_avx2'
/usr/bin/ld: SIQS.c:(.text+0x4ea7): undefined reference to `nextRoots_32k_avx2'
/usr/bin/ld: SIQS.c:(.text+0x5363): undefined reference to `nextRoots_32k_sse41'
/usr/bin/ld: SIQS.c:(.text+0x5371): undefined reference to `med_sieveblock_32k_sse41'
collect2: error: ld returned 1 exit status
make: *** [Makefile:424: yafu] Error 1
I cleaned (with the flags included), built, cleaned again the same way, and built again, but that did not improve the results further.
kruoli is offline   Reply With Quote
Old 2021-04-21, 15:49   #31
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

D6E16 Posts
Default

Ah, I see why now.

I set up the makefile to build certain files conditionally. So when you set CFLAGS directly, that indicates that you have AVX2, but the AVX2-enabled files are not conditionally included.

Change your build line to
make yafu USE_AVX2=1 NFS=1 CC=gcc CFLAGS=...

The USE_AVX2=1 option to make will compile the needed files and also add the -DUSE_AVX2 and -DUSE_SSE41 identifiers to CFLAGS, so you can leave them out of your CFLAGS line. Also NFS=1 adds the -DUSE_NFS line, so you can leave that out of your CFLAGS line as well.

Sorry for the confusion, hope that helps.
bsquared is offline   Reply With Quote
Old 2021-04-21, 16:06   #32
kruoli
 
kruoli's Avatar
 
"Oliver"
Sep 2017
Porta Westfalica, DE

32×5×11 Posts
Default

Magnificent!

Now I have a functioning YAFU binary; thank you very much for the personal help.

I altered the make command as you suggested, but had to leave the explicit -D.. flags in the CFLAGS argument for some reason. Without them, there were errors. I also tried specifying CFLAGS before and after USE_AVX2=1, but still it could not find some things. So after I had -DUSE_AVX2 plus USE_AVX=1 (etc.), it worked.
kruoli is offline   Reply With Quote
Old 2021-04-21, 17:14   #33
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

1101011011102 Posts
Default

Quote:
Originally Posted by kruoli View Post
Magnificent!

Now I have a functioning YAFU binary; thank you very much for the personal help.

I altered the make command as you suggested, but had to leave the explicit -D.. flags in the CFLAGS argument for some reason. Without them, there were errors. I also tried specifying CFLAGS before and after USE_AVX2=1, but still it could not find some things. So after I had -DUSE_AVX2 plus USE_AVX=1 (etc.), it worked.
You're welcome!

I think what happened is that when you put a CFLAGS line as an input to make, it must ignore any CFLAGS stuff that happens in the makefile. Command line takes precedence, I guess. If you were to build without any CFLAGS input line, then I think my method would also work (That's how I build it.... just "make yafu NFS=1 USE_AVX2=1") You are not doing anything wrong; glad you found something that works.

If you don't mind sharing - what is your cpu? Just curious if you could try any of the AVX-512 code.
bsquared is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
yafu ignoring yafu.ini chris2be8 YAFU 6 2019-10-17 16:22
Running YAFU via Aliqueit doesn't find yafu.ini EdH YAFU 8 2018-03-14 17:22
YAFU-1.34 bsquared YAFU 119 2015-11-05 16:24
Yafu bug. storflyt32 YAFU 2 2015-06-29 05:19
yafu 1.32 bsquared YAFU 28 2012-07-20 16:17

All times are UTC. The time now is 08:33.

Fri May 14 08:33:53 UTC 2021 up 36 days, 3:14, 0 users, load averages: 2.48, 2.72, 2.38

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.