Simple .exe in Windows.

Associate
Joined
22 Jan 2005
Posts
186
In unix, I have a file, which i write in textedit, which goes something like this:

#g95 -o simple file1.f file2.f

I'll set chmod +x to create a simple executable file, and it will run the command: ie, the compiler g95 will create a unix executable file called simple.

How the heck do I do this in windows? I tried being stupid, and renaming as .exe which led to much awfulness.

Now I'm hearing something about needing to convert to binary?

Please help! Thank you :)
 
So g95 is a Fortran compiler, which im guessing means your quite old? :D

Linux uses ELF format and Windows uses EXE, they are completly different so as you suspected the simple rename would not work.

What you need is a Windows compiler for Fortran, try downloading the windows g95 complier from here: http://www.g95.org/downloads.shtml#V0.92 (Self-extracting Windows x86).

And give it your fortran file to compile, hopefully that will put you in the right direction.

EDIT: Hope i didn't misread, I kind of got the impression you wanted an executable shell script on the second read to run the g95 compiler. If this is this case, use a batch file with and point to the windows g95 compiler.
 
Last edited:
Hi tntcoder,

Thanks for your quick reply. Sorry to disappoint you but i'm a masters student :p, and I work with old fortran code (77) for my astrophysics project. I usually work it through on mac osx or linux, but the code can take a while to run sometimes, so was hoping to run in on my windows desktop. I have the g95 compiler installed.

Your second read was right, I do need a batch file!

Thank you.
 
Hi tntcoder,

Thanks for your quick reply. Sorry to disappoint you but i'm a masters student :p, and I work with old fortran code (77) for my astrophysics project. I usually work it through on mac osx or linux, but the code can take a while to run sometimes, so was hoping to run in on my windows desktop. I have the g95 compiler installed.

Your second read was right, I do need a batch file!

Thank you.

Ah cool, I forgot Fortran is still very popular in the physics world.

So for a batch file, the exact same line should work in windows if g95 is installed and just save as a .bat file and it should just work :)
 
Back
Top Bottom