Overview of MS Fortran Compiler

2009.09.04 09:01

가을의 곰을... 조회 수:15743

[출처] http://physics.gmu.edu/~amin/phys251/Topics/Languages/For_ms51.htm

PHYS 251 - Introduction to Computer Techniques in Physiscs

Overview of MS Fortran Compiler

PC Version 5.1, 1991


Latest Modification: November 9, 1999

Getting Started with MS Fortran

The MS Fortran Compiler, Version 5.1, is somewhat outdated compiler but still has some uses. We suggest the following steps to get started in writing, compiling, and executing your own Fortran programs with MS Fortran 5.1.

  • There are several restrictions that you should follow as a courtesy to other students in this and other physics courses.
    1. Do not reconfigure the machines through the AUTOEXEC.BAT or CONFIG.SYS files. DeVries suggests the use of a Set command; do not alter the AUTOEXEC.BAT on Physics Department machines. Your machine, yes, our machines no.
    2. Do not place your personal files in directories containing software used by others, such as the MS Fortran Compiler. Make your own directory under a root directory called TMP, such as \TMP\Brown.
      • Note that periodically the machines in both rooms are cleaned and reloaded with software. Therefore, do not depend on your files remaining on a machine; back them up to a floppy disk at the end of each working session.
      • DeVries recommends that his library, FCCP.lib, be placed in the directory \FORTRAN\LIB. You may link to his library from your directory as follows.
      • When using the FL command, discussed below, create a compile_link BAT file in your directory, such as CL.BAT. Put the path for libraries into the BAT file as follows.
      • FL /Gt /4Nt /4Yb /4Yd yourfile.for /link C:\your_directory\LIB\FCCP.lib+C:\FORTRAN\LIB\GRAPHICS.lib
      • With an editor you may change the BAT file and, since it is an executable file, the BAT file will carry out the invoking of the compiler.
      • For an editor, you may use PWB (see below) that is included with MS Fortran, or the DOS editor, or even NOTEPAD under WINDOWS. Word processors can be used as editors as long as your restrict to text-only files, no embeded format codes. There are any number of respectable editors that will serve the purpose. The important point is to become familiar with one.

      • PWB Editor

        The Programmer's WorkBench (PWB) provides an integrated environment for developing Fortran programs. With PWB, you can write and edit source and other teext files, define development projects, and build applications form one or more files.

        • PWB - The syntax for invoking PWB is
          • PWB [[options]] [[myfile.for]]
          • Examples:
            • PWB demo.for
            • PWB demo.for two.for
          • PWB Options - The options are case sensitive.
            • /?
              • Lists the PWB command-line options.
            • /r
              • Starts PWB in no-edit mode. All editing functions that modify files are disabled.


            Compiling and Linking with the FL Command

            The FL command automatically compiles and links your Fortran program in a single step. FL executes the three compiler passes, then calls LINK (the Microsoft Segmented-Executable Linker) to link the object files. Except for a few unusual situations, FL is the only command you need to compile and link your Fortran source files. The result of the FL command, if successful, is a runtime executable file for DOS with the extension .EXE.

            • FL Command - The FL command compiles and links one or more Fortran source files. The general syntax for the FL command is
              • FL [[options]] myfile_1.for [[options]] [[myfile_2.for]]...[[/link [[libfield]] [[link options]]...]]
                • Examples:
                • FL myfile.for
                • FL /Gt /4Nt /4Yb /4Yd myfile.for /link C:\my_directory\FCCP+C:\FORTRAN\LIB\GRAPHICS
                • Compiling Options - There are a large number of options available, some being more important than others. We will concentrate on a few that are particularly relevant. Options are generally case sensitive.
                  • FL /HELP
                    • Lists all FL options on the standard output. This option is not case sensitive.
                  • FL /c filespec.for
                    • Compiles without linking.
                  • FL /4Nt filespec.for
                    • Enables (/4Yt) or disables (/4Nt) truncation of variable names to 6 characters. /4Nt is the default or truncation to 6 characters. Thus for variable names longer than 6 characters one must override the compiler default.
                  • FL /4Yd filespec.for
                    • Enables (/4Yd) or diaables (/4Nd) warnings about undeclared variables. /4Nd is the default. Since Fortran compilers will not enforce strong typing, i.e. explicitly declaring the type of each variable, we can take the next best action. This is for the compiler to issue a warning message about undeclared variables.
                  • FL /4Yb filespec.for
                    • Enables (/4Yb) or disables (/4Nb) extended error handling at run time. /4Nb is the default. The compiler will issue extend error messages at run time with this option enabled.
                  • FL /Aletter filespec.for
                    • Selects the memory model. The letter can be M, L, or H,, for Medium, Large, Or Huge, respectivly. /AL is the default.
                  • FL /Gt[[number]] filespec.for
                    • Places data items greater than or equal to number bytes in a new segment. Defaults to 32,767 bytes if this option is not specified. If /Gt is specified without a number, defaults to 256 bytes. This option has no effect with the Medium memory model. This option will, for example, allow the storage of very large arrays of data.

                  • Managing Libraries with LIB Utility

                    LIB creates, organizes, and maintains standard libraries. Standard libraries are collections of compiled or assembled object modules, and provide a common set of useful routines and/or data. These libraries provide your program with routines and data at link time. With LIB one creates a library file and adds or deletes modules in a library.

                    • LIB Utility - The LIB utility creates and maintains libraries developed by the user. The syntax for invoking the LIB utility is the following.
                      • LIB oldlibrary [[options]] [[commands]] [[,[[newlibrary]] ]] [[;]]
                      • Example: LIB FCCP.lib +myfile.obj, FCCPNEW.lib;
                      • The options are not case sensitive and can be abbreviated to the shortest unique name.
                      • One can also invoke LIB by typing LIB and press ENTER and reponding to the prompts that LIB displays.
                      • If the oldlibrary file does not exist, LIB prompts by:
                        • Library file does not exist. Create?
                        • Press Y to create the library file or N to end the LIB session.
                        • The newlibrary field specifies a name for the changed library file. If you do not change the name, LIB stores the original library file with the extension .BAK.
                        • If you do not specify all expected input on the command line and do not end the line with a semicolon, LIB asks you for the missing input by displaying the following four prompts and waits for your response to each.
                          • Library name: your response FCCP.lib
                          • Operations: your response +myfile.obj
                          • List file: your response FCCPNEW.lst
                          • Output library: your response FCCPNEW.lib
                          • LIB Options
                            • /H[[ELP]]
                              • Calls the QuickHelp utility. If LIB cannot locate the help file for QuickHelp, it displays a brief summary of LIB command-line syntax.
                            • /?
                              • Displays a brief summary of LIB command-line syntax.
                            • LIB Commands
                              • +name
                                • Appends an object file or library file to oldlibrary
                              • -name
                                • Deletes a module from oldlibrary
                              • -+name
                                • Replaces a module in oldlibrary by first deleting it and then appending an object file with the same name as the module
                              • *name
                                • Copies a module to an object file without deleting it from oldlibrary
                              • -*name
                                • Deletes a module from oldlibrary after saving it in an object file

                              • Linking User and System Libraries

                                • Linking Libraries - The compiler will automatically link those libraries that it needs to produce an executable file (such as myprogram.exe) for a DOS-based platform. However, there are special system libraries, such as a graphics library, or user-developed libraries that must be explicitly specified in order that they be link in at the time an executable file is produced.
                                • Using FL to Link without Compiling - Just as the FL command can compile source files without linking the resulting object code, FL can link object files that were previously compiled. If all of the files you give FL have extensions other than .FOR, and if no /Tf options appear, FL skips the compiling stage and links your files. The following syntax applies to linking without compiling:
                                  • FL myfile_1.obj [[,myfile_2.obj...]] /link [[libfield]] [[linkoptions]]
                                  • When FL links object files, it gives the resulting executable file the base name of the first object file on the command line, plus an .EXE extension, by default.
                                  • The FL command normally links without having to specify the /link option. However, you can include the /link option in an FL command line if you wish to modify the linking process, such as by specifying a different library.
                                  • Linking Object Files with the LINK Utility - LINK is a bound application that runs under DOS and can create executable files for DOS. LINK uses the following syntax:
                                    • LINK objfilelist
                                    • The objfilelist can also specify library files. However, a library file must specify the filename extension, otherwise LINK treats it as an .OBJ file.


                                    경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
                                    어린이용이며, 설치가 필요없는 브라우저 게임입니다.
                                    https://s1004games.com

                                    Physics & Astronomy Department, George Mason University
                                    Maintained by J. C. Evans; jevans@gmu.edu

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
1195 ePub 의 개요 [전자책 표준] 가을의 곰을... 2009.09.03 30229
1194 ubuntu에서 tcl/tk 설치 가을의 곰을... 2010.08.08 25232
1193 ProGuard - 자바 역컴파일 방지 [1] 가을의 곰을... 2010.01.14 22719
1192 안드로이드 구조분석 wiki file 가을의 곰을... 2010.01.10 22130
1191 C Programming Links 가을의 곰을... 2009.09.02 21174
1190 자바에서 x86 어셈블리로 프로그래밍: x86 Assembly Programming in Java Platform 가을의 곰을... 2011.11.15 20535
1189 ubuntu에서 wxPython 설치하기 가을의 곰을... 2010.08.08 19730
1188 Programatically retrieving data from a website into a database file 졸리운_곰 2017.02.26 18860
1187 ▣ Emacs 사용법 ver 3.0 [1] 가을의 곰을... 2010.01.02 18685
1186 GOF 디자인패턴 file 가을의 곰을... 2009.12.05 17690
1185 emacs 사용법 file 가을의 곰을... 2010.01.03 17418
1184 미래 네트워크 연구 동향 file 가을의 곰을... 2009.12.13 17234
1183 소스인사이트 단축키 (2) 가을의 곰을... 2010.10.11 17003
1182 Android 빌드하여 AVD 생성 및 시뮬에 올리기 file 가을의 곰을... 2010.08.15 16946
1181 기계학습 (머신러닝:Machine Learning) 참고자료 링크 : 머신러닝 : 기계 학습 프로그래밍 자료 졸리운_곰 2014.11.29 16075
» Overview of MS Fortran Compiler 가을의 곰을... 2009.09.04 15743
1179 Java GUI 프로그래밍 가을의 곰을... 2011.06.05 15694
1178 < 목표성취의 7단계 > 가을의 곰을... 2009.08.17 15465
1177 JQuery의 힘으로 제작된 17 가지 오픈소스 웹 게임들 가을의 곰을... 2013.01.02 15343
1176 Spring 3 MVC Hello World Example file 가을의 곰을... 2011.11.01 14983
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED