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

  1. Getting Started with Managed Make
  2. Getting Started with Standard Make

Elsewhere on the Photran site...

  1. Overview of Refactoring Support

Elsewhere on the Web...

  1. How to use Photran with g95 (alternate link)
  2. 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.

  1. File | New | Fortran Project
  2. Call it whatever
  3. Choose the Executable (Gnu Fortran) from the project type list
  4. Choose GCC Toolchain from the toolchain list (you may need to uncheck the "Show project types..." check box at the bottom of the window)
  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, and click File | Save.

    program hello
        print *, "Hello World"
        stop
    end program hello

  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., "whatever - [x86le]")
  17. Run | Run As | Run Local C/C++ Application (yeah, I know, it should say "Fortran Application", but it doesn't)
  18. Choose GDB Debugger (Cygwin GDB Debugger if you're under Windows)
  19. 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).

  1. File | New | Fortran Project
  2. Call it whatever
  3. Choose Makefile Project from the project type list (it has a folder icon; do not expand it)
  4. Choose "-- Other Toolchain --" from the toolchain list <--li>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. File | New | File
  12. Call it Makefile
  13. Click Finish
  14. 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:


  15. File | New | Source File
  16. Call it hello.f90
  17. Click Finish
  18. Type the standard "Hello, World" program.

    program hello
        print *, "Hello World"
        stop
    end program hello

  19. 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., "whatever - [x86le]")
  22. Run | Run As | Run Local C/C++ Application (yeah, I know, it should say "Fortran Application", but it doesn't)
  23. Choose GDB Debugger (Cygwin GDB Debugger if you're under Windows)
  24. Check the Console view, and make sure Hello World appeared.