Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Photran IDE & gfortran compiler

111 views
Skip to first unread message

mcg...@gmail.com

unread,
Feb 4, 2009, 12:14:51 PM2/4/09
to
Hello,

I am using a 64 bit system (Q6600 intel processor, and 64 bit Vista).
Using 64 bit gfortran compiler (at this point, the binary compiled and
distributed by Equation (http://www.equation.com).

I read in a post, that a possible useful IDE is one provided by
Eclipse with a Fortran plugin (http://www.eclipse.org, http://www.eclipse.org/photran).
I have downloaded Eclipse Classic 3.4.1 (151 MB) (http://
download.eclipse.org/eclipse/downloads/drops/R-3.4.1-200809111700/
index.php), specifically eclipse-SDK-3.4.1-win32-x86_64.zip. I had to
update to Java 6 update 12, which includes the entire set of Java code
required for Eclipse (Sun recently only released this full set for
Windows).

The IDE works - meaning I can create a project, source code, save
files. I can't successfully build them from the IDE.

I can use the command line to manually compile the source code created
with the IDE.

I have been unable to determine how to setup Photran to build
properly. I believe it is related to the use or creation of a
'makefile'. I am uncertain as to whether I failed to download another
program required with gfortran to create these 'makefiles', if it is
lack of documentation for Photran, or both.

Can anyone point me in the correct direction?

Thanks!

Arjan

unread,
Feb 4, 2009, 1:46:35 PM2/4/09
to
> I have been unable to determine how to setup Photran to build
> properly.  I believe it is related to the use or creation of a
> 'makefile'. I am uncertain as to whether I failed to download another
> program required with gfortran to create these 'makefiles', if it is
> lack of documentation for Photran, or both.

Photran is built on top of Eclipse.
Eclipse only calls "make" for you. Eclipse does NOT call your
compiler!
Somewhere, your system should know "make" already, separately from
Eclipse.
As you guessed, this means that you yourself have to make sure
that your project has a "Makefile".
Creation of Makefiles is a boring job and even cumbersome if you use
modern Fortran dialects,
which require you to offer the source-files of your project in order
of dependence.
As a first try, yu can create a Makefile yourself manually.
Alternatively, to circumvent this, you can get the Perl-script mkmf.pl
and have that script
create your Makefiles. This in turn means that you should have
a working Perl-interpreter........
No problem: install MinGW, MSYS and the MSYSDTK (Development ToolKit,
which has Make and Perl).
Create a settings-file specifying your compilers, e.g. "g95_args":

######################################################################
CC = gcc
FC = g95
LD = g95
FFLAGS = -fno-second-underscore -g -ftrace=full
#
# add your libraries after LIBS= , e.g. -lblas
LIBS = c:/mingw/lib
LDFLAGS = $(LIBS)
######################################################################

Then, to have a Makefile created for you, open an MSYS shell (a window
where you can give unix-like commands), and give the command:
Perl ./mkmf.pl -t ./g95_args
where now both files mkmf.pl and g95_args are located in your current
directory,
along with the source-files of your project (otherwise give the
correct path).

Now you should have a file named Makefile in your current directory!
In principle, your way to use Photran is open!
First, however, some testing...
Check if the contents of Makefile look reasonable.

Test if you can build your project manually from the MSYS shell by
calling "make" from the commandline. Or "make myprogram", where
myprogram is the name of your program.

If you managed to arrive here without serious problems, THEN you can
proceed with Eclipse/Photran! Congratulations!
I have just succeeded to get Photran to work with my MinGW-MSYS-g95
collection on a Win-XP box. It is not trivial to get all components
running together, but I have the impression that after a while you'll
get your reward!

Success!


Arjan

Craig Powers

unread,
Feb 4, 2009, 4:00:54 PM2/4/09
to

Keeping in mind that the OP is using gfortran, so replace both FC and LD
with that (and probably also modify FFLAGS accordingly.

Why doesn't Eclipse write its own Makefiles? If you look at Visual
Studio project files through VS98, they're actually a
specially-formatted makefile.

Arjan

unread,
Feb 5, 2009, 3:11:34 AM2/5/09
to
> Keeping in mind that the OP is using gfortran, so replace both FC and LD
> with that (and probably also modify FFLAGS accordingly.

Yeah, sorry, you're right!

> Why doesn't Eclipse write its own Makefiles?  If you look at Visual
> Studio project files through VS98, they're actually a
> specially-formatted makefile.

Good question! I would certainly be in favour of something similar for
Eclipse/Photran.
Last week I uploaded my project code to the Photran team to test their
product.
I don't use Makefiles myself, so they'll find out...

A.

Craig Powers

unread,
Feb 5, 2009, 2:58:15 PM2/5/09
to
Arjan wrote:
>> Why doesn't Eclipse write its own Makefiles? If you look at Visual
>> Studio project files through VS98, they're actually a
>> specially-formatted makefile.
>
> Good question! I would certainly be in favour of something similar for
> Eclipse/Photran.
> Last week I uploaded my project code to the Photran team to test their
> product.
> I don't use Makefiles myself, so they'll find out...

Although I should note that even though the VS98 .dsp file is in
Makefile format, it's not a valid Makefile to build the project, because
it doesn't have any targets. There's a separate item in the IDE to
export a Makefile from the project.

0 new messages