Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
16 Views

18.01 bug(??) when resolving in submodule structure

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
Highlighted
Honored Contributor I
16 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
Highlighted
Beginner
16 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