- 1 Photran FAQ
- 1.1 Usage Questions
- 1.1.1 How do I get Photran to work with my favorite compiler?
- 1.1.2 Photran is running out of memory (I'm getting java.lang.OutOfMemoryError).
- 1.1.3 When I create a project, I get the error "Error launching external scanner info generator (gcc -E ..."
- 1.1.4 I can't get Photran to run my program ("Launch failed no binaries" or some such error message).
- 1.1.5 When I run my Fortran program, it complains that it can't find a particular DLL.
- 1.1.6 I get 'Cannot run program "make": Launching failed'
- 1.1.7 When I open or focus an editor window, I get a java.lang.NullPointerException
- 1.1.8 After enabling advanced features and selecting a Fortran source file, the Refactor menu shows no refactorings available. Now what?
- 1.1.9 Can I make a Remote Fortran Project using the Remote Development Tools?
- 1.2 Installation Questions
- 1.1 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 , or another from the University of Hawaii ... or you can read the entire manual for GNU make .
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).
- 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 .
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 : 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.
Waiting on an answer...
Can I make a Remote Fortran Project using the Remote Development Tools?
Yes, but it's not in the documentation...
For background information about remote projects, see Local vs. Remote Projects and Remote Development Tools which is part of PTP. RDT allows you to have projects whose source file location, builds, and execution can all be on a remote machine. Source files are brought to the local machine (where you have Eclipse installed) when needed, e.g. when you edit a file.
Here is how to make a remote Fortran project:
- Make a C/C++ Remote Project (the kind where you write your own makefile, also known as a "Makefile Project")
- Switch to the Fortran perspective
- In the Fortran Projects view (you *have* to do it in that view), right-click on the project, and click Convert to Fortran Project
- The only things that don't work in remote projects are the indexer and the features that depend on it (open declaration, language-based search, content assist, hover tips, and refactoring). The indexer is disabled by default on new projects, so you don't have to do anything special. (Actually, if you turn it on, it will work; it will just be unbearably slow. For C/C++ projects, all the indexing is performed on the remote machine, but this is not implemented for Fortran.)
- The PTP parallel debugger also works depending on your computer and the debug info it generates (and thus your version of gdb). When it stops at main, it may be in C wrapper e.g. fmain.c for which it can't find source. Switch the editor to your Fortran program, put a breakpoint on a line there, then Resume and it will land in your Fortran program.
Note that a new upcoming type of remote projects should facilitate remote project in Photran: Rsync Remote Projects
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.)