Problems when tuning GMP under MinGW

Basil Peace grv87-dev at
Wed Jun 12 19:43:58 CEST 2013

Yes, 'make tuneup.exe' works after building GMP. 'make tune' does it too and also calls created executable.

I've found that this issue was reported two years ago by Łukasz Ręcławowicz (and he also made corrections in time.c), and no solutions were made.

At this time I can say that problem is with big parameters for FFT.
By default tuneup set option_fft_max_size = 50000. Using -f [NNN] parameter, I can set up different value.
I've found that for SQR_FFT_TABLE3 maximum workable n is somewhere between 3800 and 4000.
Having mpn/mul_fft.c recompiled with TRACE defined, I got the following:


calling mpn_mul_fft with n = 3968, k = 6

calling mpn_mul_fft with n = 3952, k = 4 <- here assertion 'nprime2 < n' fails.

For MUL_FFT_TABLE3 maximal workable value is larger, but anyway smaller than 50000.

Unfortunately, by this time I can't have found any problems in fft_mul.c, but I keep trying.
Anyway, is tuneup without -f [NNN] parameter workable on Linux? May this problem be caused by compilation in 32 bits?

Basil Peace

-----Original Message-----
From: tg at [mailto:tg at] 
Sent: Friday, June 07, 2013 7:07 PM
To: Basil Peace
Cc: gmp-bugs at
Subject: Re: Problems when tuning GMP under MinGW

"Basil Peace" <grv87-dev at> writes:

  'make tuneup,exe' doesn't work as well.
  	$ make tuneup.exe
  	gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I.. -I../tests  -fexceptions  -m32 -O2 -pedantic -fomit-frame-pointer -mtune=k8 -march=
  	k8 -c tuneup.c
  	In file included from tuneup.c:114:0:
  	../gmp-impl.h:135:23: fatal error: fib_table.h: No such file or directory
  	compilation terminated.
  	make: *** [tuneup.o] Error 1
Then either you've forgotten to make a build (plan 'make' in the top build dir) or your compiler installation is broken and doesn't honour -I options.

I don't think tune/time.c will compile, though.  At least it doesn't work on my mingw test system.

  'make tune' works, as I've written.


More information about the gmp-bugs mailing list