![]() |
|
#1
|
|||
|
|||
Porting of Linux code to windows.Hello,
I want to port FORTRAN code for linux/unix to windows. I did it at all but I can't compile one small C file because it is linux/unix specific: http://cyclone.atmos.uiuc.edu/rt/Backup/Gridder3/pregrid/util/cio.c The FORTRAN codes call the C functions in cio.c which write bytes to UNIX files. As I understand the FORTRAN codes open files, write data inside, and close them using this cio.c functions. Question: how to modify the cio.c code to compile it under windows? cio.c include <sys/ioctl.h> and <sys/uio.h> which are unix/linux specific. As I know there is no analogue of this include files under windows. Thank you very much for your ideas! Sincerely, Angel Dimitrov |
|
#2
|
|||
|
|||
|
It compiled fine for me (with the exception that there was no main(), but I'm sure you've figured that out) on Borland after removing the includes
#include <unistd.h> #include <sys/ioctl.h> #include <sys/uio.h> Although it did give a few warnings about some functions not being prototyped. |
|
#3
|
|||
|
|||
|
Quote:
The original poster didn't tell us what compiler he is using. I have had great (but not completely 100%) success compiling and executing Linux/Unix programs using Cygwin gcc. (In particular, this program compiles with no errors or warnings with Cygwin gcc on my Windows XP box, so I'm guessing that he is using something else.) For Borland bcc32 and Microsoft Visual C++ 6.0 the functions open(), creat(), lseek(), read(), write(), and close() are prototyped in <io.h> By removing the header files that you mention, and by including <io.h>, I get clean compiles with both of these. Whether everything works the same --- I couldn't say, but at least you may get something to test. Regards, Dave |
|
#4
|
|||
|
|||
open, close, write, read, lseekDear programmers,
Thank you very much for your help! I try to compile the code with Portland Group Workstation Fortran Compiler for Windows which use cygwin/mingw. Now I will try to compile the codes. Angel Dimitrov stormlab.net |
Recent GIDBlog
Stupid Management Policies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Windows and Linux, hosting plans from $2.99/year, reseller from $3/month! | hoststock | Web Hosting Advertisements & Offers | 0 | 26-Jul-2005 15:16 |
| Windows 2000 & NT source code leak | Garth Farley | Computer Software Forum - Windows | 3 | 26-Feb-2004 16:23 |
| Installing Linux with Windows ME | JdS | Computer Software Forum - Linux | 4 | 30-Apr-2003 18:47 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The