Photran的用法(转载自eclipse官网)
Getting Started with Managed Make
If your system has the GNU gfortran compiler installed, try this.
- File | New | Fortran Project
- Call it whatever
- Choose the Executable (Gnu Fortran) from the project type list 注:对于Ubuntu 8.10系统已经不再提供G77支持了,因此,编译器一定要选gfortran,即GNU Fortran
- Choose GCC Toolchain from the toolchain list (you may need to uncheck the "Show project types..." check box at the bottom of the window)
- Click Next
- Click on Advanced Settings
- Expand C/C++ Build in the list on the left, and click on Settings
- 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.
- Click on the Error Parsers tab. Check the error parser(s) for the Fortran compiler(s) you will use.
- Click OK
- Click Finish
- Click File | New | Source File
- Call it hello.f90; click Finish
- Type the standard "Hello, World" program, and click File | Save.
program hello
print *, "Hello World"
stop
end program hello
- Open the Console view, and make sure "make" ran OK and compiled your program
- In the Fortran Projects view, expand the Binaries entry, and click on your executable (e.g., "whatever - [x86le]") 这个设计很好很强大到让人摸不着头脑,因为用M$的V$已经用惯了。。。
- Run | Run As | Run Local C/C++ Application (yeah, I know, it should say "Fortran Application", but it doesn't)
- Choose GDB Debugger (Cygwin GDB Debugger if you're under Windows)
- 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).
- File | New | Fortran Project
- Call it whatever
- Choose Makefile Project from the project type list (it has a folder icon; do not expand it)
- Choose "-- Other Toolchain --" from the toolchain list <--li>Click Next
- Click on Advanced Settings
- Expand C/C++ Build in the list on the left, and click on Settings
- 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.
- Click on the Error Parsers tab. Check the error parser(s) for the Fortran compiler(s) you will use.
- Click OK
- Click Finish
- File | New | File
- Call it Makefile
- Click Finish
- 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:
- File | New | Source File
- Call it hello.f90
- Click Finish
- Type the standard "Hello, World" program.
program hello
print *, "Hello World"
stop
end program hello
- Project | Clean; then click OK
- Open the Console view, and make sure "make" ran OK and compiled your program
- In the Fortran Projects view, expand the Binaries entry, and click on your executable (e.g., "whatever - [x86le]")
- Run | Run As | Run Local C/C++ Application (yeah, I know, it should say "Fortran Application", but it doesn't)
- Choose GDB Debugger (Cygwin GDB Debugger if you're under Windows)
- Check the Console view, and make sure Hello World appeared.
ubuntu 8.10平台eclipse + photran部署成功
要点
先装cdt. 一定要和eclipse主程序的版本对上。
再装对应版本的photran(从achieve里找)。万勿追最新版,切记!特别是eclipse是从源里装的情况下。
所有的安装不要直接从压缩包里装,应该解压。解压的文件夹中应该包括两个子文件夹feature和plugins。然后,从Help - Software Updates里开,选New features to install 下一步,找到文件夹装上。