Problems compiling the patches on the tidbits page

Juergen Bullinger juergen.bullinger at gmx.net
Wed Sep 20 15:44:24 CEST 2006


Hello all,

I had problems compiling the development tidbits into the 4.2.1 sources.

I am running a AMD Athlon 64 system running on linux. I successfully
compiled the original sources of gmp 4.2.1. Now I wanted to recompile it
using the development tidbits provided on the swox-page.
I got some errors during the compilation/during test.

Here are the results:

* first error (get_str.c/set_str.c):

A header seems to be missing. The type powers_t is not defined. Could
somebody please provide the missing typedef or header file?

<<<<
get_str.c:305: error: expected ';', ',' or ')' before '*' token
get_str.c: In function '__gmpn_get_str':
get_str.c:382: error: 'powers_t' undeclared (first use in this function)
get_str.c:382: error: (Each undeclared identifier is reported only once
get_str.c:382: error: for each function it appears in.)
get_str.c:382: error: expected ';' before 'powtab'
get_str.c:480: error: 'powtab' undeclared (first use in this function)
get_str.c:544: error: invalid operands to binary -
make[2]: *** [get_str.lo] Fehler 1
make[2]: Leaving directory `/home/juergen/gmp/gmp-4.2.1/mpn'
make[1]: *** [all-recursive] Fehler 1
make[1]: Leaving directory `/home/juergen/gmp/gmp-4.2.1'
make: *** [all] Fehler 2
>>>>


* second error: divexact.c

divexact.h was not found. I could work around this problem by creating a
symlink in the gmp source-rootdir:

ln -s mpn/generic/divexact.h divexact.h

=> probably it would be better to fix this by using the -I-option to
help the compiler to find the header in mpn/generic.

<<<<
divexact.c  -fPIC -DPIC -o .libs/divexact.o
divexact.c:28:35: error: divexact.h: No such file or directory
make[2]: *** [divexact.lo] Fehler 1
make[2]: Leaving directory `/home/juergen/gmp/gmp-4.2.1-patched/mpz'
make[1]: *** [all-recursive] Fehler 1
make[1]: Leaving directory `/home/juergen/gmp/gmp-4.2.1-patched'
make: *** [all] Fehler 2
>>>>


* third error: "make check" complains about missing symbols which seem
to be defined in mpn/generic/qstack.c:

<<<<
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O2 -m64 -mtune=k8 -c spinner.c
-o spinner.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..
-O2 -m64 -mtune=k8 -c -o trace.lo trace.c
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O2 -m64 -mtune=k8 -c trace.c
-fPIC -DPIC -o .libs/trace.o
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O2 -m64 -mtune=k8 -c trace.c -o
trace.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile --tag=CC ../mpn/m4-ccas --m4="m4" gcc
-c -DHAVE_CONFIG_H -I. -I. -I.. -I..    -O2 -m64 -mtune=k8 `test -f
'amd64call.asm' || echo './'`amd64call.asm
 ../mpn/m4-ccas --m4=m4 gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O2
-m64 -mtune=k8 amd64call.asm  -fPIC -DPIC -o .libs/amd64call.o
m4  -DHAVE_CONFIG_H -DPIC amd64call.asm >tmp-amd64call.s
 gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O2 -m64 -mtune=k8
tmp-amd64call.s -fPIC -DPIC -o .libs/amd64call.o ../mpn/m4-ccas --m4=m4
gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O2 -m64 -mtune=k8
amd64call.asm -o amd64call.o >/dev/null 2>&1
/bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..
-O2 -m64 -mtune=k8 -c -o amd64check.lo amd64check.c
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O2 -m64 -mtune=k8 -c
amd64check.c  -fPIC -DPIC -o .libs/amd64check.o
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O2 -m64 -mtune=k8 -c
amd64check.c -o amd64check.o >/dev/null 2>&1
/bin/sh ../libtool --mode=link gcc  -O2 -m64 -mtune=k8   -o libtests.la
memory.lo misc.lo refmpf.lo refmpn.lo refmpq.lo refmpz.lo spinner.lo
trace.lo amd64call.lo amd64check.lo ../libgmp.la
ar
cq .libs/libtests.a .libs/memory.o .libs/misc.o .libs/refmpf.o .libs/refmpn.o .libs/refmpq.o .libs/refmpz.o .libs/spinner.o .libs/trace.o .libs/amd64call.o .libs/amd64check.o
ranlib .libs/libtests.a
creating libtests.la
(cd .libs && rm -f libtests.la && ln -s ../libtests.la libtests.la)
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..    -O2 -m64 -mtune=k8 -c t-bswap.c
/bin/sh ../libtool --mode=link gcc  -O2 -m64 -mtune=k8   -o t-bswap
t-bswap.o libtests.la ../libgmp.la
gcc -O2 -m64 -mtune=k8 -o .libs/t-bswap
t-bswap.o  ./.libs/libtests.a /home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so ../.libs/libgmp.so
/home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so: undefined reference
to `__gmpn_qstack_itch'
/home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so: undefined reference
to `__gmpn_hgcd_init'
/home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so: undefined reference
to `__gmpn_hgcd'
/home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so: undefined reference
to `mpn_divexact'
/home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so: undefined reference
to `__gmpn_hgcd2_fix'
/home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so: undefined reference
to `__gmpn_hgcd_init_itch'
/home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so: undefined reference
to `__gmpn_qstack_init'
/home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so: undefined reference
to `__gmpn_hgcd2_lehmer_step'
/home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so: undefined reference
to `mpn_divexact_itch'
/home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so: undefined reference
to `__gmpn_qstack_reset'
/home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so: undefined reference
to `__gmpn_hgcd_itch'
/home/juergen/gmp/gmp-4.2.1-patched/.libs/libgmp.so: undefined reference
to `__gmpn_hgcd_fix'
collect2: ld returned 1 exit status
make[4]: *** [t-bswap] Fehler 1
make[4]: Leaving directory `/home/juergen/gmp/gmp-4.2.1-patched/tests'
make[3]: *** [check-am] Fehler 2
make[3]: Leaving directory `/home/juergen/gmp/gmp-4.2.1-patched/tests'
make[2]: *** [check-recursive] Fehler 1
make[2]: Leaving directory `/home/juergen/gmp/gmp-4.2.1-patched/tests'
make[1]: *** [check-recursive] Fehler 1
make[1]: Leaving directory `/home/juergen/gmp/gmp-4.2.1-patched'
make: *** [check] Fehler 2
>>>>


If you are interested, I could create an install script for these
patches. For this script I would need some more additional info:


* What do I have to do to use the files

test-invert_2exp.c (divexact-patch)
test-divexact.c    (divexact-patch)

test-muak_div.c    (muak_div-patch)

are they meant for make test? Do I have to include them in the make
file?

* gmp-impl.h-gcd-newlines:

I guess I need to put these lines in an ifdef-branch to avoid
redefinitions, right?

thank you in advance

kind regards

Juergen Bullinger








More information about the gmp-discuss mailing list