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

problem with modules f95

milenko1976
Beginner
312 Views
Well I have problem with code like this:
driver_mt2ddi.for:(.text+0xcca6): undefined reference to `mt2dmod_mp_syy_'
driver_mt2ddi.for:(.text+0xcccb): undefined reference to `mt2dmod_mp_bob_'
driver_mt2ddi.for:(.text+0xccd4): undefined reference to `mt2dmod_mp_bob_'
driver_mt2ddi.o: In function `gsres0el_':
driver_mt2ddi.for:(.text+0xd519): undefined reference to `fdsystem_mp_nk_'
driver_mt2ddi.for:(.text+0xd521): undefined reference to `fdsystem_mp_m1_'
It does not recognize modules.My colegue with whom I cooperate has compiled code on Intel Visual Windows and it is working fine.I am trying on Intel Composer 2011.
0 Kudos
2 Replies
Kevin_D_Intel
Employee
312 Views
The attachedsource file compiles/links (see below) but I suspect it is a concatenation of separate source files compiled individually in the makefile; therefore, to address the undefined references I believe you should change the mt2d rule to include the .o files corresponding to source files containing the various modules used.

So, one possible re-write of the mt2d rule is to add the .o files to the actual link command-line as shown in bold below.

mt2d: driver_mt2ddi.o constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o
$(F95) -o $(FFLAGS) mt2d constants.o settings.o params.o mt2dmod.o fdsystem.o mt2ddat.o mt2dsens.o driver_mt2ddi.o


$ ifort -V MT2DDIB1.FOR

Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.2.134 Build 20110112
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.

Intel Fortran 12.0-1259
GNU ld version 2.19.51.0.14-37.fc12 20090722

0 Kudos
milenko1976
Beginner
312 Views
Thanks Kevin,it is working now fine.
0 Kudos
Reply