Difference between revisions of "PTP/photran/faq"
|Line 1:||Line 1:|
Revision as of 02:04, 9 July 2009
- 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.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 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.