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

Link warning - common block mismatch

pwalkergeoalgorithms
1,363 Views
I have the same common block in several subroutines located in multiple files. I get a link error, viz:

ld:0:0 warning: for symbol _iodev_ tentative definition of size 16 from WRT.o is being replaced by a real definition of size 12 from PINPUT1.o

the common block and variable definitions are

integer*4 in,out

logical*4 pinputerr

common /iodev/ in, out, pinputerr


Why is the linker concerned and how can the code be modified to eliminate this warning? Thanks. P.W.

0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,363 Views

The linker is telling you that the COMMON is declared with different sizes in different object files, and has even been so kind as to identify them for you. Do you INCLUDE the declarations from a single file or do you repeat the declarations in each file? Apparently in WRT, you have four variables in IODEV.

View solution in original post

0 Kudos
3 Replies
Steven_L_Intel1
Employee
1,364 Views

The linker is telling you that the COMMON is declared with different sizes in different object files, and has even been so kind as to identify them for you. Do you INCLUDE the declarations from a single file or do you repeat the declarations in each file? Apparently in WRT, you have four variables in IODEV.
0 Kudos
pwalkergeoalgorithms
1,363 Views

The linker is telling you that the COMMON is declared with different sizes in different object files, and has even been so kind as to identify them for you. Do you INCLUDE the declarations from a single file or do you repeat the declarations in each file? Apparently in WRT, you have four variables in IODEV.

Thanks - The variable and common definitions were cut and pasted into each routine to ensure uniformity, but I replaced that code with an include - problem persisted. I noted the data statement below which I replaced with explicit run-time inits of "in" and "out", and the problem disappeared. P.W.

data in, out, ind1, ind2, ind3, outd1, outd2, outd3

& / 5, 6, 4, 3, 2, 7, 8, 9 /

0 Kudos
Steven_L_Intel1
Employee
1,363 Views
Interesting. COMMON initialization should take place in a BLOCK DATA subprogram.
0 Kudos
Reply