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

error #5462: Global name too long with ifort 15.0.2

Porter__Andrew
Beginner
1,264 Views

Hello,

I'm attempting to compile some Fortran code with ifort 15.0.2.
The compilation fails with:

algorithm/psy_dynamo_algorithm_rk_timestep_mod.f90(1): error #5462: Global name too long, shortened from: psy_dynamo_algorithm_rk_timestep_mod_mp_invoke_3_compute_mass_matrix_kernel_w2_type_$BLK.var$3033 to: sy_dynamo_algorithm_rk_timestep_mod_mp_invoke_3_compute_mass_matrix_kernel_w2_type_$BLK.var$3033

I found this thread which appears to indicate this problem was fixed back in version 12: https://software.intel.com/en-us/forums/topic/286764

Has it re-appeared and is there some flag/workaround for it?

Thanks,

Andy.

0 Kudos
5 Replies
mecej4
Honored Contributor III
1,264 Views

The older thread that you referred to relates to cases where the module name was used twice (with some characters left out) in constructing the linker name. That bug was resolved, but Dr. Fortran did warn that the linker still imposes limits on the length of external symbol names, see https://software.intel.com/en-us/forums/topic/286764#comment-1571199 . Your symbol contains 97 characters, and the linker decided to reduce the length to 96 characters by deleting the first character. You could see if you are using the latest version of the linker available.

0 Kudos
Steven_L_Intel1
Employee
1,264 Views

This error is reported by the compiler, not the linker, though it may indeed be a linker restriction. The compiler has generated a name for a variable it created based on the module and procedure name, and this went over the 96 character limit. I suggest not pushing the limits of symbol naming and keep any individual name to 31 characters or less.

0 Kudos
Porter__Andrew
Beginner
1,264 Views

Thanks for the responses. I think we'll have to mandate the maximum length of any symbols in our coding standard as they are getting a bit wordy.

While I'm here, you may be interested to know that gfortran seems to cope OK with these long names.

0 Kudos
mecej4
Honored Contributor III
1,264 Views

Andrew Porter wrote:
While I'm here, you may be interested to know that gfortran seems to cope OK with these long names.

Apparently, for sufficiently small lengths of "these long names".

#define FNAME integerfunctionwithlongnamegreaterthan96charactersAintegerfunctionwithlongnamegreaterthan96charactersB
program tst
implicit none
integer :: i,j
integer, external :: FNAME
j=2
i=FNAME(i)
write(*,*)j
end program
!
function FNAME(i) result(j)
implicit none
integer :: i,j
j = i*i
return
end function

With GFortran 4.8.3 I get for this program:

$ gfortran longname.F90
longname.F90:5.85:

xternal :: integerfunctionwithlongnamegreaterthan96charactersAintegerfunctionwi
                                                                           1
Error: Name at (1) is too long
...

For this version of GFortran, the limit imposed by the compiler appears to be 64 characters.

0 Kudos
Steven_L_Intel1
Employee
1,264 Views

Well, that's not quite the same thing. In Andrew's case, the global name has a module name, routine name, the _mp_ separator and some compiler-generated stuff at the end. I did a test with a module and procedure name of 45 characters each. gfortran could build it, ifort couldn't. Interesting....

0 Kudos
Reply