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.
29285 Discussions

Not being able to compile a simple code

g3v
Beginner
576 Views
hello everyone!

I installed IFC under Mandrake Linux Kernel 2.4.22-10mdk, im fairly new to the linux platform,
so after installing IFC i tried to run a test file like everyone else called: hello.f
PROGRAM HELLO_WORLD
print *,'Hello World!'
END PROGRAM HELLO_WORLD
but for my surprise this is what i get after runing this code
[root@localhost tmp]# ifort hello.f
fortcom: Error: Illegal character in statement label field


fortcom: Error: Illegal character in statement label field
fortcom: Error: Illegal character in statement label field
fortcom: Error: Illegal character in statement label field
fortcom: Error: Illegal character in statement label field
fortcom: Error: First statement in file must not be continued
fortcom: Error: hello.f, line 2: Illegal character in statement label field


print *,'Hello World!'
^
fortcom: Error: hello.f, line 2: Illegal character in statement label field
print *,'Hello World!'
.^
fortcom: Error: hello.f, line 2: Illegal character in statement label field
print *,'Hello World!'
..^
fortcom: Error: hello.f, line 2: Illegal character in statement label field
print *,'Hello World!'
...^
fortcom: Error: hello.f, line 2: Illegal character in statement label field
print *,'Hello World!'
....^
fortcom: Error: hello.f, line 1: Syntax error, found END-OF-STATEMENT when expecting one of: ( : % . = =>
PROGRAM HELLO_WORLD
...................^
fortcom: Error: hello.f, line 3: Illegal character in statement label field
END PROGRAM HELLO_WORLD
^
fortcom: Error: hello.f, line 3: Illegal character in statement label field
END PROGRAM HELLO_WORLD
.^
fortcom: Error: hello.f, line 3: Illegal character in statement label field
END PROGRAM HELLO_WORLD
..^
fortcom: Error: hello.f, line 3: Illegal character in statement label field


END PROGRAM HELLO_WORLD
....^
fortcom: Error: hello.f, line 1: This is an invalid statement; an END [PROGRAM] statement is required.
PROGRAM HELLO_WORLD
......^
fortcom: Error: hello.f, line 1: This name does not match the unit name. [MHELLO_WORLD]
PROGRAM HELLO_WORLD
......^
fortcom: Error: hello.f, line 2: Syntax error, found '*' when expecting one of: ; BLOCK BLOCKDATA PROGRAM TYPE COMPLEX BYTE CHARACTER ...
print *,'Hello World!'
......^
fortcom: Severe: hello.f, line 2: Could not recover from previous syntax error
print *,'Hello World!'
......^
compilation aborted for hello.f (code 1)


What could be the problem? i did install IFC as instructed and everything seemed to go fine.
Please help.
Yaron

Message Edited by g3v on 03-21-2004 04:54 AM

0 Kudos
1 Reply
TimP
Honored Contributor III
576 Views
You've asked the compiler to use fixed format, when your file is free format. The simplest way to fix it is to change from .f to .f90 file suffix.
0 Kudos
Reply