Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28630 Discussions

Problems using Intel(R) compiler.. (novice user)

nickschurch
Beginner
260 Views
I seem to be having some problems using ifort to compile a gar-hydrodynamics program, called Zeus, written in Fortran90.

My computer runs duel Intel Core 2 processors (64 bit) and runs Scientific Linux (based on Fedora Core something-or-other). I have installed the intel Fortral compiler package appropriate for these processors (Intel 64 bit - file l_fc_p_10.1.015_intel64.tar.gz), and it seems to be working correctly (but I am far from an expert!).

When I attempt to build some of the libraries needed by the code I get the following error

[njs@Quezovercoatl nmlst]$ ifort namelist.f
namelist.f(2511): (col. 11) remark: LOOP WAS VECTORIZED.
namelist.f(2514): (col. 11) remark: LOOP WAS VECTORIZED.
namelist.f(1574): (col. 13) remark: LOOP WAS VECTORIZED.
namelist.f(1489): (col. 13) remark: LOOP WAS VECTORIZED.
namelist.f(1404): (col. 13) remark: LOOP WAS VECTORIZED.
namelist.f(1169): (col. 11) remark: LOOP WAS VECTORIZED.
namelist.f(1081): (col. 11) remark: LOOP WAS VECTORIZED.
namelist.f(998): (col. 11) remark: LOOP WAS VECTORIZED.
namelist.f(689): (col. 33) remark: LOOP WAS VECTORIZED.
namelist.f(689): (col. 33) remark: LOOP WAS VECTORIZED.
/compilers/intel/fortran/lib
/for_main.o: In function `main':
/export/users/nbtester/efi2linuxx86_nightly/branch-10_1/20080313_000000/libdev/frtl/src/libfor/for_main.c:(.text+0x26): undefined reference to `MAIN__'

Unfortunately I'm far from a fortran expert and have no real idea what this error is. Does anyone know what this means, or have any ideas/suggestions on how I should proceed?
0 Kudos
2 Replies
Steven_L_Intel1
Employee
260 Views
First, the "LOOP WAS VECTORIZED" messages are informational messages that tell you about optimizations. The real problem is that the source file you compiled does not contain a main program - perhaps it is is just a subroutine or function. When you use ifort without -c, it assumes you are building an executable and wants to find the main program. (This is no different from other compilers.)

If you are building a library, then use "ifort -c" to compile to a .o object. You would then need to use "ar" to construct the library.
0 Kudos
Kevin_D_Intel
Employee
260 Views

You will receive that error when trying to compile and link a Fortran source file that does not provide a Fortran MAIN program. I suspect namelist.f may contain only subprograms and thus is not expected to be compiled and linked.

To only compile namelist.f, add c option.

You will need to inspect the Zeus application build procedure (perhaps a makefile?) to know how the application compiles all the associated source files and then links the object files to create the resulting executable.

0 Kudos
Reply