Difference between revisions of "PTP/photran/documentation/photran5"

From Eclipsepedia

Jump to: navigation, search
m (Installation Procedure)
m (Installation Procedure)
Line 31: Line 31:
 
#If you get an error message, see below for troubleshooting information.
 
#If you get an error message, see below for troubleshooting information.
 
#Click the Finish button and agree to the license to complete the installation.
 
#Click the Finish button and agree to the license to complete the installation.
 +
 +
<br>
  
 
===Troubleshooting===
 
===Troubleshooting===

Revision as of 13:13, 12 October 2009

You are here: PTP > Photran > Documentation > Photran 5.0 User's Guide

Photran 5.0 User's Guide

IMPORTANT: PHOTRAN 5.0 HAS NOT BEEN PUBLICLY RELEASED. This is PRELIMINARY documentation for Photran 5.0's release in October, 2009. Parts of it DO NOT APPLY to the currently-available release.

Contents

Installing Photran

System Requirements

To install Photran 5.0...

You must have Eclipse 3.5 (Galileo) installed.

  1. You should have the C/C++ Development Tools (CDT) 6.0 installed. If you do not, they will be installed automatically when you install Photran.
  2. Eclipse must be running on a Java 1.5 or later Java Virtual Machine (JVM). To get reasonable performance, we recommend Sun's JVM [1] or IBM's [2]. GNU Classpath (the default JVM on Fedora Linux) is generally too slow to be useful.
  3. If you want to compile and build Fortran applications, you must have a make utility and a Fortran compiler in your system path. Many Linux/Unix systems include these; details on installing them in Windows and Mac are below.

Installation Procedure

To install Photran, start Eclipse, then...

  1. Download the latest Photran zip file from [3]
  2. Click on Help > Install New Software...
  3. Click on the "Add..." button
  4. Click on the "Archive..." button
  5. Choose the zip file you downloaded from [4]
  6. Click OK to close the Add Site dialog. This will return you to the Install dialog.
  7. Expand "Photran (Fortran Development Tools)" and check the box next to "Photran End-User Runtime"
  8. If you are running Linux and have the Intel Fortran Compiler installed, or if you are on a Macintosh and have the IBM XL Fortran compiler installed, expand "Fortran Compiler Support" and select the appropriate compiler.
  9. Click on the "Next" button
  10. If you get an error message, see below for troubleshooting information.
  11. Click the Finish button and agree to the license to complete the installation.


Troubleshooting


Problem: You receive the following error message during installation.
Cannot complete the install because one or more required items could not be found.
Missing requirement: 1255366915760 0.0.0.1255366915760 requires 'org.eclipse.photran.intel.feature.group [5.0.0.xxxx]' but it could not be found
Solution: You are attempting to install support for the Intel Fortran compiler, but you are not running Linux. Go back in the installation wizard, and uncheck "Linux Intel(R) Fortran Compiler Support.


Problem: You receive the following error message during installation.
Cannot complete the install because one or more required items could not be found.
Software being installed: Photran End-User Runtime 5.0.0.xxxx (org.eclipse.photran.feature.group 5.0.0.xxxx)
Missing requirement: Photran End-User Runtime 5.0.0.xxxx (org.eclipse.photran.feature.group 5.0.0.xxxx) requires 'org.eclipse.cdt.feature.group [xxx)' but it could not be found
Solution: You do not have CDT 6.0 installed, and it couldn't be downloaded and installed automatically. Try installing CDT 6.0 first, then retry installing Photran.

Additional Instructions for Windows Users

