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

Compile Error : Same Named entity ....

mayur_pal
Beginner
922 Views

Hello,

While compiling a fortran code on Intel fortran compiler 10.1.011 using visual studio. I ran into following error,

censub.f(110) : Error: The same named entity from different modules and/or program units cannot be referenced. [PRSINT]

censub.f(110) : Error: This name has not been declared as an array or a function. [PRSINT]

I am porting a old fortran 77 code to fortran 90.

Interface check for subroutines is switched off, Generate Block Interface is on.

Any suggestion help !!

Thanks

Mayur

0 Kudos
7 Replies
onkelhotte
New Contributor II
922 Views
A little more code would help...
0 Kudos
Steven_L_Intel1
Employee
922 Views
I'd also like to see the code - but I expect that turning off Generate Interface Blocks will make the error go away. Is PRSINT a recursive call?
0 Kudos
albert
Beginner
922 Views
Have similar problem, indeed it is with a recursive function (and subroutine)
Code:
====
recursive function fac(n) result(fac0)
integer n,fac0

if (n == 1) then
fac0 = 1
else
fac0 = n * fac(n-1)
fac0 = fac0 * fac(n-1)
endif
end

Command line and compilation result:
===========================
ifort tt.f90 -gen-interfaces -warn interface
fortcom: Error: tt.f90, line 8: The same named entity from different modules and/or program units cannot be referenced. [FAC]
fac0 = fac0 * fac(n-1)
------------------^

For the subroutine version:
Code:
=====
recursive subroutine fac_subr(n, fac0)
integer n,fac0

if (n == 1) then
fac0 = 1
else
call fac_subr(n-1, fac0)
call fac_subr(n-1, fac0)
fac0 = n * fac0
endif
end

Command line and compilation result:
===========================
ifort qq.f90 -gen-interfaces -warn interface
fortcom: Error: qq.f90, line 8: The same named entity from different modules and/or program units cannot be referenced. [FAC_SUBR]
call fac_subr(n-1, fac0)
---------^
compilation aborted for qq.f90 (code 1)

An observation:
- removing second call / invocation -> no message


Albert


0 Kudos
Steven_L_Intel1
Employee
922 Views
Albert, please update your compiler. This bug was fixed a few months ago. 10.1.024 is current.
0 Kudos
Zhanghong_T_
Novice
922 Views
Hi Steve,

I have a similar problem. The code is as follows:

integer:: i1, i2, i3
real*8:: d1, d2, d3
...
i3 = max (i1, i2)
d3 = max (d1, d2)
end

When compiling, the following error displayed:
Error: The same named entity from different modules and/or program units cannot be referenced.

However, if I change the "i3 = max (i1, i2)" to
i3 = imax0 (i1, i2)

The compiling can be passed.

My version is 10.1.029.

Thanks,
Zhanghong Tang

Quoting - Steve Lionel (Intel)
Albert, please update your compiler. This bug was fixed a few months ago. 10.1.024 is current.

0 Kudos
Steven_L_Intel1
Employee
922 Views
Not enough information shown. Can you provide a small but complete example?
0 Kudos
Zhanghong_T_
Novice
922 Views
Not enough information shown. Can you provide a small but complete example?
Oh, it is really strange. When I tried to figure out a simple example, it passed the compiling and building, but for my real project, it did have such problem. I don't know what other factors lead to such error.

On the other hand, I will put a small example if I have simplified my current project.


Thanks,
Zhanghong Tang
0 Kudos
Reply