- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm receiving an "error #6405: The same named entity from different modules and/or program units cannot be referenced. [VERIFICATION_FLG]" when compiling in DEBUG mode for versions 11.0.075 - 11.1.038 whereas I did not have these in previous versions of the FORTRAN compiler. The compiler indicates the error on the second invoke of an external function and any subsequent invokes made in the code. The code will compile successfully if the function is only invoked one time.
I created a sample project to illustrate which contains three source code files:
1.) Main
2.) External Function
3.) Module
I've attached the three source code files for examination. I would appreciate any helpful advice. Thanks!
I created a sample project to illustrate which contains three source code files:
1.) Main
2.) External Function
3.) Module
I've attached the three source code files for examination. I would appreciate any helpful advice. Thanks!
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a compiler bug which I have escalated as issue DPD200139304. You encounter this problem if you do the following:
1. Declare a Fortran procedure as EXTERNAL in a module, not using an interface block
2. Use the module
3. Call the procedure more than once
My preference for coding this sort of thing is either:
1. Make the procedure a module procedure and not external
2. As noted in this thread, write an INTERFACE block for the procedure. I don't like this because, as I have written elsewhere, writing an interface for a Fortran procedure means you're writing it twice and have to keep it consistent.
1. Declare a Fortran procedure as EXTERNAL in a module, not using an interface block
2. Use the module
3. Call the procedure more than once
My preference for coding this sort of thing is either:
1. Make the procedure a module procedure and not external
2. As noted in this thread, write an INTERFACE block for the procedure. I don't like this because, as I have written elsewhere, writing an interface for a Fortran procedure means you're writing it twice and have to keep it consistent.
Link Copied
9 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Glenn
I'm receiving an "error #6405: The same named entity from different modules and/or program units cannot be referenced. [VERIFICATION_FLG]" when compiling in DEBUG mode for versions 11.0.075 - 11.1.038 whereas I did not have these in previous versions of the FORTRAN compiler. The compiler indicates the error on the second invoke of an external function and any subsequent invokes made in the code. The code will compile successfully if the function is only invoked one time.
I created a sample project to illustrate which contains three source code files:
1.) Main
2.) External Function
3.) Module
I've attached the three source code files for examination. I would appreciate any helpful advice. Thanks!
I created a sample project to illustrate which contains three source code files:
1.) Main
2.) External Function
3.) Module
I've attached the three source code files for examination. I would appreciate any helpful advice. Thanks!
I think that declaring Verification_Flg as external is not right. When you put it in an interface block, it works just fine...
Markus
[cpp]MODULE Module_Externals interface logical function Verification_Flg(c,r) INTEGER,INTENT(IN),OPTIONAL:: c INTEGER,INTENT(IN),OPTIONAL:: r end function Verification_Flg end interface ENDMODULE Module_Externals[/cpp]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - onkelhotte
I think that declaring Verification_Flg as external is not right. When you put it in an interface block, it works just fine...
Markus
[cpp]MODULE Module_Externals interface logical function Verification_Flg(c,r) INTEGER,INTENT(IN),OPTIONAL:: c INTEGER,INTENT(IN),OPTIONAL:: r end function Verification_Flg end interface ENDMODULE Module_Externals[/cpp]
Markus,
Thanks for the quick response and quick fix to my problem.
Glenn.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The original code should work, though the interface block is preferable. It would be best if the called function were a module procedure so you didn't have to declare it twice.
I'll raise this to the developers.
I'll raise this to the developers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a compiler bug which I have escalated as issue DPD200139304. You encounter this problem if you do the following:
1. Declare a Fortran procedure as EXTERNAL in a module, not using an interface block
2. Use the module
3. Call the procedure more than once
My preference for coding this sort of thing is either:
1. Make the procedure a module procedure and not external
2. As noted in this thread, write an INTERFACE block for the procedure. I don't like this because, as I have written elsewhere, writing an interface for a Fortran procedure means you're writing it twice and have to keep it consistent.
1. Declare a Fortran procedure as EXTERNAL in a module, not using an interface block
2. Use the module
3. Call the procedure more than once
My preference for coding this sort of thing is either:
1. Make the procedure a module procedure and not external
2. As noted in this thread, write an INTERFACE block for the procedure. I don't like this because, as I have written elsewhere, writing an interface for a Fortran procedure means you're writing it twice and have to keep it consistent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Thanks for the response. I'll see about adjusting the code as you suggest, meanwhile, I'll be awaiting a new release that corrects the compiler bug.
Thanks,
Glenn.
Thanks for the response. I'll see about adjusting the code as you suggest, meanwhile, I'll be awaiting a new release that corrects the compiler bug.
Thanks,
Glenn.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You will be waiting a while - I don't expect this one, given its easy workaround and limited exposure, to be fixed before the next major release.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
The original code should work, though the interface block is preferable. It would be best if the called function were a module procedure so you didn't have to declare it twice.
I'll raise this to the developers.
I'll raise this to the developers.
OPTIONAL => explicit interface
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Repeat Offender
OPTIONAL => explicit interface
Well, yes. Remember that making the routine a module procedure automatically creates an explicit interface. Ideally, you should need INTERFACE blocks only for non-Fortran routines or when declaring generics.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The compiler bug giving the spurious error will be fixed in a future update.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page