Documentation for Photran
Documentation?
Unfortunately,
there is no real documentation for
Photran at this
time. Documentation is an excellent way to contribute to
Photran;
if you are interested in this, please contact us.
That said, Photran is highly based on the CDT, and therefore, the CDT
User's Guide translates almost directly into documentation for
Photran (although there are a few features the CDT has that Photran
does not). If you are not sure how a part of Photran works, try
looking there; if you're still not sure, join the Photran mailing list and
post your question there.
On this page...
Elsewhere on the Photran site...
Elsewhere on the Web...
- How to use Photran with g95 (alternate link)
- Photran Tutorial from the F Tools suite (slightly outdated)
Getting Started with Managed Make
If your system has the GNU gfortran compiler installed, try this.
- File | New | Fortran Project
- Call it whatever
- Choose the Executable (Gnu Fortran) from the project type list
- Choose GCC Toolchain from the toolchain list (you may need to uncheck the "Show project types..." check box at the bottom of the window)
- 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, and click
File | Save.
program hello
print *, "Hello World"
stop
end program hello
- Open the Console view, and make sure "make" ran OK and compiled your program
- In the Fortran Projects view, expand the Binaries entry, and click on your executable (e.g., "whatever - [x86le]")
- Run | Run As | Run Local C/C++ Application (yeah, I know, it should say "Fortran Application", but it doesn't)
- Choose GDB Debugger (Cygwin GDB Debugger if you're under Windows)
- Check the Console view, and make sure Hello World appeared.
Getting Started with Standard Make
To get started, try this. If you're under Windows, you need to be running Cygwin, c:\cygwin\bin and c:\cygwin\usr\bin should be in your system path, and the g95 libraries need to be copied into /usr/lib (to make things easier for yourself, at least).
- File | New | Fortran Project
- Call it whatever
- Choose Makefile Project from the project type list (it has a folder icon; do not expand it)
- Choose "-- Other Toolchain --" from the toolchain list <--li>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
- File | New | File
- Call it Makefile
- Click Finish
- We assume you're familiar with how to format a
Makefile. Something like this will work for now.
Remember
to start the g95 line with a tab, not spaces. The -g switch
instructs g95 to include debugging symbols in the generated executable
so that it can be debugged later.
all:
g95 -g hello.f90
clean:
- File | New | Source File
- Call it hello.f90
- Click Finish
- Type the standard "Hello, World" program.
program hello
print *, "Hello World"
stop
end program hello
- Project | Clean; then click OK
- Open the Console view, and make sure "make" ran OK and compiled your program
- In the Fortran Projects view, expand the Binaries entry, and click on your executable (e.g., "whatever - [x86le]")
- Run | Run As | Run Local C/C++ Application (yeah, I know, it should say "Fortran Application", but it doesn't)
- Choose GDB Debugger (Cygwin GDB Debugger if you're under Windows)
- Check the Console view, and make sure Hello World appeared.

