Frequently Asked Questions

En español: PUF de Photran

Is there any documentation for Photran? I can't find any in the Help system.

Unfortunately, there isn't any generic documentation for Photran. (It would be great for someone to contribute some...) However, there is a short, introductory tutorial available. Also, Walt Brainerd has created an excellent introduction that describes setting up Photran to work with the F compiler. The "basics" in this document apply equally well to other compilers. We suggest reading the CDT documentation, including the tutorials. Nearly everything in there applies to Photran, except you will need to substitute "Fortran" for "C/C++" and "g95" for "gcc". (Also, Managed Make projects aren't really usable yet.)

How do I get Photran to work with my favorite compiler?

Photran does not call your compiler directly. It just invokes make and make calls your compiler. So, you need a makefile for your program. Photran has to know which compiler you are using so that it can parse the error messages, since different compilers use different formats for error messages. And we have a not-very-well-working feature (Managed Make) that is supposed to write a makefile for you automatically, which will be great when it works, but should be avoided at the moment. All the rest of Photran is completely independent of your compiler.

If you don't know what a Makefile should look like, there's a tutorial from an introductory CS course at UIUC, or another from the University of Hawaii... or you can read the entire manual for GNU make.

I can't get Photran to run my program ("Launch failed no binaries" or some such error message).

  • In the Project menu, select Preferences, and make sure that the correct Binary Parser is selected for your platform: PE for Windows, Elf for Linux, Mach for OS X.
  • Your workspace path cannot have spaces in it. A workspace in C:\Documents and Settings\whoever\My Documents for example, will give this error.
  • If you are using g95, it has some of its own eccentricities. Spaces in the g95 path have also caused problems. If your binary "can't find cygwin1.dll", see the next question...
When I run my Fortran program, it complains that it can't find a particular DLL.

When Windows looks for DLLs, it checks the following:

  • The directory from which the application loaded.
  • The current directory.
  • The system directory (e.g., C:\Windows\System32)
  • The 16-bit system directory.
  • The Windows directory (e.g., C:\Windows)
  • The directories that are listed in the PATH environment variable.
So, for example, if cygwin1.dll is not found, it needs to be copied into one of the above directories. (NOTE: Despite Microsoft's documentation, it seems that directories on the PATH are not always searched; put the DLL in your application directory or the System directory to be safe.)

This information was obtained from Microsoft's documentation for the LoadLibrary system call.

Does Photran come with a Java runtime?

No. You will have to download and install a JRE from Sun's Java site before you can run Photran (or Eclipse, for that matter).

We have run Photran with both Java 1.4 and 1.5.

I have some Fortran sources in CVS. How can I check them out as a Photran project?

When you go into Photran's CVS Repository Exploring perspective, you ought to be able to connect to your existing CVS server and find whatever CVS module all your stuff is in. (This assumes that everything is in a single CVS module.) Right-click on it, choose "Check Out As...", and then select to "Check out as a project configured using the New Project Wizard." Make it a Standard Make Fortran 77 Project, choose a decent name, set the Binary Parser appropriately, and then finish. You can then choose to share your .project and .photranproject files under the existing CVS module if you are so inclined (this would allow everyone else to Check Out as Project), or everyone can do this separately rather than sharing the .*project files.

Photran is running out of memory (I'm getting java.lang.OutOfMemoryError).

Under Linux, add -vmargs -Xmx512M to the end of the command line, i.e., launch Photran with a command like

/usr/local/bin/photran -vmargs -Xmx512M

Under Windows, create a shortcut to Photran's "eclipse" executable. Right-click the shortcut, and choose Properties. In the box containing "eclipse.exe", add -vmargs -Xmx512M, so the entire line will read something like this:

"C:\Program Files\Photran\eclipse.exe" -vmargs -Xmx512M

If you care to know, all arguments following -vmargs are passed directly to the JVM; -Xmx512M is a request to make 512 MB of heap space available to Photran.

When I try to build a project I get the message 'Error launching builder (make -k clean all ) (CreateProcess: make -k clean all error=2)' in the console window. What does this mean?

System error 2 is "The system cannot find the file specified," i.e., there is no executable make.exe on your system path.  We recommend installing Cygwin, including its version of make, and adding Cygwin make to your system path.  Under Windows XP, this is done as follows:
  • Make sure you are an administrator for the machine.
  • 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.
  • Click Edit.
  • At the end of the "Variable Value" text, add this:
            ;C:\Cygwin\bin;C:\Cygwin\usr\bin;C:\Cygwin\usr\local\bin;C:\Cygwin\lib;C:\Cygwin\usr\lib
  • Click OK, click OK, click OK, and close the Control Panel.
This instructs Windows to search C:\Cygwin\bin, C:\Cygwin\usr\bin, etc. when it's looking for executables (including make.exe).  The "lib" folders contain DLLs which are necessary for make to run; theoretically, at least, the system path is also searched when DLLs are loaded.