Equation Solution  
    High Performance by Design
List of Blog Contents  

Page: 6
Grandpa on Multicores (2)
How Good a Speedup is Good?
Grandpa on Multicores (1)
Multiprocessing is Selective
The Mingw Port of gfortran has a Fallback of Print Malfunction

  3   4   5   6   7   8   9  

The Mingw Port of gfortran has a Fallback of Print Malfunction

[Posted by Jenn-Ching Luo on May 27, 2009 ]

        gfortran is an open source compiler under GPL. Source code is available. On mingw port, it is not always possible for us to directly compile from source codes. There may be some problems that require a fallback. "Print" function is an example. gdb (debug) can examine the correct value of a variable, but gfortran outputs a wrong value.

        The cause is that gfortran, a member of gcc, is originally developed in GNU C library, which defines the "system call" and other basic facilities. When porting gfortran to Windows, the "system call" is defined in "msvcrt.dll". Unfortunately, not every function in GNU C library has an exact correspondent function in "msvcrt.dll".

        As stated before, "print" function is an example. On mingw port, the system "sprintf" is included in "msvcrt.dll", which is unable to handle "long double" values (i.e., extended precision). There are other problems. It needs a fallback. The binaries distributed at Equation.com have a mechanism to deal "print" problems. There are other sites distributing binaries of GCC for Windows, i.e., Twilight Dragon Media (http://www.tdragon.net). I have no idea how the other sites handle "print" functions.

        Different stage of gfortran also requires a different mechanism. We cannot find one and constantly apply it. For example, fallback is minimal in the initial version of 4.3.0, and keeps growing. 64-bit and 32-bit binaries of the present version, 4.5.0, have a mechanism to deal with "print" functions.