Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran] fortran compiler in photran

Hani wrote:
M.R.Hadian schrieb:
[...]
4-do you have any experience of using the method of ftp://ftp.gfdl.gov/perm/vb/mkmf/mkmf.html with "Fortran Standard Make Project" on current stable version of photran?

It is easy to use Photran with mkmf. Here a example for Windows, MinGW, g95 and Photran 3.1.

1.
At the first you need the Make tool and Perl installed on your system. If you are a Linux or Cygwin user you can install it easily or it is already installed. On MinGW it is useful to download and install "msys" and "msysDTK" from www.mingw.org for that. The bin directory has to be in your path.

2.
Copy "mkmf" somewhere in your path (e.g. c:\msys\1.0\bin) Create a template file for your compiler. Here a example for g95:
  FC = g95
  LD = g95
  FFLAGS = -Ic:/msys/1.0/MinGW/include
  LDFLAGS = $(LIBS)
  LIBS = -llapack -lf77blas -lcblas -latlas -lg2c
Give a name to this file (e.g. mkmf.g95) and save it somewhere (e.g. c:\msys\1.0\bin)

3.
Now you can use "mkmf" even from the command line. To use it in Photran open Photran and click the menu "Run->External tools->External tools..." Click on the tab "main" and fill out the form as described below. You should fit the following example to your environment if necessary:
   Name: g95 make Makefile
   Location: c:\windows\system32\cmd.exe
   Working directory: c:\windows\system32
Arguments: /C "cd ${container_loc} && perl c:\msys\1.0\bin\mkmf -t c:\msys\1.0\bin\mkmf.g95"

4.
Click on the "Refresh" tab:
[x] Refresh resources ...
Click "Apply"

5.
Setup is done.



To use mkmf do the following:

1. Click on one of your source files in Navigator frame
2. Click menu "Run->External tools->External tools ..."
3. Choose (e.g.) "g95 make Makefile" and click the "Run" button. In the navigator frame you should see the "Makefile" file in your project section.(After the first run of "g95 make Makefile" it will appear in the root section of the External tools submenu or toolbar icon for easy invocation)
4. Click menu Project->Clean ...
5. Check if your project name and the checkbutton "Start a build immediately" is marked. Click "OK"
6. After compilation you should see "a.exe" in your project section.
7. Right click on "a.exe" and click "Run As->Run Local C/C++ Application"
8. VoilĂ 

If you are a Linux user you are able to adapt it to your OS. If not please notify.

Best regards,

Hani



_______________________________________________
photran mailing list
photran@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/photran

Dear Hani
Thank you for your reply and explanation. I set it up using your explanation and tried to use it. i could do it till step 3. when i run the "g95 make Makefile" in the "Run external tools" it gives me the message ". Makefile is ready." however nothing is added to the project section even when i refresh it. only a makefile file is added to the c:\windows\system32. also i could not find the item "Start a build immediately" in the menu.
(i am using photran 3)
Regards,
Hadian



Back to the top