Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[photran] Using and Install photran, MinGW and g95

Hello, i 'am newbie and i want to use photran for big refactoring code project in fortran 

I try to run Phortan, eclipse 3.2 and G 95 but i can't.

environment :
windows WP
eclipse 3.2
photran-3.1-beta1-full-win32
g95-MinGW
MinGW-3.2.0-rc-3
MSYS-1.0.11-2004.04.30-1




I use this installing documentation (find on the web) :

How to set up Photran to work with g95 

Now you can develop your Fortran programs with g95 using Photran, a full featured Fortran IDE based on Eclipse. It is available for both Windows and Linux systems. Photran does not yet support automatic Makefile generation for complex builds, but g95 users can implement this with a separate Perl script. This is a summary of the steps required to setup Photran and g95 on a Windows XP system. 

1. Install MinGW. The self-extracting installer MinGW-3.2.0-rc-3.exe provides MinGW, the  binutils package, and Perl.

2. Install Msys, which provides make and several other tools. Both Msys and MinGW are available from: http://www.mingw.org/download.shtml. 
You may need to edit the file c:\msys\1.0\etc\profile to get MinGW to work with Msys.

**for me mysys is in d:\1.0\etc\profile**

3. Install the MinGW version of g95 into the MinGW directory.

4. Install the Photran/Eclipse package from http://www.photran.org/. Alternatively, you can install the Eclipse package, and then install the Photran plug-in.

5. Set up the PATH to find MinGW and g95, and the LIBRARY_PATH environment variable, e.g.:

  SET PATH = c:\MinGW\bin;c:\msys\1.0\bin;%PATH%
  SET LIBRARY_PATH = c:\MinGW\lib

**for my environment it's :**
  SET PATH = d:\MinGW\bin;d:\1.0\bin;%PATH%
  SET LIBRARY_PATH = d:\MinGW\lib

6. Download the Perl script "mkmf.pl", available from: http://www.gfdl.noaa.gov/~vb/mkmf.html. 
Edit the script as follows:

 Change all occurrences of 'a.out' to 'a.exe'. 
 Change the FC and LD variables under the "#begin writing makefile" section to the following: 
    printf MAKEFILE "FC = g95\n";
    printf MAKEFILE "LD = g95\n\n\n"; 

** at this point i'am not understand but i add this two lines under #begin writing makefile**
....
#begin writing makefile
printf MAKEFILE "FC = g95\n";
printf MAKEFILE "LD = g95\n\n\n";
open MAKEFILE, ">$mkfile" or die "\aERROR opening file $mkfile for writing: $!\n";
printf MAKEFILE "# Makefile created by %s $version\n\n", basename($0);
print  MAKEFILE "include $opt_t\n\n" if $opt_t; #include template if supplied
print  MAKEFILE "SRCROOT = $opt_a\n\n" if $opt_a; # make abspath a variable
...

 Save your edited script as "mkmf-g95.pl". 

** but where : in project folder or perl directories, etc ??**


7. To set up Photran to run Perl scripts, proceed as follows:

Start Photran.
Select <Run>, <Exernal Tools>, <Exernal Tools>.
Under "Configurations" select <Program>. 
Select <New>.
In the "Name" field enter: "Run Perl".
In the "Location" field enter: "c:\WINDOWS\System32\cmd.exe".
In the "Working Directory" field enter: "c:\WINDOWS\System32".
In the "Arguments" field enter the following line:

   /C "cd ${container_loc} && perl  ${resource_name}"
Select the <Common> tab.
In "Type of launch configuration" select "Local".   
In "Display in favourites menu", check the "External Tools" box. 
Click <Apply>, <Close>.


8. To add a Fortran project, proceed as follows:

Start Photran. 
At the Photran workbench; select <File>, <New>,  <Standard Make Fortran 90 Project>.
Give the project a name. 
Select <Next>.
Select <Error Parsers>, and check:

Photran Error Parser for G95 Fortran 
Photran GNU Linker Error Parser 
Photran GNU Make Error Parser 
Select <Binary Parser>, check "PE Windows Parser". Uncheck "Elf Parser".
Click <Finish>.
Add some Fortran source files to the project, either using the Photran editor, or by copying some Fortran source files to the project directory using Windows Explorer.


Note: If you prefer to use a different editor for programming, you may tell Photran to use another editor, as follows:

Select  <Window>, <Preferences>, <Workbench>, <Editors>, <File Associations>. 

Hilight the file types you want to be associated with it, such as '*.f90', and '*.f', and enter the path to the editor of your choice.

9. To compile, proceed as follows.

Copy the Perl script mkmf-g95.pl (item 6 above) to the project directory. 

Select the script in the Navigator window. 
Select <Run>, <Run Perl>. 

Check that the message ".... Makefile is ready" appears in the console.

** i have this message :**
<terminated> Run Perl [Program] c:WINDOWS\System32\cmd.exe
Can't open perl script "mkmf-g95.pl": No such file or directory

**after i don't try**

To build the project, select <Project>, <Build All>, <Clean>. 
If there are no errors, the executable "a.exe" will appear in the Navigator window.

10. To run your program:

Select <Run>, <Run>.
If necessary, expand the items listed under "Configurations". 
Select the current project. 
Add the project name in the <Project> field.
Add the executable name in the <Fortran Application> field. 
Select <Run>. 






Laurent Carrié
Institut Français du Pétrole (IFP-Lyon)
Direction Technologie, Informatique et Mathématiques Appliquées
Département Informatique Scientifique
Tél : 04 78 02 27 47

__________________________

Ce message (et toutes ses pièces jointes éventuelles) est confidentiel et établi à l'intention exclusive de ses destinataires. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. L'IFP décline toute responsabilité au titre de ce message.

This message and any attachments (the message) are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. IFP should not be liable for this message.

Visitez notre site Web / Visit our web site : http://www.ifp.fr
__________________________






Back to the top