Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

how to use intel 11.1 for linux

milenko1976
Beginner
1,846 Views
I have downloaded and installed compiler,following the instructions but..The program mt3,I am trying to compile and debug is directory of 11 files,written in FORTRAN77.How to do it?
milenko@hp6830s:~$ source /opt/intel/Compiler/11.1/072/bin/ifortvars.sh intel64
milenko@hp6830s:~$ which fort
milenko@hp6830s:~$ which ifort
/opt/intel/Compiler/11.1/072/bin/intel64/ifort

How should I link comiler and mt3 program?
0 Kudos
13 Replies
mecej4
Honored Contributor III
1,846 Views
The standard Unix/Linux way:

ifort a.f b.f c.f d.f e.f f.f g.f h.f i.f j.f k.f
./a.out

if the eleven files are a.f,..., k.f
0 Kudos
milenko1976
Beginner
1,846 Views
Well besides that,I have 3 .dat files.How to invoke them?
0 Kudos
TimP
Honored Contributor III
1,846 Views
OPEN is fortran 77 syntax. Any non-standard scheme for opening the files is up to you to discover. If you want help, you'll need to give us more detail.
0 Kudos
milenko1976
Beginner
1,846 Views
I know for OPEN.What I thought is a makefile,analogy to gcc.Any links would be great to see examples.
0 Kudos
milenko1976
Beginner
1,846 Views
I am giving one detail more form my makefile(gcc):
# Executables
mt1: mt1.o indat.o re2.o defpol12.o boufld.o koef3.o gaussr.o sflfld.o koef3rhs.o gaussrrhs.o surfce.o d2.dat fdat.dat fres.dat fun.dat
$(F77) $(FLAGS) -o mt1 mt1.o indat.o re2.o defpol12.o boufld.o koef3.o gaussr.o sflfld.o koef3rhs.o gaussrrhs.o surfce.o

How should I presnt this to Intel 11.1 compiler?
0 Kudos
mecej4
Honored Contributor III
1,846 Views
In your makefile, insert this line near the top:

F77 = ifort
0 Kudos
milenko1976
Beginner
1,846 Views
What about flags?Are they really important?
0 Kudos
mecej4
Honored Contributor III
1,846 Views
At this stage, probably not, especially if the code was brought over from a different of machine/compiler combination. Look up the Intel users guide and choose flags suitable for debugging: -g and -traceback. Once you get the program working, record the results, raise the optimization level, and see if the new results are close enough.
0 Kudos
milenko1976
Beginner
1,846 Views
Thanks mecej4.
I still have multiple main problem
indat.f:(.text+0x0): multiple definition of `MAIN__'
mt3.o:mt3.f:(.text+0x0): first defined here
Changed compiler flags but no results.
0 Kudos
TimP
Honored Contributor III
1,846 Views
There isn't any compiler flag to ignore a second main program. If you mean for one of them to be ignored, you'll have to remove it in source code, e.g. by pre-processor conditional compilation directives.
0 Kudos
mecej4
Honored Contributor III
1,846 Views
It appears that you did not use the makefile that you posted an extract from earlier. The line for mt1 does not show both indat.o and mt3.o.

A Fortran program may consist of (i) exactly one main program routine, plus (ii) zero or more subroutines plus (iii) zero or more function subprograms (setting aside (iv) BLOCKDATA, COMMON blocks, etc).

You are trying to use two main program routines in one program. If you don't mind the analogy, it is similar to having two bicycles. You can only ride one of them at one time.

You have to make the selection of the main program yourself. Compiler switches and makefiles will not do that selection for you.

You will probably benefit from reading introductory textbooks on programming.
0 Kudos
milenko1976
Beginner
1,846 Views
Thanks.
But I know that only one main is allowed,it should be mt3.Actually I am calling subroutine indat from mt3(it should give me conductivity map).Look at my makefile:

INTEL_MKL = /opt/intel/Compiler/11.1/072/mkl

F77 = ifort
LD = ifort
CPPFLAGS = -C -traditional $(DFLAGS) -I$(INTEL_INC)
FCFLAGS = $(DFLAGS) -I$(INTEL_INC) -O2 -g -traceback
LDFLAGS = $(FCFLAGS)
LIBS = -L$(INTEL_LIB) -lmkl_intel_lp64
OBJECTS_ARCHITECTURE = machine_intel.o


# Executables
mt3: mt3.o indat.o iaa.o re2.o defpol12.o boufld.o koef3.o gaussr.o sflfld.o koef3rhs.o gaussrrhs.o surfce.o d2.dat fdat.dat fres.dat fun.dat
$(F77) $(FLAGS) -o mt3 mt3.o indat.o iaa.o re2.o defpol12.o boufld.o koef3.o gaussr.o sflfld.o koef3rhs.o gaussrrhs.o surfce.o

What is wrong?
0 Kudos
milenko1976
Beginner
1,846 Views
Mangage to solve the problem.
Just get rid of one END!
0 Kudos
Reply