[Proj] Problems with /Op option used to compile proj in Microsoft Visual Studio

support.mn at elisanet.fi support.mn at elisanet.fi
Thu Mar 15 01:22:53 EST 2012


Calogero Mauceri [mauceri at actgate.com] kirjoitti: 

> Disabling that option, the result returned in the version of proj 
> compiled with Microsoft Visual C++ 2003 is more consistent.
> Is there any reason why the /Op option is used to compile the proj?

I think that the /Op option only works with the 2003 version and what it does is as follows
(text from MSDN):

"This option improves the consistency of floating-point tests for equality and inequality by disabling optimizations that could change the precision of floating-point calculations.

By default, the compiler uses the coprocessor's 80-bit registers to hold the intermediate results of floating-point calculations. This increases program speed and decreases program size. However, because the calculation involves floating-point data types that are represented in memory by less than 80 bits, carrying the extra bits of precision (80 bits minus the number of bits in a smaller floating-point type) through a lengthy calculation can produce inconsistent results."


So it is rather obvious that MS compilers use the full 80 bit FPP registers in PC processors by default and in most cases and the reason for using that switch in the first place must be the idea to have similar performance with other ANSI compiler environments? I am not sure if this answered the question?

regards: Janne.

More information about the Proj mailing list