Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

PTP/photran/faq

< PTP‎ | photran
Revision as of 12:38, 26 June 2010 by Apthorpe.cynistar.net (Talk | contribs) (Installation Questions)

You are here: PTP > Photran > Technical FAQ

Photran FAQ

Usage Questions

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 [1], or another from the University of Hawaii [2]... or you can read the entire manual for GNU make [3].

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 Mac OS X, you can follow the Linux instructions if you are launching Eclipse from the command line. If you are launching from the Dock or Applications folder, change the -Xmx parameter in /Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini (assuming Eclipse is located in /Applications/eclipse)
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
For what it's worth, 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 create a project, I get the error "Error launching external scanner info generator (gcc -E ..."

Under Windows, you probably have a problem with your PATH; you should also make sure you have GCC, the GNU C compiler, installed (at least the gcc-core package if you are running Cygwin). Make sure you have followed the instructions here to install Cygwin and put it on your Windows PATH. Most Linux distributions include GCC, so if you are getting this error under Linux, you may need to explicitly install GCC.

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

  1. 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.
  2. Your workspace path cannot have spaces in it. A workspace in C:\Documents and Settings\whoever\My Documents for example, will give this error.
  3. 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 [4].

I get 'Cannot run program "make": Launching failed'

Do you have 'make' installed? Is it in your path?
See the Photran installation instructions especially including how to set the PATH in Windows

When I open or focus an editor window, I get a java.lang.NullPointerException

This is a bug in Photran [5]: it occurs whenever you open or alter a fortran source file using the Project Explorer view instead of the Fortran Projects view, which comes with the Fortran perspective. As a quick workaround, don't use the Project Explorer when Fortran projects are open.
The bug has been fixed with April 29 build of Beta 4.0.5, which can be found here. Please note that you need Eclipse 3.4.2 and CDT 5.0 or above to get it working.

After enabling advanced features and selecting a Fortran source file, the Refactor menu shows no refactorings available. Now what?

Waiting on an answer...

Installation Questions

Where do I find the "Photran End-User Runtime"?

Following the instructions on PTP/photran/documentation/photran6 allows one to install "Fortran Development Tools (Photran)"; there's no mention of a Photran End-User Runtime. If the Fortran Development Tools are installed, the result is a lot of C/C++ development tools but no mention of Photran or Fortran tools anywhere in the Eclipse UI.

How can I install the production release of Photran on a machine without internet access?

Note that the guidance on PTP/photran/documentation/photran6 links to PTP/builds/4.0.0 which only contains release candidates, not production releases. Note also that installing one of the release candidates yields the same problematic results mentioned in the above question (no Fortran tools available in Eclipse.)

Back to the top