-   Msieve (
-   -   Problem compiling msieve with gcc 4.4.2 (

chris2be8 2010-02-21 11:05

Problem compiling msieve with gcc 4.4.2

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
[/code]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) {
< 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;
< }
< 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;
< }
[/code]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
[/code]$ uname -a
Linux localhost.localdomain #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

jasonp 2010-02-21 14:22

Did you build using 'make x86_64' and then try to rebuild using 'make x86'? My first thought is that the different make targets depend on different sets of files, and the makefile does not know that object files depending on the old files need to be rebuilt.

When switching make targets, you have to 'make clean' first. Does that fix anything?

chris2be8 2010-02-21 21:32

No, in the test above I did &quot;make&quot; which got messages saying choose a target, then &quot;make x86_64&quot; which failed as above.

I've just done a test:
rm -r msieve-1.44
tar xvf factoring\ tools/msieve144.tar.gz
cd msieve-1.44
make x86_64

And got the same set of error messages.

Chris K

PS. I forgot to say in the first post that I've tried msieve 1.4.1, 1.4.2 and 1.4.3 as well as 1.4.4 (every version I have downloaded) and got the same error for them all.

jasonp 2010-02-21 22:07

Your uname output says you're running 32-bit x86; using the x86_64 make target will ignore 32-bit x86 functions and build only 64-bit ones. You should be using 'make x86'.

chris2be8 2010-02-22 17:41

You're right, make x86 works.

The next problem is to work out why installing off the DVD I used put a 32 bit Linux onto it without telling me I was installing a 32 bit OS on 64 bit hardware. But that's not your issue.

Chris K

debrouxl 2010-02-22 18:35

Installing a 32-bit OS on a 64-bit-capable processor Just Works (TM): for backwards compatibility, the processor does not start in 64-bit mode, AFAIK.
I have never come across a distro whose installer contains a dialog like
"I have detected that your hardware is 64-bit-capable, but this is the 32-bit version.
64-bit will get you better performance, but some badly coded programs [you'd have to compile them yourself, our repositories are <supposed to be> clean] will not work properly.
Do you want to stop the install process now and get a chance to obtain <somehow> a 64-bit copy ?"

BTW: you may end up with a cleaner install (that is, less stuff that you don't need and duplicate stuff) if you install from either the Gnome install CD or the KDE install CD, both of which have a more restricted package set.

All times are UTC. The time now is 02:34.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.