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

how to run Fortran codes in Compaq Visual Fortran?

0 views
Skip to first unread message

henry

unread,
Jun 8, 2007, 1:44:45 PM6/8/07
to
I have a bunch of Fortran applications from my adviser and I need use
them to create a executable program. My adviser gave me a makefile to
do the job. But honestly, I don't know how to run the makefile in
Cygwin. I changed the makefile to a two simple command line file and
created an executable program. But due to some memory problem, the
results are not complete. My adviser uses Compaq Visual Fotran 6.5 and
generate an executable program works fine. However when I add all the
Fortran application files into one project, I got tons of error
message. I don't know what I did wrong. Please give me some advise on
how to run the bunch of Fortran applications in Visual Fortran. Thanks
a lot!

The followings are the makefile and a simplified shell file I
create.
makefile:
# g95/Cygwin on Windows
# ----------------------------------
FC = g95
DFLAGS =
FFLAGS =
MODFLAGS = -c
FFLAGSP4 = -
FFLAGS0 =
FPP = -fpp -DIFC
F = f90
OBJ = o
EXENAME = -o findrule
CODEDIR =

MKLDIR = /opt/intel/mkl721/lib/32
MKLP4 = $(MKLDIR)/libmkl_lapack.a $(MKLDIR)/libmkl_ia32.a $
(MKLDIR)/libguide.a -lpthread
MKLP4FPP = -DMKL

OBJCODE = $(CODEDIR)stdtypes.$(OBJ) $(CODEDIR)mtprng.$
(OBJ) $(CODEDIR)TAGP_Modules.$(OBJ) \
$(CODEDIR)f2kcli.$(OBJ) $(CODEDIR)mrgrnk.$
(OBJ) $(CODEDIR)solvopt.$(OBJ) \
$(CODEDIR)TAGP_IO_Options.$(OBJ) $
(CODEDIR)TAGP_Utilities.$(OBJ) \
$(CODEDIR)TAGP_Populate.$(OBJ) $(CODEDIR)TAGP_IO_Data.$
(OBJ) $(CODEDIR)TAGP_IO.$(OBJ) \
$(CODEDIR)TA_Evaluate.$(OBJ) $(CODEDIR)TAGP_IO_Final.
$(OBJ) \
$(CODEDIR)TAGP_Edit.$(OBJ) $(CODEDIR)TAGP_Breed.$
(OBJ)

CODE = $(CODEDIR)stdtypes.$(F) $(CODEDIR)mtprng.$
(F) $(CODEDIR)TAGP_Modules.$(F) \
$(CODEDIR)f2kcli.$(F) $(CODEDIR)mrgrnk.$
(F) $(CODEDIR)solvopt.$(F) \
$(CODEDIR)TAGP_IO_Options.$(F) $(CODEDIR)TAGP_Utilities.$
(F) \
$(CODEDIR)TAGP_Populate.$(F) $(CODEDIR)TAGP_IO_Data.$
(F) $(CODEDIR)TAGP_IO.$(F) \
$(CODEDIR)TA_Evaluate.$(F) $(CODEDIR)TAGP_IO_Final.$
(F) \
$(CODEDIR)TAGP_Edit.$(F) $(CODEDIR)TAGP_Breed.$(F)

all:
$(FC) $(MODFLAGS) $(FFLAGS0) $(FPP) $(DFLAGS) $(CODE)
$(FC) $(FPP) $(EXENAME) $(FFLAGS) $(FFLAGSP4) $(DFLAGS) $(CODE) $
(CODEDIR)TAGP.f90
debug:
$(FC) $(MODFLAGS) $(FFLAGS0) $(FPP) $(DFLAGS) $(CODE)
$(FC) $(FPP) $(EXENAME) $(DFLAGS) $(CODE) $(CODEDIR)TAGP.f90
mkl:
$(FC) $(MODFLAGS) $(FFLAGS0) $(FPP) $(DFLAGS) $(CODE)
$(FC) $(FPP) $(MKLP4FPP) $(EXENAME) $(FFLAGS) $(FFLAGSP4) $(CODE) $
(CODEDIR)TAGP.f90 $(MKLP4)
clean:
rm *.$(OBJ) *.mod

make.sh
#!/usr/bin/bash

g95 -c -cpp -DG95 stdtypes.f90 mtprng.f90 TAGP_Modules.f90 mrgrnk.f90
solvopt.f90 TAGP_IO_Options.f90 TAGP_Utilities.f90 TAGP_Populate.f90
TAGP_IO_Data.f90 TAGP_IO.f90 TA_Evaluate.f90 TAGP_IO_Final.f90
TAGP_Edit.f90 TAGP_Breed.f90

g95 -cpp -DG95 -ftrace=full -o findrule stdtypes.f90 mtprng.f90
TAGP_Modules.f90 mrgrnk.f90 solvopt.f90 TAGP_IO_Options.f90
TAGP_Utilities.f90 TAGP_Populate.f90 TAGP_IO_Data.f90 TAGP_IO.f90
TA_Evaluate.f90 TAGP_IO_Final.f90 TAGP_Edit.f90 TAGP_Breed.f90 TAGP.f90

