Skip to main content

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

Thanks for your help, Hani

I tried yours step but in step 7 :

7. Choose (e.g.) "g95 make Makefile" and click the "Run" button. In the Navigator/Fortran Projects 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)

I haven't any makefile in my Navigator/Fortran Projects. 

But , I have these messages :

Severity and Description	Path	Resource	Location	Creation Time	Id
Error launching 'cygpath' command		essai5	Unknown	1171528273671	15

Severity and Description	Path	Resource	Location	Creation Time	Id
Invalid project path: Duplicate path entries.		essai5	pathentry	1171528273982	16


But if used this command with cmd.exe

D:\msys\1.0\bin>perl d:\msys\1.0\bin\mkmf -t d:\msys\1.0\bin\mkmf.g95 -p D:\Eclipse\carrie\essai5

there is a makefile in d:\msys\1.0\bin.

any ideas, 'cygpath' it's cygwin parameter but i used MinGW ??

any helps !

____________________________________________________________________________________________________
Dear Carrie,


CARRIE Laurent wrote:

    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. 


AFAIK you need to install msysDTK (http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe?download) additionally to have Perl installed on your System. To check for perl try to type 'perl --help' in your cmd console window and look at the result. If perl is installed the help screen of perl should be printed otherwise you have to install msysDTK.

**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.:


> [...]


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


OK.


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


Unfortunately the install doc on www.g95.org is outdated.


The 'new' mkmf handle external template files to adapt user's environment. So you should not edit the perl scrip itself. Have a look at http://www.gfdl.noaa.gov/fms/pubrel/k/am2/bin/mkmf.html or below.

    [snip] 



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


I will stop here commenting your posting and attach a step-by-step guide I posted in August last year (I made some minor changes since then):

---------------------8<----------------------------------------


Here a example for Windows, MinGW, g95 and Photran 3.1.


1.
If you use MinGW it is useful to download and install "msys" and "msysDTK" from www.mingw.org. The bin directory of msys has to be in your path.

2.
Copy "mkmf" <http://www.gfdl.noaa.gov/fms/pubrel/k/am2/bin/mkmf.html> 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 = -I c:/mingw/include
LDFLAGS = $(LIBS)
# add your libraries after LIBS= , e.g. -lblas
LIBS =

Give a name to this template file (e.g. mkmf.g95) and save it somewhere (e.g. c:\msys\1.0\bin)

3.
To use mkmf 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 -p ${container_name}"

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


5.
Click on menu Windows->Preferences->C/C++->Make->New Make Projects. Choose Tab 'Binary Parser'. Enable 'PE Windows Parser' and disable all others. Click on the OK button.

6.
Setup is done.




To edit, compile and run Fortran programs do the following:


1. File->New->Standard Make Fortran Project. Give a name to your project in the 'Project Name' field. Click 'Finish'
2. Be sure that your project name is highlighted in the left 'Fortran Projects' or 'Navigator' frame. Click File->New->Source File. Fill out the 'Source File' field (e.g. myprogram.f90). Click 'Finish'
3. Type your code in the new editor tab and save it (File->Save)
4. Add further source files if necessary.
5. Click on one of your source files in the Navigator or Fortran projects frame
6. Click menu "Run->External tools->External tools ..."
7. Choose (e.g.) "g95 make Makefile" and click the "Run" button. In the Navigator/Fortran Projects 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)
8. Select one of your source files in the Navigator/Fortran Projects frame again.
9. Click menu Project->Build Project or Clean ...
10. After compilation you should see "myproject.exe" in your Navigator/Fortran Projects frame.
11. Right click on "myproject.exe" and click "Run As->Run Local C/C++ Application"
8. Voilà

---------------------8<----------------------------------------


Hope this helps


Hani

__________________________

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