X-Spam-Check-By: sourceware.org Date: Thu, 15 Feb 2007 17:23:21 -0500 (EST) From: Igor Peshansky Reply-To: cygwin AT cygwin DOT com To: winner wei cc: cygwin AT cygwin DOT com Subject: Re: is there any little-endian and big-endian issue with cygwin? In-Reply-To: <804963.79788.qm@web32401.mail.mud.yahoo.com> Message-ID: References: <804963 DOT 79788 DOT qm AT web32401 DOT mail DOT mud DOT yahoo DOT com> MIME-Version: 1.0 Content-Type: MULTIPART/Mixed; BOUNDARY="0-109371482-1171573337=:79788" Content-ID: Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --0-109371482-1171573337=:79788 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: Again, , , and reformatted. Also, there's no need to Cc: me -- I read the list (as my Reply-To: indicates). > On Thu, 15 Feb 2007, winner wei wrote: > > ----- Original Message ---- > From: Igor Peshansky > To: winner wei > Cc: cygwin AT XXXXXX DOT XXX > Sent: Thursday, February 15, 2007 2:22:33 PM > > > David, > > > > . Thanks. > > Also, reformatted. > > And again: . > > > > On Thu, 15 Feb 2007, winner wei wrote: > > > > > ----- Original Message ---- > > > From: Igor Peshansky > > > To: winner wei > > > Cc: cygwin AT XXXXXX DOT XXX > > > > . Thanks. > > > > > > On Thu, 15 Feb 2007, winner wei wrote: > > > > > > > > > My code works fine in Cygwin by command line, but when I run it > > > > > through a Java GUI launched from DOS the result is incorrect with > > > > > all the data which are not zero. The java Gui does nothing more than > > > > > launching the executables and provide a parameter file (I used the > > > > > exactly same parameter file by the command line run). So I guess if > > > > > there is any differences in the storage arrangement btw Cygwin and > > > > > DOS/Windows, or any other reason? > > > > > > > > Endianness is usually a property of the architecture[*]. Since both > > > > Cygwin and Windows run on the same architecture, there are no > > > > endianness issues. > > > > > > > > However, Cygwin and Windows do have different formats for filesystem > > > > paths, and may also have different concepts of line endings. You > > > > need to make sure that the path your Cygwin executable gets is in > > > > the format that Cygwin understands. If that is not your problem, > > > > you'll need to provide more details, and perhaps a > > > > . > > > > Igor > > > > [*] Yes, I know, except for special cases like network data layout, > > > > but we're not considering those here. > > > > > > Thank you very much, Igor. Here are two things I don't understand: > > > > > > 1, I haven't found a problem with path format at this point, suppose > > > there is one, why did command line run worked fine while the Java Gui > > > didn't? > > > > You have not provided enough information about how exactly you specify > > the path to the data file. For all I know, you may be invoking the > > program on the command line with POSIX-style path, and using > > java.io.File mechanisms to generate the path in your Java program -- > > that would definitely cause a path mismatch. But with the amount of > > detail you provided, we just don't know. You could try instrumenting > > the executable to print out the path to the data file it's getting. > > > > > 2, the parameter file (to the executable) provides input file name (hdf > > > format file), output file name, geographic coverage, warping method and > > > some other auxilliary data. when the code runs incorrectly, the data > > > points would have data like NaN, x.xE-38, I am not sure if you need more > > > to make some judges. > > > > You mentioned before that you provide the same file in both cases. > > Is that file generated anew every time, or is it a pre-existing file > > on disk? All of your previous input seemed to indicate the latter, in > > which case Java's representation of numbers should not be an issue. > > > > > By the way, I just saw another response to my question by Tim, he > > > said that Java uses big-endian and dos/win (cygwin) use little > > > endian, do you think it explained the reason? Thanks again. > > > > Again, if you re-generate the file, then Java's endianness may be the > > reason (I forgot that Java mandates big-endian representation in the > > spec for DataOutputStream). However, since you did not provide any > > details about how the numbers are written to the file, etc, we can > > only guess. > > Igor > > Thanks, Igor. > > Attached is a copy of my parameter file. I got it this way: > > The GUI works as an interface to let you type in input file and output > file name, also some other parameters, when you finish those selections, > it (GUI) will summarize your selections, at this point, we can either > save this into a parameter file for later use (quit this run, not quit > GUI) or just continue to launch the executable immediately from the GUI > (your selections is saved as a temp. file and discarded after run). The > saved param. file can be used for command line run without any changes > to it (or as a template). Again, you haven't told us what your program does with that parameter file. Is the .hdf file the same in both cases? Does .hdf contain binary data? The endianness difference between Java and C on x86 only matters for binary data. Your parameter file contains Win32-style paths, but if it's the same in both cases, that should not affect the outcome. Try to vary as little as possible (use the same input and the same parameter file) and invoke the program via the GUI and via the command line. If the invocations are different, then you'd have to go into more detail about how your GUI invokes the program and passes in the parameters. If those invocations are the same, then you'll need to investigate what's different about other factors. In short, this is the kind of problem you'd have to debug yourself, as nobody else has your specific setup, and you're not providing enough detail about the program for me, at least, to venture more guesses. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Freedom is just another word for "nothing left to lose"... -- Janis Joplin --0-109371482-1171573337=:79788 Content-Type: TEXT/PLAIN; NAME="=?utf-8?q?misr=5Fparam5x?=" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME="=?utf-8?q?misr=5Fparam5x?=" Ck5VTV9SVU5TID0gMQoKQkVHSU4KSU5QVVRfRklMRU5BTUUgPSBDOlxIRUdf ZGF0YVxNSVNSX0FNMV9BU19BRVJPU09MX1AwMzlfTzAyMzY3MF9GMDdfMDAx NS5oZGYKT0JKRUNUX05BTUUgPSBSZWdQYXJhbXNBZXJ8CkZJRUxEX05BTUUg PSBSZWdCZXN0RXN0aW1hdGVTcGVjdHJhbE9wdERlcHRofApCQU5EX05VTUJF UiA9IDEKQkFORF9OQU1FID0gU09NQmxvY2tEaW0KRk9VUlRIX0RJTSA9IDEK Rk9VUlRIX0RJTV9OQU1FID0gTkJhbmREaW0KU1BBVElBTF9TVUJTRVRfVUxf Q09STkVSID0gKCA1MC4yIC0xMTMuNyApClNQQVRJQUxfU1VCU0VUX0xSX0NP Uk5FUiA9ICggNDQuNSAtMTA4LjMgKQpSRVNBTVBMSU5HX1RZUEUgPSBOTgpP VVRQVVRfUFJPSkVDVElPTl9UWVBFID0gR0VPCkVMTElQU09JRF9DT0RFID0g V0dTODQKVVRNX1pPTkUgPSAwCk9VVFBVVF9QUk9KRUNUSU9OX1BBUkFNRVRF UlMgPSAoIDAuMCAwLjAgMC4wIDAuMCAwLjAgMC4wIDAuMCAwLjAgMC4wIDAu MCAwLjAgMC4wIDAuMCAwLjAgMC4wICApCk9VVFBVVF9QSVhFTF9TSVpFX1gg PSAxNzYwMC4wCk9VVFBVVF9QSVhFTF9TSVpFX1kgPSAxNzYwMC4wCk9VVFBV VF9GSUxFTkFNRSA9IEM6XEhFR19kYXRhXE1JU1JfQU0xX0FTX0FFUk9TT0xf UDAzOV9PMDIzNjcwX0YwN18wMDE1X1JlZ1BhcmFtc0Flcl81eG5uUTMuaGRm Ck9VVFBVVF9UWVBFID0gSERGRU9TCkVORAoK --0-109371482-1171573337=:79788 Content-Type: text/plain; charset=us-ascii -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ --0-109371482-1171573337=:79788--