in September, 2009. Parts of it '''DO NOT APPLY''' to the currently-available release.

= Installing Photran =

= Installing Photran =

Line 14:

Line 11:

You must have '''Eclipse 3.5 (Galileo)''' installed.

You must have '''Eclipse 3.5 (Galileo)''' installed.

−

#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.

+

#You should have the '''C/C++ Development Tools (CDT) 6.0''' installed. If you do not...

−

#Eclipse must be running on a '''Java 1.5 or later Java Virtual Machine (JVM).''' To get reasonable performance, we recommend Sun's JVM [http://java.com/en/download/manual.jsp] or IBM's [http://wiki.eclipse.org/index.php/J9]. GNU Classpath (the default JVM on Fedora Linux) is generally too slow to be useful.

+

## If you downloaded Eclipse from eclipse.org '''and''' you will be following the instructions below for "Installing on a Machine With Internet Access," then CDT should be installed automatically when you install Photran.

−

#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.

+

## Otherwise, CDT probably <i>will not</i> be installed automatically. You will need to install CDT manually. Follow the instructions below for "Installing on a Machine Without Internet Access." These instructions should also be followed if you did not download Eclipse from eclipse.org (e.g., if you installed it from a Linux distribution like Ubuntu).

+

#Eclipse must be running on a '''Java 1.5 or later Java Virtual Machine (JVM).''' To get reasonable performance, we recommend Sun's JVM [http://java.com/en/download/manual.jsp] or IBM's [http://wiki.eclipse.org/index.php/J9]. OpenJDK (the default JVM on newer versions Fedora Linux) also works well, although GNU Classpath (the default JVM on older versions of Fedora) is generally too slow to be useful.

+

#If you want to compile and build Fortran applications, you must have a '''make utility''' (such as GNU Make) and a '''Fortran compiler''' (such as GNU Fortran) in your system path. Many Linux/Unix systems include these; details on installing them in Windows and Mac are below.

#Click OK to close the Add Site dialog. This will return you to the Install dialog.

−

#Click Archive...

+

#Expand "Fortran Development Tools (Photran)" and check the boxes next to "Photran End-User Runtime" '''and''' "Rephraser Engine End-User Runtime" (the latter is a supporting component)

−

#Choose the zip file you downloaded from [http://wiki.eclipse.org/PTP/builds/photran/4.0]

+

#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. ''Note that you '''cannot''' install Intel Fortran compiler support unless you are running Linux!''

−

#Click OK to close the Add Site dialog

+

#Click on the "Next" button

−

#The zip file should appear in the list as jar:file:/path/to/photran-master-4.0.5-something. Expand it.

+

#If you get an error message, see below for troubleshooting information.

−

#Expand "Photran (Eclipse Fortran Development Tools)" and check the box next to "Photran (Eclipse Fortran Development Tools)"

+

#Click the Finish button and agree to the license to complete the installation.

−

#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 "Photran Compiler Support" and select the appropriate compiler.

+

−

#Click on the "Install..." button in the ''upper-right corner'' of the dialog box.

+

−

