I have a GMP problem. If this is the wrong forum I am sorry to post it here.

tsurzin tsurzin at comcast.net
Tue Feb 2 22:40:10 UTC 2016


I have a problem, I can not build the demo programs nor can I do the tuneup step. I think that it is something very basic
in my setup.  I really want to write and run C programs using GMP tools on my Skylake architecture desktop running 64 bit
Windows 10 Pro.  I could not build gmp-6.1.0 without 'make check' failing until the Skylake asm patch was posted, but I
spent a few weeks setting up and tweaking Cygwin, MinGW-w64 and Msys tool chains trying.  After I applied the patch
GMP /configure, make, make check, make install worked with no problem.  So my first problem was a bug and not a setup
problem.  I really appreciate the great GNU tools but they are all new to me and reading documentation has been unproductive
so far.  I have a programming background going back to the late fifties including many years of UNIX experience in the late
seventies and beyond but much is new in these tools.  Once I can build basic GMP programs I should be fine.  Can someone
please tell me exactly how to setup the tools so they know where to look for things?  I am sure that the documentation is
correct but it seems to be too general for me to apply it, especially things about 'prefix' and 'search path' (not $PATH)
since every tool seems to have a different idea of what they mean and how you might set or check the defaults.

Here are some details:
Per your documentation: “In particular for long-running GMP applications, and applications demanding extremely large
numbers, building and running the tuneup program in the tune subdirectory, can be important.
For example,
cd tune
make tuneup
./tuneup
will generate better contents for the gmp-mparam.h parameter file”.

However, with gmp-6.1.0 under the same D:\gmp directory, I get:
xyz at CompyGamma /cygdrive/d/gmp/cygbuild2/tune
$ make tuneup
gcc -std=gnu99 -O2 -pedantic -fomit-frame-pointer -m64 -mtune=broadwell -march=broadwell   /cygdrive/d/gmp/gmp-6.1.0/tune/tuneup.c   -o tuneup
/cygdrive/d/gmp/gmp-6.1.0/tune/tuneup.c:113:20: fatal error: config.h: No such file or directory
  #include "config.h"
                     ^
compilation terminated.
<builtin>: recipe for target 'tuneup' failed
make: *** [tuneup] Error 1

But:
xyz at CompyGamma /cygdrive/d/gmp/cygbuild2
$ ls
assert.lo       fib_table.h          mp_bases.h      mpz
assert.o        gen-bases.exe        mp_bpl.lo       nextprime.lo
compat.lo       gen-fac.exe          mp_bpl.o        nextprime.o
compat.o        gen-fib.exe          mp_clz_tab.lo   primesieve.lo
config.h        gen-jacobitab.exe    mp_clz_tab.o    primesieve.o
config.log      gen-psqr.exe         mp_dv_tab.lo    printf
config.m4       gen-trialdivtab.exe  mp_dv_tab.o     rand
config.status   gmp.h                mp_get_fns.lo   scanf
cxx             gmp-mparam.h         mp_get_fns.o    stamp-h1
demos           invalid.lo           mp_minv_tab.lo  tal-reent.lo
doc             invalid.o            mp_minv_tab.o   tal-reent.o
errno.lo        libgmp.la            mp_set_fns.lo   tests
errno.o         libtool              mp_set_fns.o    trialdivtab.h
extract-dbl.lo  Makefile             mpf             tune
extract-dbl.o   memory.lo            mpn             version.lo
fac_table.h     memory.o             mpq             version.o

xyz at CompyGamma /cygdrive/d/gmp/cygbuild2
$ ls -lat config.h
-rw-rw-r--+ 1 xyz None 20938 Jan 31 14:07 config.h

Also for cd demos I get variations of the following:
xyz at CompyGamma /cygdrive/d/gmp/cygbuild2/demos
$ make isprime
gcc -std=gnu99 -O2 -pedantic -fomit-frame-pointer -m64 -mtune=broadwell -march=broadwell    /cygdrive/d/gmp/gmp-6.1.0/demos/isprime.c   -o isprime
/tmp/cc284FAt.o:isprime.c:(.text.startup+0x2e): undefined reference to `__gmpz_init'
/tmp/cc284FAt.o:isprime.c:(.text.startup+0x2e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__gmpz_init'
/tmp/cc284FAt.o:isprime.c:(.text.startup+0x74): undefined reference to `__gmpz_set_str'
/tmp/cc284FAt.o:isprime.c:(.text.startup+0x74): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__gmpz_set_str'
/tmp/cc284FAt.o:isprime.c:(.text.startup+0x85): undefined reference to `__gmpz_probab_prime_p'
/tmp/cc284FAt.o:isprime.c:(.text.startup+0x85): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__gmpz_probab_prime_p'
/tmp/cc284FAt.o:isprime.c:(.text.startup+0x9d): undefined reference to `__gmpz_out_str'
/tmp/cc284FAt.o:isprime.c:(.text.startup+0x9d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__gmpz_out_str'
/tmp/cc284FAt.o:isprime.c:(.text.startup+0xf2): undefined reference to `__gmpz_set_str'
/tmp/cc284FAt.o:isprime.c:(.text.startup+0xf2): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__gmpz_set_str'
/tmp/cc284FAt.o:isprime.c:(.text.startup+0x108): undefined reference to `__gmpz_probab_prime_p'
/tmp/cc284FAt.o:isprime.c:(.text.startup+0x108): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__gmpz_probab_prime_p'
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'isprime' failed
make: *** [isprime] Error 1

I do not know what I have done wrong and I am too new to GNU & GMP things to call my problems bugs.

	



More information about the gmp-discuss mailing list