Question:
How to set up fortran on pc?
Stuart D
2010-12-20 10:22:37 UTC
Hi,

I have been working at university using a ssh client to connect to a server from where I create, compile and run fortran code. I am going to go away and wont have internet, but wish to continue working on my code. I downloaded PuTTy and a gfortran from the GNU project.....now what?

The gfortran folder doesnt seem to have any interface to work from, so I guess the compilers are just used by PuTTy? Also, when I open putty it wants to know host name/IP address i wish to connect to, but I dont want to connect to anywhere - I just want to be able to create compile and run simple fortran code on my pc.

So, basically....is there any free way to create, compile and run fortran code on a pc? And can you please explain (or direct me to an explanation) the basics with getting started? Im a maths/physics guy, not a computer guy so to speak.

Thanks.
Six answers:
2016-02-29 08:00:31 UTC
DJGPP and RHIDE is capable of compiling at least the newer Fortran standards depending on flags. Keep in mind this creates 32 bit apps with a 16 bit stub so you need Dosbox or a similar emulator to run them under Win64. Also, DJGPP and RHIDE are not very user friendly if you are unfamiliar with DOS and setting everything up for use under DOS. Under WinXP, Vista and Win7 you'll be running in a command window if 32 bit or Dosbox or XP mode if you are 64 bit. With Fortran, I usually just translate it to QBasic or C. The majority of programs are small enough that this isn't a huge task. I would have thought most of the useful Fortran code was translated to something more modern by now. Did you happen to try Google and see if there wasn't an equivalent available? I hope you have the programs on a PC and you can at least read them. Some of that could be on punch cards or paper tape. Shadow Wolf
Vincent G
2010-12-20 15:55:29 UTC
One you have installed gfortran, all you need is to have the PC path include where the compiler is located (or else you would have to issue the compilation command with a complete path, from the root, instead of just 'gfortran'), and issue the gfortran compilation command at the prompt in a shell (command) tool, i.e. the classic "c:" prompt utility.



You already have everything you need, as far as I can make it; I have been doing exactly that for years.

Of course, you also need an editor to write and correct your Fortran source code. For that I use emacs, but there are many more choices available.
jplatt39
2010-12-20 11:20:35 UTC
You don't NEED putty for this. You need gfortran, AND gcc, and you need cmd.exe. If you have some source code saved, check your bin folder, add the path to the bin folder to your %PATH% variable and type -- I don't use fortran much so gfortran -o myprog myprog.for replacing myprog of course with the n ame of your program If it's installed properly then you should have a myprog.exe. If not then either get MinGW:



http://www.mingw.org/



or a livecd like Knoppix:



http://www.knoppix.net -- which has gcc on Linux and I believe gfortran.You won't be able to run the executable on Windows but you can save running executables to your disk. PuTTY is an ssh client. It's an excellent one, so if you have it you can connect to the University. But you don't use it to compile. You use the command shell to compile.
?
2016-12-10 11:57:02 UTC
Fortran In Computer
Kasey C
2010-12-20 10:40:31 UTC
You got the wrong form. What you need are the "binaries".



http://gcc.gnu.org/wiki/GFortranBinaries



Putty is a terminal emulator. It is of no use to you except to remote login to your server at the university (such as you were doing with your SSH client)



---

Kasey C, PC guru since Apple II days

The gene pool could use a bit more chlorine.
2014-09-24 01:32:57 UTC
If you are searching for Roblox Alpha you can download it for free here: http://j.mp/Y2OHKu



no surveys, no scams, just the full game!

In Roblox people can create their world and learn how to build structures with different shapes, colors and functions thanks to its free accounts.

It's the best game of its category.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...