{"id":2976040,"date":"2011-10-18T00:29:58","date_gmt":"2011-10-18T10:29:58","guid":{"rendered":"https:\/\/math.hawaii.edu\/wordpress\/?p=2976040"},"modified":"2013-10-18T03:26:10","modified_gmt":"2013-10-18T13:26:10","slug":"fortran-install","status":"publish","type":"post","link":"https:\/\/math.hawaii.edu\/wordpress\/fortran-install\/","title":{"rendered":"Fortran: Install"},"content":{"rendered":"\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tTo download and install GNU Fortran into Windows, download into your c:\\ directory the four files\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><a href=\"http:\/\/math.hawaii.edu\/lab\/197\/g77exe.zip\">g77exe.zip<\/a><\/td>\n\t\t\t\t\t\t\t\t\t\t<td width=\"100\"><\/td>\n\t\t\t\t\t\t\t\t\t\t<td><a href=\"http:\/\/math.hawaii.edu\/lab\/197\/g77doc.zip\">g77doc.zip<\/a><\/td>\n\t\t\t\t\t\t\t\t\t\t<td width=\"10\"><\/td>\n\t\t\t\t\t\t\t\t\t\t<td><\/td>\n\t\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td><a href=\"http:\/\/math.hawaii.edu\/lab\/197\/g77lib.zip\">g77lib.zip<\/a><\/td>\n\t\t\t\t\t\t\t\t\t\t<td><\/td>\n\t\t\t\t\t\t\t\t\t\t<td><a href=\"http:\/\/math.hawaii.edu\/lab\/197\/unzip.zip\">unzip.zip<\/a><\/td>\n\t\t\t\t\t\t\t\t\t\t<td><\/td>\n\t\t\t\t\t\t\t\t\t\t<td>.<\/td>\n\t\t\t\t\t\t\t\t\t<\/tr>\n\t\t\t\t\t\t\t\t<\/table>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tGet a command prompt and go to the root directory on your c drive by entering\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<pre class=\"brush: bash;\">cd c:\\<\/pre>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tChange the name of unzip.zip to unzip.exe by entering\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<pre class=\"brush: bash; first-line: 2;\">ren unzip.zip unzip.exe<\/pre>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tNext unzip the three zipped files by entering in succession\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<pre class=\"brush: bash; first-line: 3;\">\n\t\t\t\t\t\t\t\t\tunzip g77exe.zip\n\t\t\t\t\t\t\t\t\tunzip g77lib.zip\n\t\t\t\t\t\t\t\t\tunzip g77doc.zip<\/pre>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tThe three files will unzip into a g77 directory, divided into three subdirectories named g77\\bin, g77\\lib, and g77\\doc.\n\t\t\t\t\t\t\t\t<\/p>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tFortran is run from the g77\\bin directory. It is simplest to save all your Fortran programs to this same directory. To get into this directory from a DOS prompt, enter\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<pre class=\"brush: bash; first-line: 6;\">\n\t\t\t\t\t\t\t\t\tcd c:\\g77\\bin<\/pre>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tThen, to compile for example the file hello.f, enter\n\n\t\t\t\t\t\t\t\t\t<pre class=\"brush: bash; first-line: 7;\">g77 hello.f<\/pre>\n\n\n\t\t\t\t\t\t\t\t\tFortran creates a compiled file that it names a.exe. To run this file from the g77\\bin directory just enter\n\t\t\t\t\t\t\t\t<\/p>\n\n\n\t\t\t\t\t\t\t\t<pre class=\"brush: bash; first-line: 8;\">a<\/pre>\n\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tIf you want to give the compiled file a name of your own choosing, say such as hello.exe, then compile it with the command\n\t\t\t\t\t\t\t\t<\/p>\n\t\t\t\t\t\t\t\t<pre class=\"brush: bash; first-line: 9;\">g77 hello.f -o hello.exe<\/pre>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t(Any name you give a compiled file must end with the extension .exe.)\n\t\t\t\t\t\t\t\t<\/p>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tOn your home computer probably the easiest editor for creating Fortran source files is the DOS editor. Open a DOS window, go to the g77\\bin directory (as above), and enter \"edit\". The DOS editor will open and you can type your source file. When you save the file, just name it whatever.f and it will automatically be saved to the g77\\bin directory (by default, since that is the directory from which you opened the DOS editor). You do not have to enclose the name in quotes, as you do in saving with Notepad.\n\t\t\t\t\t\t\t\t<\/p>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tPerhaps the most efficient way of writing and testing a Fortran program on your home computer is to open two DOS windows, one for editing your source file with the DOS editor, and the second for compiling and running your program. In each window you will be working from the g77\\bin directory, and you can jump from one window to the other with the click of your mouse.\n\t\t\t\t\t\t\t\t<\/p>\n\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\tRemark: This distribution of Fortran was obtained from the now defunct website <em>http:\/\/www.geocities.com\/Athens\/Olympus\/5564\/g77.htm<\/em> but the instructions should work (last checked on January 7, 2012).\n\t\t\t\t\t\t\t\t<\/p>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68],"tags":[],"class_list":["post-2976040","post","type-post","status-publish","format-standard","hentry","category-fortran-lessons"],"_links":{"self":[{"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/posts\/2976040","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/comments?post=2976040"}],"version-history":[{"count":3,"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/posts\/2976040\/revisions"}],"predecessor-version":[{"id":2976705,"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/posts\/2976040\/revisions\/2976705"}],"wp:attachment":[{"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/media?parent=2976040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/categories?post=2976040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/math.hawaii.edu\/wordpress\/wp-json\/wp\/v2\/tags?post=2976040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}