View Single Post
Old 2010-02-21, 11:05   #1
chris2be8
 
chris2be8's Avatar
 
Sep 2009

7E916 Posts
Default Problem compiling msieve with gcc 4.4.2

Hello,

Trying to install msieve on a system with gcc 4.4.2 I get the following written to stderr:
Code:
common/smallfact/gmp_ecm.c: In function ‘ecm_pp1_pm1’:
common/smallfact/gmp_ecm.c:26: warning: unused parameter ‘n’
common/smallfact/gmp_ecm.c:26: warning: unused parameter ‘reduced_n’
common/smallfact/gmp_ecm.c:27: warning: unused parameter ‘factor_list’
gnfs/ffpoly.c: In function ‘get_zeros_rec’:
gnfs/ffpoly.c:588: warning: ‘g’ may be used uninitialized in this function
ar: creating libmsieve.a
libmsieve.a(sieve.qo): In function `do_sieving':
sieve.c:(.text+0x1025): undefined reference to `qs_core_sieve_p2_64k'
sieve.c:(.text+0x20ee): undefined reference to `qs_core_sieve_p3_64k'
sieve.c:(.text+0x214f): undefined reference to `qs_core_sieve_pm_32k'
sieve.c:(.text+0x2359): undefined reference to `qs_core_sieve_k7_64k'
sieve.c:(.text+0x23e8): undefined reference to `qs_core_sieve_k7xp_64k'
collect2: ld returned 1 exit status
make: *** [x86_64] Error 1
I managed to get round it by editing sieve.c and deleting the lines that referred to those names:
Code:
 108,116c108
<       if (obj->cpu == cpu_pentium2 && sieve_block_size == 65536) {
<               logprintf(obj, &quot;using 64kb Pentium 2 sieve core\n&quot;);
<               core_sieve_fcn = qs_core_sieve_p2_64k;
<       }
<       else if (obj->cpu == cpu_pentium3 && sieve_block_size == 65536) {
<               logprintf(obj, &quot;using 64kb Pentium 3 sieve core\n&quot;);
<               core_sieve_fcn = qs_core_sieve_p3_64k;
<       }
<       else if (obj->cpu == cpu_pentium4 && sieve_block_size == 65536) {
---
>       if (obj->cpu == cpu_pentium4 && sieve_block_size == 65536) {
120,123d111
<       else if (obj->cpu == cpu_pentium_m && sieve_block_size == 32768) {
<               logprintf(obj, &quot;using 32kb Pentium M sieve core\n&quot;);
<               core_sieve_fcn = qs_core_sieve_pm_32k;
<       }
128,135d115
<       else if (obj->cpu == cpu_athlon && sieve_block_size == 65536) {
<               logprintf(obj, &quot;using 64kb Athlon sieve core\n&quot;);
<               core_sieve_fcn = qs_core_sieve_k7_64k;
<       }
<       else if (obj->cpu == cpu_athlon_xp && sieve_block_size == 65536) {
<               logprintf(obj, &quot;using 64kb Athlon XP sieve core\n&quot;);
<               core_sieve_fcn = qs_core_sieve_k7xp_64k;
<       }
Background info:
Code:
 $ gcc --version
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ uname -a
Linux localhost.localdomain 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 i686 i386 GNU/Linux

$ cat /etc/redhat-release
Fedora release 12 (Constantine)

Chris K
chris2be8 is offline   Reply With Quote