Overview of MS Fortran Compiler

2009.09.04 09:01

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

[출처] 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

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
140 특허,실용신안 등록출원의 명세서 심사기준 연구 file 가을의 곰을... 2012.05.29 3874
139 특허 출원 비용 줄이기 (감면대상자) 가을의 곰을... 2012.05.27 5507
138 [신규] 안드로이드 개발자 등록시 판매자 계정 신청 비활성화 되신 분들 file 가을의 곰을... 2012.05.24 7499
137 소프트웨어 특허출원, 소프트웨어 특허 명세서 작성법 안내 가을의 곰을... 2012.05.14 5395
136 안드로이드 앱에 애드센스 추가하기 가을의 곰을... 2012.05.09 8300
135 특허출원방법 특허청 (hwp문서) 가을의 곰 2012.05.09 5161
134 특허 출원 방법특허출원 방법/ 특허 file 가을의 곰을... 2012.05.09 5274
133 부가가치세(부가세) 인터넷 납부, 홈택스를 통한 납부 방법 file 가을의 곰을... 2012.05.08 6069
132 상표 등록(출원) 혼자서 하기 4편. 출원서 제출과 출원비용 납부하기 file 가을의 곰을... 2012.05.08 5347
131 상표 등록(출원) 혼자서 하기 3편. 서식작성기를 통한 출원서 작성하기 file 가을의 곰을... 2012.05.08 4972
130 상표 등록(출원) 혼자서 하기 2편, 특허청의 인증서 발급과 문서작성 프로그램 설치 file 가을의 곰을... 2012.05.08 5952
129 상표 등록(출원) 혼자서 하기 1편, 특허청에서 상표등록을 위한 출원인코드부여 신청 file 가을의 곰을... 2012.05.08 4749
128 xcode3 과 xcode4 동시에 설치하기 file 가을의 곰을... 2012.05.06 6218
127 [Xcode4] 간편하진 인터페이스빌더 - Outlet, Action 추가/연결 방법 file 가을의 곰을... 2012.05.06 5892
126 xcode3 개발환경에서 xcode4 개발환경으로 이주하기 file 가을의 곰을... 2012.05.06 8411
125 폰갭(phonegap) 에서의 음성인식 웹 검색 file 가을의 곰을... 2012.05.06 4652
124 [책] 내 책을 출판하는 방법, 책 쓰는 방법 file 가을의 곰을... 2012.05.05 4753
123 sourceinsight 환경설정 및 단축키 file 가을의 곰을... 2012.05.01 8277
122 고령자 유망직업 20가지 가을의 곰을... 2012.05.01 4745
121 2010년 정보시스템감리사 세부출제분야 가을의 곰을... 2012.04.29 4735
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED