Can I Install Fortran 95 on Windows 7 for My Computer Science Class?

  • Context: Fortran 
  • Thread starter Thread starter nlsherrill
  • Start date Start date
  • Tags Tags
    Fortran
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 3K views
nlsherrill
Messages
320
Reaction score
1
I am a student who is currently enrolled in a computer science class, and the program we are using is Fortran 95. I was wondering how I could get this program/compiler onto my own computer? I have almost no experience with programming and Fortran so I really want toget this on my own system rather than only being able to use it at school.

Basically every version of it I have used is run off of a Linux system, and you just select an icon on the desktop called "Terminal" and then use a program editor called "gedit" to write the programs. I don't know if this is how all Fortran compilers work or anything, but I am pretty sure If I got my own version it would have to work just like the ones on my school computer.

Basically, I have Window's 7 pro on my laptop. Can I get the same compiler/program for my OS that runs on the Linux system? Someone told me that you could get Linux to run on your Windows 7 OS but I don't know how to do that or how expensive any of this costs.

Any advice would be great.
 
on Phys.org
If all you want is a Linux-like environment for Fortran programming, it's best to install Cygwin. Installing Cygwin may be a bit of a headache (find guides online), but installing Linux will burn you if you're not experienced.

Cygwin gives you an Fortran programming environment nearly identical to what you'll find on the school Linux system. In the installation menu, make sure to set the group "devel" to "install". Then the gfortran compiler will be installed. An icon "Cygwin" will appear on your desktop. That's the equivalent of your "terminal". When you type "gedit", replace it with "Notepad". (Later you may want to try some other text-editors such as Notepad++ for Windows.)

Again, you need to find installation guides online. Basically apart from running setup.exe, you need to set environment variables, and you may need to run "rebase" after the install.
 
petergreat said:
If all you want is a Linux-like environment for Fortran programming, it's best to install Cygwin. Installing Cygwin may be a bit of a headache (find guides online), but installing Linux will burn you if you're not experienced.

Cygwin gives you an Fortran programming environment nearly identical to what you'll find on the school Linux system. In the installation menu, make sure to set the group "devel" to "install". Then the gfortran compiler will be installed. An icon "Cygwin" will appear on your desktop. That's the equivalent of your "terminal". When you type "gedit", replace it with "Notepad". (Later you may want to try some other text-editors such as Notepad++ for Windows.)

Again, you need to find installation guides online. Basically apart from running setup.exe, you need to set environment variables, and you may need to run "rebase" after the install.

Alright I installed Cygwin and got the Notepad up and all. Are the other commands different? Like how to I open a notepad document in the compiler and compile it and all?
 
I have no idea whether cygwin comes with gcc or not but check it out.

You use any editor (like notepad) to make the source code files and the compiler to compile it to machine code.
 
nlsherrill said:
Alright I installed Cygwin and got the Notepad up and all. Are the other commands different? Like how to I open a notepad document in the compiler and compile it and all?

1. Open Cygwin, launch Notepad
Code:
notepad hello.f90 &
2. Write a program, click file->save. Do not close Notepad, so you can continue editing later.
3. Compile
Code:
gfortran hello.f90 -o hello
If there's any error, edit the program until it compiles correctly.
4. Run it.
Code:
./hello
Hopefully you can see the output of your program.

@Santa1: Cygwin comes with the full GCC suite.