To compile and run Fortran programs in Photran, you will need to have a Fortran compiler and make utility installed. Most Linux/Unix distributions include these; gfortran is commonly used (and free). Under Windows, you will need to install Cygwin [5] or MinGW [6] and put them on your Windows PATH.
Instructions for Cygwin:

  1. Install [Cygwin http://www.cygwin.com/]; the defaults are mostly OK, but you will need to explicitly tell it to include the "Devel" packages (at least gcc4-fortran, gdb, and make) when the installer asks you to select what packages to install. (If gcc4-fortran is not listed under the "Devel" packages, you may have chosen a bad mirror; restart the Cygwin installation, and choose a different mirror instead. Georgia Tech's mirror at gtlib.gatech.edu is generally quite fast and reliable, for example.)
  2. Add the Cygwin directories to your Windows PATH. Under Windows XP, the process is as follows:
    1. Make sure you are logged in under an administrator account.
    2. Open the Control Panel.
    3. Double-click the System icon.
    4. Switch to the Advanced tab.
    5. Click the Environment Variables button.
    6. Under System Variables, find the variable "Path" in the list, and click on it.
    7. Click Edit.
    8. At the end of the "Variable Value" text, add
      ;C:\Cygwin\bin;C:\Cygwin\usr\bin;C:\Cygwin\usr\local\bin;C:\Cygwin\lib;C:\Cygwin\usr\lib
    9. Click OK, click OK, click OK, and close the Control Panel.
    10. Close and re-open Photran. Windows should now search C:\Cygwin\bin, C:\Cygwin\usr\bin, etc. when it's looking for executables (including make.exe, gcc.exe, and gfortran.exe).

Additional Instructions for Mac OS X Users

If you install gfortran on Mac OS X, it may be installed in /usr/local/bin, which is not (by default) on the PATH. If you are launching Eclipse from a Terminal, the PATH can be set by modifying /etc/paths. However, if you are launching Eclipse from the Finder (by double clicking on it) or the Dock, then the PATH is not obtained from the shell or /etc/paths. Instead, it's obtained from ~/.MacOSX/environment.plist. The format of the environment.plist file is as follows (change the path appropriately). If you create or edit this file, you will need to log out (or reboot) before the changes will take effect.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>PATH</key>
    <string>/usr/local/mpi/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/sbin:/usr/sbin:/Developer/Tools:/usr/texbin:/Users/greg/bin</string>
</dict>
</plist>

Getting Started

Photran is an integrated development environment and refactoring tool for Fortran 77, 90, 95, and 2003. It includes an editor with "smart" syntax highlighting, a GUI debugger, CVS support, Makefile-based compilation, error message recognition for many common Fortran compilers, Fortran language-based search and code navigation, content assist, a Fortran declaration view, and many refactorings, including popular refactorings such as Rename and Extract Procedure as well as Fortran-specific refactorings like Introduce Implicit None.

Photran is based on Eclipse, and some of its components are reused from the Eclipse C/C++ Development Tools (CDT). Throughout this documentation, you will see references to relevant parts of the Eclipse and CDT documentation, which can be accessed by clicking on the Help menu (inside Photran/Eclipse) and clicking Help Contents.

If you have never used Eclipse before, please work through the Eclipse Workbench tutorial before attempting to use Photran. Click on Help > Help Contents in Eclipse, and navigate to Workbench User Guide > Getting started > Basic tutorial. This will introduce you to Eclipse concepts such as perspectives and views; such terminology will be used throughout this manual.


Starting a New Project

One of the advantages (or disadvantages) of using Photran is that it does not include a Fortran compiler. Instead, it uses make to compile Fortran programs. This allows you to use any Fortran compiler you want, but it also means that a Makefile must be written which tells the make program how to compile your Fortran program.

  • For small, simple projects, Photran can auto-generate a Makefile which will use the GNU Fortran compiler (gfortran).
  • For more complex projects, you can write a custom Makefile.

For more information on project types, click on Help > Help Contents in Eclipse, and navigate to C/C++ Development User Guide > Concepts > CDT Projects.

Starting a Project with an Auto-Generated Makefile

The following is a typical procedure for starting a new project using an auto-generated Makefile. Your system must have the GNU Fortran (gfortran) compiler installed for this procedure to work. To make sure that gfortran is installed, you can open a command prompt (Windows) or terminal window (Linux/Mac) and type "gfortran" (without the quotes); it should respond with "gfortran: no input files".

  1. Click File > New > Fortran Project
  2. Call it HelloFortran
  3. Choose "Executable (Gnu Fortran)" from the project type list
  4. Choose "GCC Toolchain" from the toolchain list (you may need to first uncheck the "Show project types..." check box at the bottom of the window before you can see this)
  5. Click Next
  6. Click on Advanced Settings
  7. Expand C/C++ Build in the list on the left, and click on Settings
  8. Click on the Binary Parsers tab. Check the appropriate parsers for your platform. If you are using Windows, check PE Windows Parser and/or Cygwin PE Parser; if you are using Linux, check Elf Parser; if you are using Mac, check Mach-O parser.
  9. Click on the Error Parsers tab. Check the error parser(s) for the Fortran compiler(s) you will use.
  10. Click OK
  11. Click Finish
  12. Click File > New > Source File
  13. Call it hello.f90; click Finish
  14. Type the standard "Hello, World" program shown below, and click File > Save.
  15. Open the Console view, and make sure "make" ran OK and compiled your program
  16. In the Fortran Projects view, expand the Binaries entry, and click on your executable (e.g., "HelloFortran.exe - [x86le]")
  17. Run | Run As | Run Local Fortran Application
  18. Choose GDB Debugger (Cygwin GDB Debugger if you're under Windows)
  19. Check the Console view, and make sure "Hello World" appeared.


hello.f90:

program hello
    print *, "Hello World"
end program

Starting a Project with a Hand-Written Makefile

The following is a typical procedure for starting a new project using a hand-written Makefile. The following example uses the GNU Fortran (gfortran) compiler, but any Fortran compiler can be used instead. We will assume that you are familiar with how to write a Makefile. If not, there are plenty of resources on the Web, including a tutorial from an introductory Computer Science course at UIUC [7] and another from the University of Hawaii [8]... and, of course, you can always read the entire manual for GNU Make [9].

  1. Click File > New > Fortran Project
  2. Call it HelloFortran
  3. Expand "Makefile project" in the project type list (it has a folder icon), and choose "Empty Project"
  4. Select "-- Other Toolchain --" in the toolchain list in the right-hand column, and click Next
  5. Click on Advanced Settings
  6. Expand C/C++ Build in the list on the left, and click on Settings
  7. Click on the Binary Parsers tab.  Check the appropriate parsers for your platform. If you are using Windows, check PE Windows Parser and/or Cygwin PE Parser; if you are using Linux, check Elf Parser; if you are using Mac, check Mach-O parser.
  8. Click on the Error Parsers tab. Check the error parser(s) for the Fortran compiler(s) you will use.
  9. Click OK
  10. Click Finish
  11. Click File > New > Source File
  12. Call it hello.f90
  13. Click Finish
  14. Type the standard "Hello, World" program shown below.
  15. Click File > New > File
  16. Call it Makefile
  17. Click Finish
  18. Create a Makefile similar to the one shown below. Again, we assume you are familiar with the structure of a Makefile. You cannot simply copy-and-paste this example because the gfortran and rm lines must start with a tab, not spaces. The -g switch instructs gfortran to include debugging symbols in the generated executable so that it can be debugged later. The -o switch tells it what to name the generated executable.
  19. Click Project > Clean, then click OK
  20. Open the Console view, and make sure "make" ran OK and compiled your program
  21. In the Fortran Projects view, expand the Binaries entry, and click on your executable (e.g., "hello.exe - [x86le]")
  22. Click Run > Run As > Local Fortran Application
  23. Choose GDB Debugger (Cygwin GDB Debugger if you're under Windows)
  24. Check the Console view, and make sure "Hello World" appeared.


hello.f90

program hello
    print *, "Hello World"
end program


Makefile: (You MUST replace the spaces beginning the gfortran and rm lines with a tab character!)

all:
        gfortran -o hello.exe -g hello.f90

clean:
        rm -f hello.exe

Creating a Project by Importing Existing Source Code

TODO

Converting C/C++ Projects to Fortran Projects

TODO

Writing Code

The Fortran Perspective

When you write Fortran code, ordinarily you will work in the Fortran perspective. When you create a new Fortran project (as described above), the wizard will ask if you want to switch to the Fortran perspective, or you can do it manually by clicking Window > Open Perspective > Other... and selecting Fortran from the list.

For more information on perspectives, click on Help > Help Contents in Eclipse, and navigate to Workbench User Guide > Concepts > Perspectives. Perspectives are also covered in the Eclipse tutorial, which can be found in Workbench User Guide > Getting started > Basic tutorial.

In particular, note that you can add views to a perspective by clicking Window > Show View > Other... and selecting a new view from the Show View dialog. You can also reset the current perspective to its original layout: From the menu bar, choose Window > Reset Perspective.

By default, the Fortran perspective contains a central area for editing code, as well as the following views:

  • The Fortran Projects view displays your project(s) and any files and folders in it.
  • The Problems view will show errors from your Fortran compiler, if Photran can recognize them. (This requires configuring an error parser, described elsewhere in this manual.)
  • The Console view shows the output from your Fortran compiler. When you run your Fortran program, its output is also displayed in the Console view.
  • The Fortran Declaration view is described in the Photran Advanced Features manual.
  • The Outline view shows the high-level structure of your program, i.e., the subprograms, modules, derived types, etc. comprising it.
  • The Make Targets view allows you to quickly run make on a particular target defined in a custom Makefile.

For more information on the Make Targets view, click on Help > Help Contents in Eclipse, and navigate to C/C++ Development User Guide > Reference > C/C++ Views and Editors > Make Targets view.

The Fortran Projects View

The Fortran Projects view displays project files in a tree structure. In this view you can do the following:

  • Open files in the Fortran editor
  • Manage existing files (cut, paste, delete, move or rename)
  • Create new projects, files, or folders
  • Import or Export files and projects
  • Browse the high-level structures in Fortran files
  • Open projects in a new window
  • Perform some multi-file refactorings (such as Introduce Implicit None; see the Photran Advanced Features Manual)

Files can be opened by double-clicking on the filename or by right-clicking on the file and choosing "Open With" from the context menu. Most other actions are performed by right-clicking on the file and choosing an action from the context menu.

The Fortran projects view is similar to the C/C++ Projects View. For more information on the Fortran Projects view, refer to the documentation on the C/C++ Projects view by clicking on Help > Help Contents in Eclipse and navigating to C/C++ Development User Guide > Reference > C/C++ Views and Editors > C/C++ Projects view.

Configuring Content Types: Free vs. Fixed Form

Photran supports both fixed-form and free-form Fortran code. Each source form has its own editor.

Fixed form is an older form designed for punch cards. It is more common in Fortran 77 and earlier programs, although it is still part of Fortran 2003. In fixed form, a "c", "C", "*", or "!" in column 1 indicates a comment; columns 1 through 5 are used for a statement label; a character in column 6 indicates a continuation line; and program statements are contained in columns 7 through 72. Anything after column 72 is ignored.

Photran uses filename extensions to determine whether a file is in fixed- or free-form. By default, .f, .fix, .for, .fpp, and .ftn are assumed to be in fixed source form, while .f03, .f95, .f90, and .f77 are assumed to be in free source form. Additional extensions can be added to this list by changing the Eclipse Content Type preferences.

For more information on configuring content types, click on Help > Help Contents in Eclipse and navigate to Workbench User Guide > Reference > Preferences > Content Types.

Using the Fortran editor and Fortran perspective

Selecting free vs. fixed form

Free Form Fortran Editor

Photran has different editors for free- and fixed-form files. The free-form editor is pictured above. The fixed-form editor has vertical bars delineating column six and marking the right-hand side of column 72; it is pictured below.

When you double-click on a file in the Fortran Projects view, Photran will open it in either the free- or fixed-form editor according to its filename extension. (See the previous section on how to customize this.)

You can explicitly choose whether to open a file in the free-form or fixed-form editor by right-clicking on the file in the Fortran Projects view and selecting either Open With > Fortran Editor (Fixed Form) or Open With > Fortran Editor (Free Form). Opening free-form code in the fixed-form editor (or vice versa) will result in a watermark reading "Warning: Content Type Mismatch" being displayed in the upper right corner of the editor.

Do not ignore the "Warning: Content Type Mismatch" watermark. Photran always uses the content type of the file to populate the Outline view and to operate the features described in the Advanced Features Manual. So if you are editing a fixed form file but this watermark is being displayed, Photran thinks it is a free form file. You MUST change the content types in the Eclipse preferences, as described in the previous section, for the Outline view to display and for any of the advanced features to work.

Fixed Form Fortran Editor

Outline view

Outline View

When a Fortran file is open in the Fortran editor, the Outline view shows an outline of the structural elements of that file: subprograms, main programs, modules, derived types, etc. The Outline view notes the content type of the file (free form or fixed form); it will also note when there is an error in the code. To add the Outline view to the current perspective go to Window > Show View > Other... > General > Outline.

Outline Error

Overview of the Fortran editors

The free form and fixed form editors generally support the same features. The main features to note are the horizontal ruler at the top of the editor, code folding, and smart syntactic highlighting.

The horizontal ruler measures the width of the editor in characters: There is either a symbol (-/+) or number for each column in the editor. A plus sign (+) is shown every fifth character, and every tenth character is numbered. It is also possible to turn on the print margin (gray vertical line) in the 80th column; this is discussed further below in the section titled "Configuring the Editor."

Editor Ruler

Code folding is also supported in the free form editor, but turning on code folding will disable the horizontal ruler; how to do this is described below as well. When folding is turned on, a minus sign (-) will be displayed in the left margin of the editor next to each program, function, subroutine, etc.; clicking on the minus sign will temporarily collapse the display of that entity to a single line.

Editor Folding

The editors also support smart syntactic highlighting. As you write programs in Fortran, you will notice that different colors are applied to comments, identifiers, intrinsics, keywords, and strings to make code more readable. It is possible to change the colors for each of the previously mentioned code components in the Fortran editor preferences (this is discussed in the section "Configuring the Editor," below). Often, the editor can even distinguish between, for example, the keyword "if" and a variable named "if." However, it is not perfect; it uses a faster, but less reliable, heuristic than the actual Fortran parser that drives the Outline view and all of the Advanced Features.

Comment/uncomment

Photran can comment or uncomment a block of Fortran statements, placing an exclamation point (!) before the statements or removing it, respectively. Select the statements in the Fortran editor. Then right-click the selection, and choose Comment/Uncomment from the context menu.

Photran-comment-action.png

Setting bookmarks

Bookmarks are an Eclipse feature which allows you to mark important lines in a file and then quickly jump to those lines using the Bookmarks view. To set a bookmark, right-click the grey bar on the left side of the editor at the line where the bookmark should be located and select "Add Bookmark..." from the popup menu. A bookmark can also be placed on a line by locating the cursor on the line, going to Edit > Add Bookmark... in the menu bar. Type in the desired name for the bookmark in the dialog box and click OK. A blue bookmark will show up in the grey bar on the left side of the editor.

Bookmarks can then be viewed in the Bookmarks view (Window > Show View > Other..., select Bookmarks in the General folder).

Go to line (Ctrl+L)

The "Go To Line..." feature allows you to jump to a specific line number in a file when it is open in a Fortran editor. In the menu bar, go to Navigate > Go To Line... (or press the hotkey, Ctrl+L on Windows/Linux or Command+L on Mac) to open the Go To Line dialog box. Typing in the line you wish to navigate to, and clickg OK. The cursor will be moved to the beginning of the specified line.

Configuring The Editor

Selecting horizontal ruler vs. folding

Fortran editors can either display the horizontal ruler, or they can have code folding enabled, but not both. To determine which will be enabled, go to Window > Preferences in the menu bar. Expand Fortran and select Editor. Check the appropriate box(es) to enable folding in the free-form and/or fixed-form Fortran editor.

Setting colors for syntax highlighting

The colors for Fortran syntax highlighting can be modified in the Fortran editor preferences. To modify the color settings, go to Window > Preferences in the menu bar. Expand Fortran and select Editor. The color choosers for Comments, Identifiers, Intrinsics, Keywords, and Strings are available on this page.

Showing the print margin

Editors can optionally display a gray vertical bar at a specified column; generally, this is set in column 80 to act as a visual "print margin." To enable display of the print margin, go to Window > Preferences in the menu bar. Under General, expand Editors, and select Text Editors. Check the box for "Show print margin". Optionally, you can also change the column in which the print margin will be displayed. Click Apply and the print margin should now display in the editor.

Converting tabs to spaces

To enable conversion of tabs to spaces, go to Window > Preferences in the menu bar. Under General, expand Editors, and select Text Editors. Check the box for "Insert spaces for tabs" to have Eclipse automatically convert Tabs to spaces.

Note that this will only apply to new tabs that you type; it will not change your existing files.

It is easy to replace tabs with spaces in an existing file, as long as the tabs all occur at the beginning of a line. (For tabs in the middle of a line, this won't work quite right.) (1) Move the cursor to the beginning of the file; (2) click on Edit > Find/Replace...; (3) in the Find box, type "\t" (without the quotes); (4) in the Replace With box, type 4 or 8 spaces (each tab character will be replaced with exactly what you type, so if you type four spaces, each tab character will be replaced with four spaces); (5) select Search: Forward and Scope: All; (6) check the "regular expression" box; and (7) click Replace All. This will replace every tab character with spaces.

Show whitespace

Whitespace characters can be displayed by going to Window > Preferences. Under General > Editors > Text Editors, check the box next to "Show whitespace characters" and click Apply. Spaces, tabs, and newlines will now be shown as light gray double-angle quotes (»), dots (·), and paragraph symbols (¶), respectively.

Set Font

Photran uses the same font as the basic Eclipse text editor. To change it, click on Window > Preferences in the menu bar. Under General, expand Appearance, and select Colors and Fonts. In the list on the right, select Text Font. Click the "Change..." button to change the font.

Show line numbers

Line numbers can be displayed in the editor in the Text Editor preferences page. Go to Window > Preferences. Under General > Editors > Text Editors, check the box "Show line numbers" and click Apply.

Compiling Fortran Programs

Photran allows you to build projects with automatically generated Makefiles as well as custom makefiles, which allow the use of compilers other than gFortran which is Photran's default Fortran compiler. Photran also comes packaged with support for Intel's Fortran compiler and IBM's XLF compiler.

When you create a new Fortran project, you will be asked to name your project as well as choose a type and toolchain.

  • To use an automatically generated Makefile, choose "Executable (Gnu Fortran on XYZ)" from the Project type menu, where XYZ is your platform (Windows, Linux, or Mac OS X).
  • To create a project using a custom Makefile, in the project type selection box, expand the Makefile Project folder, and select Empty Project.
Choosing a Fortran project type

CDT

Building Fortran projects is very similar to Building C/C++ Projects.

Check out the Documentation to find out more about the required tools and other information (like Makefiles and build settings) about building projects.

Setting make targets

Setting make targets for Fortran programs is the same as make targets with CDT. Refer to the previous link for an easy guide to creating make targets and more information on creating make targets.

Error parser

In order to get feedback about any errors in your Fortran programs, you will need to have some Error parsers selected in your Fortran project's build settings. To modify these settings, right-click on your Fortran project, go to Properties > Fortran Build > Settings and select the Error Parsers tab. A list of error parsers available to you is displayed.

You will notice that most of the default error parsers are the CDT parsers, which is partly why Photran requires CDT to be installed in your Eclipse environment. Select the error parser(s) you wish to use (usually depending on which compiler you are using) and click Apply and/or OK.

Fortran Error Parsers

Binary parsers - need to change if no "Run as Local Fortran App" menu item

In order to actually be able to compile and run your Fortran application, you will need to tell Eclipse which Binary Parser(s) to use for your project. This can be done in the project properties (Right-click project > Properties > Fortran Build > Settings > Binary Parsers Tab).

Which binary parser you want to use will depend on the operating system environment you are working in. For example, the default choice is the Elf Parser which is for Linux environments. Windows users would need to deselect the Elf Parser and select the PE Windows Parser and/or the Cygwin PE Parser.

Fortran Binary Parsers
Run as Local Fortran Application

Running and Debugging Fortran Programs

If you want to simply run a Fortran application, you can right-click the project in the project explorer > Run As > Local Fortran Application. This will build and run the Fortran application and output will be printed to the console. Note: If you are using a custom makefile, the makefile will need to be written correctly so the project can be built.

If you want to manage the run configuration, such as adding arguments or environment variables, Right-click your project in the explorer > Run As > Run Configurations... Create a new launch configuration under Fortran Local Application and modify the settings as needed to meet your run configuration specification.

Debugging programs works similarly, except Right-Click your project > Debug As > Local Fortran Application or Debug Configurations. Note that if you create a new Run/Debug configuration for your project, there is a Debug tab where you can choose the debugger you wish to use. GDB is the default debugger used by Photran.

CDT

Running and Debugging Fortran applications is similar to running and debugging C/C++ applications.

Refer to the documentation for a more detailed guide to run/debug configurations.

Setting breakpoints

There are two ways to set breakpoints in the editor view.

The easiest way to set a breakpoint in the editor is to double click in the left margin (gray vertical bar) on the line at which you wish to set the breakpoint. A blue dot will appear in the margin on the line where the breakpoint is set. Double clicking again at the same location will remove the breakpoint.

You can also set a breakpoint by right-clicking in the left margin on the line where you wish to set the breakpoint and clicking "Toggle Breakpoint." The blue dot indicating the breakpoint will appear or disappear (if already set) in the left margin of the editor.

Setting Breakpoints

Known Run/Debug Issues

When using Cygwin in Windows, Debugging a program can result in a "cannot find gcc source" error as described in 280492. Note that this error does not have an effect on the running of the program. The program will still run correctly in Debug mode.

Compiler-specific problems

G95

In debug mode, using the step button to step through the code line-by-line sometimes jumps ("leapfrog" effect) around in the source code editor view. For example, pressing F6 (step) after a breakpoint several times, might sometimes result in a jump to line 1 and stepping again will return to the correct line in the code.

gFortran

No known issues.

Intel Fortran Compiler

No known issues.

IBM XLF

No known issues.

Advanced Features

Photran 5.0 includes a number of sophisticated features that are designed to make it easier to write, modify, search, and maintain Fortran code. These include content assist, which can "auto-complete" variable and function names as you type; a declaration view, which can show the leading comments for the selected variable or procedure; Fortran Search, which allows you to find declarations and references to modules, variables, procedures, etc.; and refactorings, which change your source code to improve its design while preserving its behavior.
Documentation for Photran's advanced features is available here.

Troubleshooting

If you are experiencing troubles with installing or working with Photran, you might want to check out our FAQ[10]

And if you don't find your answer there, feel free to e-mail them to our Mailing List[11]

Beyond Photran

TODO

  • Using Photran with other Eclipse plug-ins
    • Subversion support
    • PTP/RDT
    • RSE