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

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
115 리눅스마스터 1급 실기 리눅스마스터1급 2차 실기 기출문제 분석 가을의 곰을... 2012.04.08 8872
114 리눅스 커널 분석 file 가을의 곰을... 2012.04.07 4978
113 Gnuplot을 사용하여 웹 페이지에 데이터 표시하기 file 가을의 곰을... 2012.03.31 5240
112 Dark Room file 가을의 곰을... 2012.03.31 5728
111 ICS (아이스크림 샌드위치)빌드시 에러 가을의 곰을... 2012.03.25 7548
110 W3C의 오픈소스 HTML/CSS 에디터 file 가을의 곰을... 2012.03.24 6534
109 실제 타켓 디바이스에 안드로이드 포팅 (Android Porting On Real Target) file 가을의 곰을... 2012.03.22 7268
108 JSTL 기초, Part 2: core 분석 (한글) file 가을의 곰을... 2012.03.20 5035
107 JSTL 기초, Part 1: Expression Language (한글) file 가을의 곰을... 2012.03.20 4572
106 [정리] EL :: Function file 가을의 곰을... 2012.03.20 7537
105 [정리] EL :: Basic file 가을의 곰을... 2012.03.20 7227
104 ubuntu에서 GTK 개발환경 꾸미기 가을의 곰을... 2012.03.19 11006
103 Ubuntu에 Oracle11g 설치 가을의 곰을... 2012.03.16 7314
102 ubuntu에서 나눔글꼴 설치 가을의 곰을... 2012.03.16 5972
101 gnu free document license 번역 출간 file 가을의 곰을... 2012.02.29 7328
100 GNU 자유 문서 사용 허가서 1.2판 file 가을의 곰을... 2012.02.29 5535
99 자주 쓰이는 정규식(regular expression) 유형 가을의 곰을... 2012.02.22 6055
98 [MySQL] MySQL 4.1.x 문자셋, 인코딩, UTF-8 가을의 곰을... 2012.02.19 5521
97 Lego MindStorm과 Android의 결합 : MInd-droid file 가을의 곰을... 2012.02.16 6959
96 아두이노로 할 수 있는 아이디어 및 프로젝트, 기타 정보 모음 가을의 곰을... 2012.02.15 8840
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED