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

18.01 bug(??) when resolving in submodule structure

may_ka
Beginner
375 Views

Hi there

this code

Module Mod_testmod
  Type :: test_type
  contains
    Procedure, Pass :: bla => Subbla
    Final :: SubFinalizer
  End type test_type
  interface
    Module Subroutine Subbla(this)
      Class(test_type), Intent(Inout) :: this
    end Subroutine
    Module Subroutine SubFinalizer(this)
      Type(test_type), Intent(Inout) :: this
    end Subroutine
  end interface
End Module Mod_testmod
SubModule(Mod_testmod) submod_testmod
contains
  Module Procedure Subbla
    Implicit None
    write(*,*) "bla"
  End Procedure
  Module Procedure SubFinalizer
    Implicit None
    call this%bla()
  end procedure
end SubModule submod_testmod
Program Test
  use mod_testmod, only: test_type
  Implicit None
  Type(test_type) :: a
  call a%bla()
End Program Test

compiles with gfortran 7.2, ifort 17.05 and ifort 18.0, but with 18.01 it yields a compile time error:

/tmp/ifortaDf21e.o: In function `MAIN__':
Test.f90:(.text+0x88): undefined reference to `mod_testmod_mp_bla_'
/tmp/ifortaDf21e.o: In function `mod_testmod_mp_subfinalizer_':
Test.f90:(.text+0x16a): undefined reference to `mod_testmod_mp_bla_'

I presume that this is a bug, but a "black belt" may confirm.

Cheers

0 Kudos
2 Replies
FortranFan
Honored Contributor II
375 Views

may.ka wrote:

.. a "black belt" may confirm.

I'm not a black belt and that might be partly why you never acknowledge my feedback ever any way ..

It's a bug and it is yet another illustration of a regression with SUBMODULEs in 18.0 update 1:

https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/752348

A workaround is to avoid the "=> procedure_name" syntax.

 

 

0 Kudos
may_ka
Beginner
375 Views

Hi FortranFan,

I highly appreciate your contributions. I am just too lazy to write post containing only "Thank you".

Workaround is ok-ish but not applicable to large libraries. I prefer to wait for Intel to repair all that.

Cheers

0 Kudos
Reply