From the course: Introduction to Fortran

Initial setup: Windows - FORTRAN Tutorial

From the course: Introduction to Fortran

Initial setup: Windows

- [Instructor] Before you can start writing Fortran, there are a couple of pieces of software you'll need to have installed. You'll need a compiler, the program that turns the source code you write into instructions that your computer understands, and a text editor to actually write the source code. I'll show you how to get both installed right now. The first thing we're going to install is the compiler. Point your Web browser to equation.com. On the left-hand side, click the Programming Tools link, and then under that, the Fortran, C, C++ link, and then scroll down to the gcc-11.2.0-64.exe. Click that link to download the installer. I'll put it in my Downloads folder. I actually already have this downloaded, so I won't execute the download right now. Open your Downloads folder and double-click the .exe file you just downloaded. This will launch the installer, so just click Yes. It will start installing GFortran. Accept the license and let it install in the default location. That's just fine. Once it's done installing, just click Finish and we'll move on to the next step. Next, point your Web browser at atom.io. It should show the Windows, and click the Download button. I'll save it in my Downloads folder. Again, I've already got this downloaded, so I won't download it again. Go back to your Downloads folder and double-click the AtomSetup-x64.exe file. This launches the Atom installer and automatically begins to install Atom. It will automatically open Atom for you, but you can go ahead and close it now. Next, we can close our Web browser and our file finder. Now I will show you how to get the programming environment opened. In the search bar, you can just start typing Command Prompt, and so we'll open the Command Prompt. Once you have the Command Prompt open, you can change directories into a folder that you will keep your programs in. I've named mine learning_fortran in my home directory. Now you should be able to type atom space dot to open the Atom text editor, with that folder as the place that it opens. Once it's open, right-click on the folder in the left-hand side of the Atom text editor and click New File. I'm going to call this hello_world.f90. Now I'm going to put a program here. Start with program hello_world. The next line, print *, "Hello, World!". The next line, end program. Save the file. Ctrl+S will save, or you can come up here and do File, Save. Now, back in the Command Prompt, type the command gfortran hello_world.f90 -o hello_world.exe. This will compile the source code and create an executable named hello_world.exe. Now you can run the program by typing the name of the file that we just created, hello_world.exe. It should say hello world back to you. You should now have all of the software installed that you'll need for going through this course.

Contents