On Sunday, October 8, 2017 at 2:44:48 PM UTC-4, Richard Weed wrote:
> ..
>
> I'm still curious as to why the Intel compiler didn't die in the module with the ambiguity and also didn't gripe about an ambiguity when it I used the generic interface in a separate module later in the compilation. I changed the
> code to get rid of the generic interface so this not really a big deal for me. The fact this occurs with Intel 17 maybe points to a potential flaw in how Intel is trying to resolve the ambiguity. Also, if it had just been Intel I would have not questioned the gfortran results as much but PGI 17.4 exibited the same behaviour as Intel so I was inclined to believe the professionals more than I was the amatuers.
@Richard Weed,
There are multiple factors at play but I think your reading of the situation is alright in some situations but highly questionable in other aspects.
Your latest comment, "I was inclined to believe the professionals more than I was the amatuers." is baseless as well as needless, especially what the two terms - professionals and amateurs - imply in the most common vernacular.
What really, really matters now, more so than any computer science skills, when it comes to Fortran compiler development is PASSION and CARING and INTEREST and ENTHUSIASM for the Fortran language, particularly given the post-1970s history in computer engineering where "FORTRAN" has essentially and effectively been looked upon with derision and worst.
In Paul Rich Thomas et al., gfortran development team consists of volunteers who bring utmost passion and caring and attention of details toward the task. Their achievements are indeed superlative compared to all their commercial peers.
From what I see, the commercial vendors struggle with the above aspects with the folks on their team, many of whom are primarily C++ developers and who perhaps view the Fortran compiler as just another C++ application.
Now when it comes to Intel Fortran compiler, I think you have a point in thinking, "this .. points to a potential flaw in how Intel is trying to resolve the ambiguity".
To give Intel its due credit, they show a healthy willingness to improve all their software products, Intel Fortran compiler being one of several dozen high-performance software products they commercialize. Accordingly, they have a new Online Support Center (OSC) you may be aware of:
https://supporttickets.intel.com/?lang=en-US
The approach instituted by Intel is for developers to report their issues directly at the OSC. I suggest you do so for all the issues you face with Intel Fortran compiler, if you are not already.
Back to the point about "a potential flaw in how Intel is trying to resolve the ambiguity", it can be proven by considering the following simple case involving an ambiguous generic interface:
--- begin simple case ---
module m
implicit none
interface
function f1( i1, i2 ) result ( r )
! Argument list
integer, intent(in) :: i1
integer, intent(in), optional :: i2
! Function result
integer :: r
end function f1
function f2( i1, i2, i3 ) result ( r )
! Argument list
integer, intent(in) :: i1
integer, intent(in) :: i2
integer, intent(in), optional :: i3
! Function result
integer :: r
end function f2
end interface
interface f
procedure f1
procedure f2
end interface
end module
--- end simpler case ---
For the above simple case, the compiler notices the ambiguous interface problem and issues an error:
--- begin compilation output for simple case ---
xx>ifort /c /standard-semantics /warn:all /check:all m.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.0.124 Build 20170811
Copyright (C) 1985-2017 Intel Corporation. All rights reserved.
m.f90(15): error #5286: Ambiguous generic interface F: previously declared speci
fic procedure F1 is not distinguishable from this declaration. [F2]
function f2( i1, i2, i3 ) result ( r )
---------------^
compilation aborted for m.f90 (code 1)
--- end compilation output for simple case ---
Now consider a slightly more complicated case that I can consider is a *minimal working example (MWE)* for what you show in the original post:
--- begin problem case ---
module m
interface
function f1( i1, i2 ) result ( r )
! Argument list
integer, intent(in), optional :: i1
integer, intent(in), optional :: i2
! Function result
integer :: r
end function f1
function f2( i1, i2, i3, i4 ) result ( r )
! Argument list
integer, intent(in) :: i1
integer, intent(in) :: i2
integer, intent(in), optional :: i3
integer, intent(in), optional :: i4
! Function result
integer :: r
end function f2
end interface
interface f
procedure f1
procedure f2
end interface
end module
--- end problem case ---
Upon compilation, no errors or warnings are generated:
--- begin compilation output for problem case ---
xx>ifort /c /standard-semantics /warn:all /check:all m.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.0.124 Build 20170811
Copyright (C) 1985-2017 Intel Corporation. All rights reserved.
--- end compilation output for problem case ---
My read now is Intel Fortran compiler does indeed intend to generate compilation-time diagnostics for ambiguous generic interfaces in accordance with C1215 constraint (Fortran 2008, the 'official' version yet of the standard). It succeeds with the simple case shown above but not with the slightly more complex situation.
So I have submitted a request with Intel Fortran team at the OSC to enhance their compiler further; will see how they respond.