Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26758 Discussions

18.01 bug(??) when resolving in submodule structure

may_ka
Beginner
91 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
91 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.

 

 

may_ka
Beginner
91 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

Reply