Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29394 Discussões

Problem with generic subroutine call

Arjen_Markus
Colaborador honorário II
887 Visualizações
Hello,

I have encountered a problem with the attached code. I have reduced it as far as
possible, but the error message disappears when I further simplify the code a bit.
I am using Intel Fortran 11.1 but the problem occurs in 12.0.3 as well.

The compiler claims there is no specific subroutineat line 89 of the code, whereas
gfortran is completely happy with and if I use the specific name (get_procedure_global)
instead of the generic name,Intel Fortran is happy too.

Background: I am using theoriginalto dynamically load libraries and subroutines therein.

It seems to be the procedure _component_ that triggers the error. If I change the
argument to proc, with the declaration:

procedure(creation_procedure), pointer :: proc

call get_procedure( dynlib, 'create_prng', proc, success )

the compiler is happy again.

Is this a compiler bug?

Regards,

Arjen
0 Kudos
4 Respostas
TimP
Colaborador honorário III
887 Visualizações
I was trying to see if the problem still showed up in a current compiler, but there is a missing module prng_class.
Arjen_Markus
Colaborador honorário II
887 Visualizações
Oops, it worked for me because the mod file was still present. Here is the
source code for that module:

! prng_class.f90 --

! Module defining the generic type for pseudo-random number

! generators (PRNG). Used by all specific PRNG implementations

!

module prng_class

implicit none

type, abstract :: prng

! No data

contains

procedure(get_next), deferred :: get

end type

abstract interface

real function get_next( params )

import :: prng

class(prng) :: params

end function get_next

end interface

end module prng_class


Regards,

Arjen

Arjen_Markus
Colaborador honorário II
887 Visualizações
Ah, good to hear that.

Regards,

Arjen
Steven_L_Intel1
Funcionário
887 Visualizações
I can reproduce the problem - at first glance it looks like a compiler bug, but I am not sure. Investigating...
Responder