Undefined reference to procedure

Hi,
The following code does not compile under nvfortran 24.5. We use this structure to avoid a compilation cascade when modifying the body of procedure1. If procedure1 is put in a submodule of Mod_type1, then it works.

module Mod_Type1
   implicit none
   private
   public :: Type1

   type :: Type1
      contains
      procedure :: procedure1
   end type

   interface
      subroutine procedure1(a)
         import
         class(Type1) :: a
      end subroutine
   end interface

end module

subroutine procedure1(a)
   use Mod_Type1
   implicit none
   class(Type1) :: a

   write(*,*) 'a'
end subroutine


module Mod_Type2
   use Mod_Type1

   type, extends(Type1) :: type2

   end type
end module

program main
   use Mod_Type2
   implicit none
   
   type(Type2) :: Type2Object
   
   call Type2Object%procedure1

end program

The return error is:
/usr/bin/ld: /tmp/nvfortranGxfdbGTLhonsS.o:(.data+0x98): undefined reference to `mod_type1_procedure1_’

Thanks for the help!

Hi joan.baiges! I just reported your issue to engineering as report #35961. Hopefully an engineer will take a look at it and get it resolved for a future release of NVHPC. I’ll update you when I know more! Thank you for bringing this to our attention - it compiles perfectly fine with other compilers, so it appears to definitely be an issue in our compiler to me.

Hi joan.baiges - this issue should be fixed in the latest release of the compiler (24.9). Please let us know if you run into anymore issues! Thank you for letting us know about this problem.