Beliavsky

unread,
Jun 8, 2007, 2:09:34 PM6/8/07
to
On Jun 8, 1:44 pm, henry <henry.huil...@gmail.com> wrote:
> I have a bunch of Fortran applications from my adviser and I need use
> them to create a executable program. My adviser gave me a makefile to
> do the job. But honestly, I don't know how to run the makefile in
> Cygwin. I changed the makefile to a two simple command line file and
> created an executable program. But due to some memory problem, the
> results are not complete. My adviser uses Compaq Visual Fotran 6.5 and
> generate an executable program works fine. However when I add all the
> Fortran application files into one project, I got tons of error
> message. I don't know what I did wrong. Please give me some advise on
> how to run the bunch of Fortran applications in Visual Fortran. Thanks
> a lot!
>
> The followings are the makefile and a simplified shell file I
> create.
> makefile:
> # g95/Cygwin on Windows
> # ----------------------------------
> FC = g95

If you want to use Compaq Visual Fortran, why does the make file
refers to g95, a very different compiler?

henry

unread,
Jun 8, 2007, 3:38:01 PM6/8/07
to
The makefile is for g95. It there a makefile for Compaq Visual
Fortran? I DO find one makefile for Intel Fortran Compiler as follows.
Can I compile the bunch of Fortran applications directly without
makefile? Many thanks.

# Intel Fortran Compiler for Linux 7.0
# ----------------------------------
FC = ifort
DFLAGS = -C -Vaxlib -g
FFLAGS = -O3 -Vaxlib -ipo -pad -w95 -parallel
MODFLAGS = -c
FFLAGSP4 = -tpp7 -xW

dpb

unread,
Jun 8, 2007, 3:50:53 PM6/8/07
to
henry wrote:
> The makefile is for g95. It there a makefile for Compaq Visual
> Fortran?

Dunno, never looked if there's something provided or not -- well,
actually, I know there is but I never used it. You can have one
auto-generated from the IDE by some incantation which I also haven't
done, but I'm sure the help files along with some experimentation
could/would lead you to it.

> Can I compile the bunch of Fortran applications directly without
> makefile?

Of course. Make a batch file containing the options you want and submit
it at the command line in whatever CLI you choose (I use the JPSoft
4DOS/4NT in lieu of the MS-supplied, but can manage most anything w/ MS
with enough tribulation).

"df /?" at the command line will list all options for the compiler
although you may find the helpfiles more convenient.

--

Gib Bogle

unread,
Jun 8, 2007, 10:20:06 PM6/8/07
to

As far as I can see, you should be able to build findrule.exe by typing
the following command in a Command Prompt window:

df stdtypes.f90 mtprng.f90 TAGP_Modules.f90 mrgrnk.f90 solvopt.f90

TAGP_IO_Options.f90 TAGP_Utilities.f90 TAGP_Populate.f90
TAGP_IO_Data.f90 TAGP_IO.f90 TA_Evaluate.f90 TAGP_IO_Final.f90

TAGP_Edit.f90 TAGP_Breed.f90 TAGP.f90 /exe:findrule.exe

If it gives module errors just repeat the command (the modules need to
be created before use). I can't see any reason to use Cygwin if you are
compiling with CVF. You might still want to create a makefile though.
You can use the MS program nmake (read the docs). Don't you have MS
Visual Studio? This is what I use with CVF instead of makefiles.

dpb

unread,
Jun 9, 2007, 9:48:12 AM6/9/07
to
dpb wrote:
> henry wrote:
>> The makefile is for g95. It there a makefile for Compaq Visual
>> Fortran?
>
...
> ...You can have one auto-generated from the IDE by some incantation ...

I had the IDE open and thought to look...

Project--> Export Makefile

--

Gary Scott

unread,
Jun 9, 2007, 11:37:00 AM6/9/07
to

Yes...but if you really want to use VISUAL Fortran, then you would
probably be using the IDE and it's quite nice project management features.

>
> --


--

Gary Scott
mailto:garylscott@sbcglobal dot net

Fortran Library: http://www.fortranlib.com

Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html

If you want to do the impossible, don't hire an expert because he knows
it can't be done.

-- Henry Ford

dpb

unread,
Jun 9, 2007, 12:41:54 PM6/9/07
to
Gary Scott wrote:
> dpb wrote:
>> dpb wrote:
>>
>>> henry wrote:
>>>
>>>> The makefile is for g95. It there a makefile for Compaq Visual
>>>> Fortran?
>>>
>>>
>> ...
>>
>>> ...You can have one auto-generated from the IDE by some incantation ...
>>
>>
>> I had the IDE open and thought to look...
>>
>> Project--> Export Makefile
>
> Yes...but if you really want to use VISUAL Fortran, then you would
> probably be using the IDE and it's quite nice project management features.
>

True (and mostly why I didn't recall initially), but that wasn't the
question asked... :)

--

Gary Scott

unread,
Jun 9, 2007, 1:33:10 PM6/9/07
to
dpb wrote:

I know...I forgot to add that the VS project management features are
less to my liking in more recent versions (the "solution" versions).

0 new messages