Unix and Windows Compatibility

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Unix and Windows Compatibility
# 1  
Old 03-30-2011
Unix and Windows Compatibility

Hi, I am new to this forum and I hope I am posting the thread in the right forum.

I have a huge C program running perfectly fine in 64 bit UNIX systems (runs for 5000 iterations). I want the same results while running in WINDOWS.

My current systems supports Windows 7 Professional 32 bit version. I made some changes to my makefile and ran it from command line in WINDOWS. Though the code runs, the results seem weird. I get 1.#IND (Indeterminate) and very huge floating point results in WINDOWS system. I use "double" in UNIX but the same datatype creates some problem in WINDOWS.

I would like to know if the problem is using 32 bit version and so should I shift to 64 bit version of WINDOWS to have the same compatibility?
What changes should I make to the datatypes if at all?

Thanks for your patience.
# 2  
Old 03-30-2011
The differences are due to the compiler and its limitations/freedoms in a given architecture.

If the compiler is modern try using long double datatypes instead of double.

And porting code from UNIX to Windows is often very painful, so don't feel like it is just happening to you.
# 3  
Old 03-30-2011
Thanks for the reply.

Do you think I can get any documentation to overcome these compatibility issues?

Also, I have the latest version of GCC, 4.5.2 and I view the same results (crap) with double and long double.

Surprisingly, I did not get any NaN errors in UNIX on dividing by zero but got the IND and INF errors in Windows.
# 4  
Old 03-31-2011
You can't just blindly substitute things and hope that'll fix it, if anything that'll make it worse -- these things matter. You need to track down where the problem is originating, which may have nothing to do with the calculations themselves but the things that feed values into them. It may be assuming certain things to be certain sizes when the variable types are actually totally different sizes on 32-bit machines.

Try compiling with -Wall and investigating all warnings, especially ones about truncated values.
# 5  
Old 04-03-2011
@ Corona,

Absolutely. Thanks for the reply. I also have one specific question if I should try out things in 64 bit Windows.
Do you think migrating from 64 bit Unix machine to 32 bit Windows could create problems?
# 6  
Old 04-03-2011
It's not because it's 64-bit UNIX and 32-bit Windows. It's because certain things may have depended on certain types being certain sizes, and when you change architecture, they may change. Similar problems can be had moving from 32-bit windows to 64-bit UNIX, 32-bit UNIX to 64-bit Windows, 32-bit UNIX to 64-bit UNIX, 64-bit UNIX to 32-bit UNIX, 32-bit Windows to 64-bit Windows, and 64-bit Windows to 32-bit Windows.

It's not a Windows vs UNIX thing, it's from programmers that were either sloppy or didn't know better.

A 64-bit Windows environment is still radically different from most 64-bit UNIX(lp64?) environments, presumably because Microsoft just had to be different Smilie but to track down the problems, track them down, don't just blindly mess around with it.
# 7  
Old 04-07-2011
Lol. Thanks for the reply.

I figured out the exact line of my huge code, as to where the NaN is generated. It appears to be QNaN and is propagating throughout the code. On performing a pointer arithmetic on that line, for example, "x = x + (y*z)" where x, y and z are generated as 0 in a particular iteration. And x = 0 + (0*0) gives me a NaN. From the searches I performed on the web, there is nothing which says 0*0 gives NaN and it cannot be, obviously. One possibility is infinity*0 gives NaN but when I printed 'y' and 'z', they are indeed 0.

Also, I did the same print's in my UNIX machine, and 0 + (0*0) gives 0.
Any suggestions over this? Does this imply there is any BUG in the code?

Thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

2. SCO

SCO Unix 5.0.6 SATA in compatibility mode

I am very new to SCO Unix so I apologize if this is a easy or dumb question. I have a 160GB SATA hard drive and SATA CD-ROM drive connected to one of my systems. I have both the drives running in compatibility mode. I also have the hard drive set as a primary master and the CD-ROM drive set as... (10 Replies)
Discussion started by: NPIGuy
10 Replies

3. SCO

sco unix backward compatibility on "max open file per process"

Hi How to increase maximum number of open file in "sco xenix binary" running in "sco unix openserver 5.0.7" ? I have changed "NOFILES" kernel parameter to 512, but xenix binray can't open more than 60. tnx (4 Replies)
Discussion started by: javad1_maroofi
4 Replies

4. Solaris

Compatibility between Unix & Windows

Pl. let me know whether Sun Solaris Server (Unix OS) is compatible with Windows Server or Vise Versa. Can i update the data first in Windows Server and then copied it to Sun Solaris Server or Vise Versa. (1 Reply)
Discussion started by: seemaitri
1 Replies

5. AIX

Do I need to configure my local windows to FTP files from local windows to a UNIX AIX server?

Hi Friends, I have this script for ftping files from AIX server to local windows xp. #!/bin/sh HOST='localsystem.net' USER='myid_onlocal' PASSWD='mypwd_onlocal' FILE='file.txt' ##This is a file on server(AIX) ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD put $FILE... (1 Reply)
Discussion started by: rajsharma
1 Replies

6. SCO

SCO unix binary compatibility problem

Hi I am looking for sco xenix binary compatibility utility "cvtomf",(convert omf object to COFF object) Would you please help me ? tnx (3 Replies)
Discussion started by: javad1_maroofi
3 Replies

7. UNIX for Dummies Questions & Answers

Changing windows server alias name on windows or unix?

My situation is that we have production unix scripts that ftp files over to a windows server. I'm not sure if its a 2000 or 2003 server as I dont work on server, more on the unix side. It turns out that they are changing servers on the network. So they are migrating our data over from say Server 1... (1 Reply)
Discussion started by: NycUnxer
1 Replies

8. UNIX for Dummies Questions & Answers

Linux & Unix Compatibility

I am looking for a dual XEON or any dual CPU motherboard that can support Linux and Solaris at the same time. Does anyone have any idea? I am now looking at the TYAN S2507T / TYAN S2505T / TYAN S2720, you guys have any clue?:confused: (6 Replies)
Discussion started by: doyho
6 Replies

9. UNIX for Dummies Questions & Answers

Unix & Processor compatibility

subject is self explanitory... can i install Unix on a system w/ and AMD processor (1 Reply)
Discussion started by: goliath3021
1 Replies
Login or Register to Ask a Question