[Proj] Polar stereographic,different values on different
platforms?
Eric Miller
EMiller at dfg.ca.gov
Thu Aug 21 12:59:33 EDT 2008
I did a little testing of various flavors of the Windows compiler.
We call these flavors 7, 8 and 9.
Flavor 7 is Visual Studio .Net 2003 which reports its C compiler as
"""
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
"""
Flavor 8 is Visual Studio 2005 which reports its C compiler as
"""
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
"""
Flavor 9 is Visual Studio 2008 which reports its C compiler as
"""
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
"""
Using the supplied Makefile.vc, I did two builds for each version. The "release" build uses the OPTFLAGS settings
as distributed in the source, while the "debug" build swaps the OPTFLAGS to use the second set of settings (which is commented out in the sources).
The command:
echo 105 40 | proj +proj=stere +lat_0=90 +lon_0=0 +lat_ts=70 +datum=WGS84
The Results:
Flavor 7 (debug): 5577808.93 1494569.40
Flavor 7 (release): 5610189.12 1503245.64
Flavor 8 (debug): 5577808.93 1494569.40
Flavor 8 (release): 5577808.93 1494569.40
Flavor 9 (debug): 5577808.93 1494569.40
Flavor 9 (release): 5577808.93 1494569.40
So, we can see this is a direct result of doing an optimized build with Flavor 7 (Visual Studio .Net 2003).
So, then I downloaded and installed Service Pack 1 (http://www.microsoft.com/downloads/details.aspx?familyid=69d2219f-ce82-46a5-8aec-072bd4bb955e ) and rebuilt a "release" version. The results were the same.
Then, I added the "/Op" (Improve Float Consistency) flag and then the "release" results matched the "debug" results.
OPTFLAGS= /nologo /Ox /Op /MD
--
Eric G. Miller
Staff Programmer
CA Dept. of Fish & Game
>>> On 8/21/2008 at 1:01 AM, Glynn Clements <glynn at gclements.plus.com> wrote:
> Bruce Raup wrote:
>
>> Has the problem described in the below been resolved yet? A colleague
>> of mine and I have just executed the same "proj" command on Windows
>> and Linux, and are getting different results. Windows version is Rel.
>> 4.6.1, 21 Jul 2008. Linux versions are Rel. 4.5.0, 22 Oct 2006 and
>> Rel. 4.6.0, 21 Dec 2007
>>
>> Command:
>> echo "105 40" | proj +proj=stere +lat_0=90 +lon_0=0 +lat_ts=70 +datum=WGS84
>>
>> On both Linux boxes, we get the output
>> 5577808.93 1494569.40
>>
>> On Windows, my colleague gets:
>> 5610189.12 1503245.64
>
> FWIW, PROJ 4.6.0 compiled from source on Windows with MinGW gives the
> "Linux" result above, while the version included in OSGeo4W gives the
> "Windows" result.
>
> However, I don't know if this is an issue with the compiler or the
> runtime. MinGW uses msvcrt.dll, while the OSGeo4W version uses
> msvcr71.dll. Attempting to use "-nodefaultlibs ... -lmsvcr71" with
> MinGW ends up pulling in both msvcrt.dll and msvcr71.dll.
More information about the Proj
mailing list