== 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; [http://gcc.gnu.org/fortran/ gfortran] is commonly used (and free). Under Windows, you will need to install Cygwin [http://www.cygwin.com/] or MinGW [http://www.mingw.org/] and put them on your Windows PATH.<br>

−

'''Instructions for Cygwin:'''

<br>

<br>

−

#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.)

+

+

===Installing on a Machine Without Internet Access===

+

+

You will the following files:

+

+

# If you do not have CDT installed, you will need [http://www.eclipse.org/downloads/download.php?file=/tools/cdt/releases/galileo/dist/cdt-master-6.0.1.zip cdt-master-6.0.1.zip] (or the latest 6.0.x "CDT master update archive" from http://download.eclipse.org/tools/cdt/releases/galileo/]).

+

# To install Photran, you will need [http://www.eclipse.org/downloads/download.php?file=/tools/ptp/builds/galileo/I.I200912042036/ptp-master-3.0.0-I200912042036.zip ptp-master-3.0.0-I200912042036.zip] (the latest PTP update site archive from [http://wiki.eclipse.org/PTP/builds/photran/5.0.0]).

+

+

If you do not have CDT installed, start Eclipse, then...<br>

+

#Click on Help &gt; Install New Software...

+

#Click on the "Add..." button

+

#Click on the "Archive..." button

+

#Point it to the file ''cdt-master-6.0.1.zip''

+

#Click OK to close the Add Site dialog. This will return you to the Install dialog.

+

#Expand "CDT Main Features" and check the box next to "Eclipse C/C++ Development Tools"

+

#Click on the "Next" button

+

#Click the Finish button and agree to the license to complete the installation.

+

#After CDT is installed, you will be asked to restart Eclipse. You may then proceed to install Photran.

+

+

To install Photran, start Eclipse, then...<br>

+

#Click on Help &gt; Install New Software...

+

#Click on the "Add..." button

+

#Click on the "Archive..." button

+

#Point it to the file ''ptp-master-3.0.0-I200912042036.zip''

+

#Click OK to close the Add Site dialog. This will return you to the Install dialog.

+

#Expand "Fortran Development Tools (Photran)" and check the boxes next to "Photran End-User Runtime" '''and''' "Rephraser Engine End-User Runtime" (the latter is a supporting component)

+

#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. ''Note that you '''cannot''' install Intel Fortran compiler support unless you are running Linux!''

+

#Click on the "Next" button

+

#If you get an error message, see below for troubleshooting information.

+

#Click the Finish button and agree to the license to complete the installation.

+

+

<br>

+

+

===Troubleshooting===

+

+

:The installer in Eclipse 3.5 gives notoriously cryptic error messages, which, unfortunately, are out of Photran's control. Some of the more common ones are below. If you run into a different error message and cannot resolve it, please ask for help on the [http://www.eclipse.org/photran/mailinglists.php Photran mailing list].

+

+

<br>

+

+

:'''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: 125xxxxxxxxxx 0.0.0.125xxxxxxxxxx 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.''

+

+

<br>

+

+

:'''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: 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. [http://gcc.gnu.org/fortran/ gfortran] and [http://www.gnu.org/make GNU Make] are commonly used (and free). Most Linux/Unix distributions include these. Under Windows, you will need to install Cygwin [http://www.cygwin.com/] (which optionally includes gfortran and GNU Make) or MinGW [http://www.mingw.org/] and put them on your Windows PATH.

+

+

===Instructions for Cygwin===

+

+

#Install [http://www.cygwin.com/ Cygwin]; 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.)

#Add the Cygwin directories to your Windows PATH. Under Windows XP, the process is as follows:

#Add the Cygwin directories to your Windows PATH. Under Windows XP, the process is as follows:

##Make sure you are logged in under an administrator account.

##Make sure you are logged in under an administrator account.

Line 157:

Line 213:

rm -f hello.exe

rm -f hello.exe

</pre>

</pre>

+

+

== Converting C/C++ Projects to Fortran Projects ==

+

+

C/C++ projects and Fortran projects can be used interchangeably; all of the functionality of CDT is available in Fortran projects, and all of the functionality of Photran is available in C/C++ projects. The only difference is what icon appears in the Fortran Projects view. Nevertheless, this can be a helpful indication of whether a project is primarily written in C/C++ or in Fortran.

+

+

To convert an existing C/C++ project to a Fortran project, switch to the Fortran perspective, right-click on the project in the Fortran Projects view, and select Convert to Fortran Project from the pop-up menu.

Photran has different editors for free- and fixed-form files. The free-form editor is pictured above.

Photran has different editors for free- and fixed-form files. The free-form editor is pictured above.

Line 225:

Line 287:

'''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 [[PTP/photran/documentation/photran5advanced | 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.

'''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 [[PTP/photran/documentation/photran5advanced | 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.

'''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.

'''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.

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 [[PTP/photran/documentation/photran5advanced | Advanced Features]].

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 [[PTP/photran/documentation/photran5advanced | Advanced Features]].

Line 261:

Line 323:

=== Go to line (Ctrl+L) ===

=== Go to line (Ctrl+L) ===

−

To navigate to a specific line of code in the editor, there are two ways to access the "Go To Line..." feature. Open the file to navigate and

+

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 &gt; 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.

−

+

−

while the editor window is active, in the menu bar, go to Navigate &gt; Go To Line... or press Ctrl+L to open the Go To Line dialog box. Typing in the line you wish to navigate to and clicking OK will locate the cursor at the beginning of the specified line and jump to that location.

+

=== Configuring The Editor ===

=== Configuring The Editor ===

Line 269:

Line 329:

==== Selecting horizontal ruler vs. folding ====

==== Selecting horizontal ruler vs. folding ====

−

The horizontal ruler at the top of the editor is enabled by default. To enable code folding and disable the horizontal ruler, go to Window &gt; 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.

+

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 &gt; 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 ====

+

==== 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 &gt; 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.

+

The colors for Fortran syntax highlighting can be modified in the Fortran editor preferences. To modify the color settings, go to Window &gt; 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 Print Margin ====

+

==== Showing the print margin ====

−

To enable display of the print margin (column 80 in the editor) go to Window &gt; Preferences in the menu bar. Under General, expand Editors, and select Text Editors. Check the box for "Show print margin". Click Apply and the print margin should now display in the editor.

+

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 &gt; 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 ====

+

==== Converting tabs to spaces ====

−

To enable conversion of Tabs to spaces, go to Window &gt; 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.

+

To enable conversion of tabs to spaces, go to Window &gt; 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.

+

+

:<small>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.</small>

==== Show whitespace ====

==== Show whitespace ====

−

Whitespace characters can be displayed by going to Window &gt; Preferences. Under General &gt; Editors &gt; Text Editors, check the box next to "Show whitespace characters" and click Apply. Whitespace characters will now show up in the editor as grey dots.

+

Whitespace characters can be displayed by going to Window &gt; Preferences. Under General &gt; Editors &gt; 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 (&raquo;), dots (&middot;), and paragraph symbols (&para;), respectively.

==== Set Font ====

==== Set Font ====

−

Changing font in the Fortran editor is currently not supported.

+

Photran uses the same font as the basic Eclipse text editor. To change it, click on Window &gt; 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 ====

==== Show line numbers ====

Line 297:

Line 361:

= Compiling Fortran Programs =

= 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.

+

To compile a project, Photran generally executes whatever '''make''' command is on your system path. (On most systems, this will invoke GNU Make.) As noted above, when you create a project, you can decide if Photran will auto-generate a Makefile that uses GNU Fortran, Intel Fortran, or IBM XL Fortran, or you can elect to hand-write your own Makefile.

−

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). There are similar options available for Intel Fortran and IBM XL Fortran.

−

+

*To create a project using a custom Makefile, in the project type selection box, expand the Makefile Project folder, and select Empty Project.

−

*To use an automatically generated makefile, choose "Executable (Gnu Fortran)" from the Project type menu. Yo may need to uncheck the box below reading "Show project types and toolchains if they are supported on the platform" in order to be able to select the GCC toolchain in the toolchain selection box.

+

−

*To create a project using your own custom makefile, in the project type selection box, expand the Makefile Project folder, and select Empty Project. Name the project and select the toolchain of your choise (For example, Windows users will likely choose Cygwin GCC).

Check out the [http://help.eclipse.org/ganymede/topic/org.eclipse.cdt.doc.user/concepts/cdt_c_build_over.htm?resultof=%22%63%6f%6d%70%69%6c%69%6e%67%22%20%22%63%6f%6d%70%69%6c%22%20%22%63%2f%43%2b%2b%22%20|CDT Documentation] to find out more about the required tools and other information (like Makefiles and build settings) about building projects.

+

Compiling Fortran projects is identical to compiling C/C++ Projects.

−

== Setting make targets ==

+

'''For more information on building projects,''' click on Help &gt; Help Contents in Eclipse, and navigate to

Setting make targets for Fortran programs is the same as [http://help.eclipse.org/ganymede/topic/org.eclipse.cdt.doc.user/tasks/cdt_t_addmaketarget.htm?resultof=%22%6d%61%6b%65%22%20%22%74%61%72%67%65%74%73%22%20%22%74%61%72%67%65%74%22%20|Creating make targets with CDT]. Refer to the previous link for an easy guide to creating make targets and more information on creating make targets.

+

== Setting Make Targets ==

−

== Error parser ==

+

Setting make targets for Fortran programs is also identical to setting make targets for C/C++ programs.

−

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 &gt; Fortran Build &gt; Settings and select the Error Parsers tab. A list of error parsers available to you is displayed.

+

'''For more information on make targets,''' click on Help &gt; Help Contents in Eclipse, and navigate to

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.

When you build (compile) your Fortran program, the output from your Fortran compiler (including any error messages) will be displayed in the Console view. However, for many compilers, Photran can "recognize" error messages, placing the problem description in the Problems view and marking the corresponding line in the source file with a red X icon.

+

+

To do this, you must have the correct ''error parsers'' selected in your Fortran project's build settings. To modify these settings, right-click on your Fortran project, go to Properties &gt; Fortran Build &gt; Settings and select the Error Parsers tab. A list of error parsers is displayed; select the one(s) corresponding to the Fortran compiler(s) you are using and click OK.

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 &gt; Properties &gt; Fortran Build &gt; Settings &gt; Binary Parsers Tab).

+

== Recognizing Executables (Binary Parsers) ==

+

+

In order to run (execute) 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 &gt; Properties &gt; Fortran Build &gt; Settings &gt; 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.

+

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. Mac users should choose the Mach-O parser.

If you want to simply run a Fortran application, you can right-click the project in the project explorer &gt; Run As &gt; 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.

+

To run a Fortran application, right-click the project in the Fortran Projects view, and click Run As &gt; Local Fortran Application. This will build and run the Fortran application, and output will be printed to the console. (Remember, if you are using a custom makefile, the makefile will need to be written correctly for the project to be built.)

−

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

+

If you want to manage the run configuration (for example, if you want to pass command line arguments to your Fortran application or set certain environment variables), right-click on the project in the Fortran Projects view, click Run As &gt; Run Configurations... Create a new launch configuration under Fortran Local Application (or edit an existing one) and modify the settings as needed.

−

Debugging programs works similarly, except Right-Click your project &gt; Debug As &gt; 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.

+

Debugging programs works similarly, except you can choose Debug As &gt; Local Fortran Application or Debug Configurations from the context menu.

−

== CDT ==

+

Running and debugging Fortran applications is similar to running and debugging C/C++ applications. '''For more information on running and debugging binary applications,''' click on Help &gt; Help Contents in Eclipse, and navigate to

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

+

== Setting Breakpoints ==

−

Refer to the [http://help.eclipse.org/ganymede/topic/org.eclipse.cdt.doc.user/tasks/cdt_o_run.htm?resultof=%22%72%75%6e%6e%69%6e%67%22%20%22%72%75%6e%22%20|CDT documentation] for a more detailed guide to run/debug configurations.

+

There are two ways to set breakpoints in the editor.

−

== Setting breakpoints ==

+

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.

−

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

+

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.

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.

+

When you switch to the Debug perspective, the breakpoints you set will be listed in the Breakpoints view.

+

+

'''For more information on debugging,''' click on Help &gt; Help Contents in Eclipse, and navigate to

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.

When using Cygwin in Windows, Debugging a program can result in a "cannot find gcc source" error as described in [https://bugs.eclipse.org/bugs/show_bug.cgi?id=280492|Bug 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.

+

When using Cygwin in Windows, debugging a program can result in a "cannot find gcc source" error as described in [https://bugs.eclipse.org/bugs/show_bug.cgi?id=280492 Bug 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 ==

== Compiler-specific problems ==

Line 379:

Line 450:

= Troubleshooting =

= Troubleshooting =

−

If you are experiencing troubles with installing or working with Photran, you might want to check out our FAQ[http://wiki.eclipse.org/PTP/photran/faq]<br>

+

If you are experiencing problems installing or working with Photran, please review the FAQ [http://wiki.eclipse.org/PTP/photran/faq]. If you don't find an answer there, please join the Photran mailing list [http://eclipse.org/photran/mailinglists.php]; a large number of users (as well as Photran's developers) monitor that list, and they are generally eager to help.

−

<br>

+

−

And if you don't find your answer there, feel free to e-mail them to our Mailing List[http://eclipse.org/photran/mailinglists.php]

Installing Photran

System Requirements

To install Photran 5.0...

You must have Eclipse 3.5 (Galileo) installed.

You should have the C/C++ Development Tools (CDT) 6.0 installed. If you do not...

If you downloaded Eclipse from eclipse.org and you will be following the instructions below for "Installing on a Machine With Internet Access," then CDT should be installed automatically when you install Photran.

Otherwise, CDT probably will not be installed automatically. You will need to install CDT manually. Follow the instructions below for "Installing on a Machine Without Internet Access." These instructions should also be followed if you did not download Eclipse from eclipse.org (e.g., if you installed it from a Linux distribution like Ubuntu).

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]. OpenJDK (the default JVM on newer versions Fedora Linux) also works well, although GNU Classpath (the default JVM on older versions of Fedora) is generally too slow to be useful.

If you want to compile and build Fortran applications, you must have a make utility (such as GNU Make) and a Fortran compiler (such as GNU Fortran) in your system path. Many Linux/Unix systems include these; details on installing them in Windows and Mac are below.

Installing on a Machine With Internet Access

Click OK to close the Add Site dialog. This will return you to the Install dialog.

Expand "Fortran Development Tools (Photran)" and check the boxes next to "Photran End-User Runtime" and "Rephraser Engine End-User Runtime" (the latter is a supporting component)

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. Note that you cannot install Intel Fortran compiler support unless you are running Linux!

Click on the "Next" button

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 OK to close the Add Site dialog. This will return you to the Install dialog.

Expand "CDT Main Features" and check the box next to "Eclipse C/C++ Development Tools"

Click on the "Next" button

Click the Finish button and agree to the license to complete the installation.

After CDT is installed, you will be asked to restart Eclipse. You may then proceed to install Photran.

To install Photran, start Eclipse, then...

Click on Help > Install New Software...

Click on the "Add..." button

Click on the "Archive..." button

Point it to the file ptp-master-3.0.0-I200912042036.zip

Click OK to close the Add Site dialog. This will return you to the Install dialog.

Expand "Fortran Development Tools (Photran)" and check the boxes next to "Photran End-User Runtime" and "Rephraser Engine End-User Runtime" (the latter is a supporting component)

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. Note that you cannot install Intel Fortran compiler support unless you are running Linux!

Click on the "Next" button

If you get an error message, see below for troubleshooting information.

Click the Finish button and agree to the license to complete the installation.

Troubleshooting

The installer in Eclipse 3.5 gives notoriously cryptic error messages, which, unfortunately, are out of Photran's control. Some of the more common ones are below. If you run into a different error message and cannot resolve it, please ask for help on the Photran mailing list.

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: 125xxxxxxxxxx 0.0.0.125xxxxxxxxxx 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.

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. gfortran and GNU Make are commonly used (and free). Most Linux/Unix distributions include these. Under Windows, you will need to install Cygwin [4] (which optionally includes gfortran and GNU Make) or MinGW [5] and put them on your Windows PATH.

Instructions for Cygwin

Install Cygwin; 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.)

Add the Cygwin directories to your Windows PATH. Under Windows XP, the process is as follows:

Make sure you are logged in under an administrator account.

Open the Control Panel.

Double-click the System icon.

Switch to the Advanced tab.

Click the Environment Variables button.

Under System Variables, find the variable "Path" in the list, and click on it.

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.

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".

Click File > New > Fortran Project

Call it HelloFortran

Choose "Executable (Gnu Fortran)" from the project type list

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)

Click Next

Click on Advanced Settings

Expand C/C++ Build in the list on the left, and click on Settings

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.

Click on the Error Parsers tab. Check the error parser(s) for the Fortran compiler(s) you will use.

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 [6] and another from the University of Hawaii [7]... and, of course, you can always read the entire manual for GNU Make [8].

Select "-- Other Toolchain --" in the toolchain list in the right-hand column, and click Next

Click on Advanced Settings

Expand C/C++ Build in the list on the left, and click on Settings

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.

Click on the Error Parsers tab. Check the error parser(s) for the Fortran compiler(s) you will use.

Click OK

Click Finish

Click File > New > Source File

Call it hello.f90

Click Finish

Type the standard "Hello, World" program shown below.

Click File > New > File

Call it Makefile

Click Finish

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.

Click Project > Clean, then click OK

Open the Console view, and make sure "make" ran OK and compiled your 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

Converting C/C++ Projects to Fortran Projects

C/C++ projects and Fortran projects can be used interchangeably; all of the functionality of CDT is available in Fortran projects, and all of the functionality of Photran is available in C/C++ projects. The only difference is what icon appears in the Fortran Projects view. Nevertheless, this can be a helpful indication of whether a project is primarily written in C/C++ or in Fortran.

To convert an existing C/C++ project to a Fortran project, switch to the Fortran perspective, right-click on the project in the Fortran Projects view, and select Convert to Fortran Project from the pop-up menu.

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.

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

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.

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.

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."

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.

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.

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

To compile a project, Photran generally executes whatever make command is on your system path. (On most systems, this will invoke GNU Make.) As noted above, when you create a project, you can decide if Photran will auto-generate a Makefile that uses GNU Fortran, Intel Fortran, or IBM XL Fortran, or you can elect to hand-write your own Makefile.

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). There are similar options available for Intel Fortran and IBM XL Fortran.

To create a project using a custom Makefile, in the project type selection box, expand the Makefile Project folder, and select Empty Project.

Building Projects

Compiling Fortran projects is identical to compiling C/C++ Projects.

For more information on building projects, click on Help > Help Contents in Eclipse, and navigate to
C/C++ Development User Guide > Concepts > Build > Building C/C++ Projects.[9]

Setting Make Targets

Setting make targets for Fortran programs is also identical to setting make targets for C/C++ programs.

For more information on make targets, click on Help > Help Contents in Eclipse, and navigate to
C/C++ Development User Guide > Tasks > Building projects > Creating a make target.[10]

Marking Error Messages from Your Fortran Compiler (Error Parsers)

When you build (compile) your Fortran program, the output from your Fortran compiler (including any error messages) will be displayed in the Console view. However, for many compilers, Photran can "recognize" error messages, placing the problem description in the Problems view and marking the corresponding line in the source file with a red X icon.

To do this, you must have the correct 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 is displayed; select the one(s) corresponding to the Fortran compiler(s) you are using and click OK.

Recognizing Executables (Binary Parsers)

In order to run (execute) 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. Mac users should choose the Mach-O parser.

Running and Debugging Fortran Programs

To run a Fortran application, right-click the project in the Fortran Projects view, and click Run As > Local Fortran Application. This will build and run the Fortran application, and output will be printed to the console. (Remember, if you are using a custom makefile, the makefile will need to be written correctly for the project to be built.)

If you want to manage the run configuration (for example, if you want to pass command line arguments to your Fortran application or set certain environment variables), right-click on the project in the Fortran Projects view, click Run As > Run Configurations... Create a new launch configuration under Fortran Local Application (or edit an existing one) and modify the settings as needed.

Debugging programs works similarly, except you can choose Debug As > Local Fortran Application or Debug Configurations from the context menu.

Running and debugging Fortran applications is similar to running and debugging C/C++ applications. For more information on running and debugging binary applications, click on Help > Help Contents in Eclipse, and navigate to
C/C++ Development User Guide > Tasks > Running and debugging projects.[11]

Setting Breakpoints

There are two ways to set breakpoints in the editor.

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.

When you switch to the Debug perspective, the breakpoints you set will be listed in the Breakpoints view.

For more information on debugging, click on Help > Help Contents in Eclipse, and navigate to
C/C++ Development User Guide > Tasks > Running and debugging projects > Debugging.

Known Run/Debug Issues

When using Cygwin in Windows, debugging a program can result in a "cannot find gcc source" error as described in Bug 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 problems installing or working with Photran, please review the FAQ [12]. If you don't find an answer there, please join the Photran mailing list [13]; a large number of users (as well as Photran's developers) monitor that list, and they are generally eager to help.