Prof A Olowofoyeku wrote:
On 13 Nov 2007 at 9:05, pascaltomath@yahoo.fr wrote:
Dear All;
I have tested the Kevan Hashemi's program, on SuSE Linux 10.2 running with AMD Athlon X2 CPU.
GNU Pascal 20070904; compiled with GCC 4.1.2 [the latest snapshot], and, compiled with GCC 3.4.6, with the same option << enable languages C, C++, Pascal>> yield the correct results.
On Win XP platform, with MinGW using GCC 3.4.5, it does not.
I must add that, the testing part of NTL which belongs to the "Timings" does not give correct results on MinGW.
But, on Cygwin with GCC 3.4.4, the testing part runs in a perfect manner.
When you build and use NTL on MinGW without paying attention to the errors of its test program, there is not also any conflict at all thereafter.
Perhaps you may wish to compile a similar C program with gcc ? This is to ascertain whether the problem is in the Mingw libraries. If it is, then you need to report it to the Mingw maintainers.
To get GPC runtime tries to use the 'gettimeofday' function if available, otherwise the 'time' function is used. I think that the 'gettimeofday' is not available in MinGW or at least GPC can not detect it. To check if GPC detected 'gettimeofday' one could look at p/rts/rts-config.h file generated during build and check if it contains line:
#define HAVE_GETTIMEOFDAY 1
If not GPC will use 'time' function which has limited resolution: it can not return microsecond part.
One solution is to ask Mingw maintainers to provide 'gettimeofday'. Alternatively, we can look for appropriate native Windows function...