Fails to link

The following program fails to link with the message

C:\Users\pkrysl\Documents\PGI>pgfortran ab_oo.f95
NOTE: your trial license will expire in 10 days, 2.67 hours.
NOTE: your trial license will expire in 10 days, 2.67 hours.
pgfortran7fhqzbv9tnTEi9.obj : error LNK2019: unresolved external symbol _GCELLSE
T_MODULE_MAKE_GCELLSET@20 referenced in function _GCELLSET_3_MANIFOLD_MODULE_MAK
E_GCELLSET_3_MANIFOLD@16
ab_oo.exe : fatal error LNK1120: 1 unresolved externals

Does this have to do with the passing of private/public arguments (TPR#17246)?

module kinds_module
integer, parameter :: integer_kind =SELECTED_INT_KIND(9)
real, parameter :: real_kind =SELECTED_REAL_KIND(15)
end module

module gcellset_module
use kinds_module
implicit none

type gcellset_type
integer (integer_kind) :: id_=1
integer (integer_kind), allocatable :: conn_(:,:)
contains
procedure, pass :: nfens
procedure, pass :: id
procedure, pass :: conn
end type gcellset_type

contains

subroutine make_gcellset(gcells,conn,id)
type (gcellset_type), intent(out) :: gcells
integer (integer_kind), intent(in) :: conn(:,:)
integer (integer_kind), intent(in), optional :: id
gcells%id_=id
allocate(gcells%conn_(size(conn,1),size(conn,2)))
gcells%conn_=conn
end subroutine

function id(self) result(res)
class (gcellset_type), intent(in) :: self
integer (integer_kind) :: res
res=self%id_
end function

function nfens(self) result(res)
class (gcellset_type), intent(in) :: self
integer (integer_kind) :: res
res= size(self%conn_,1)
end function


function conn(self,range) result(res)
class (gcellset_type), intent(in) :: self
integer (integer_kind), intent(in) :: range(:)
integer (integer_kind) :: res(size(range),size(self%conn_,2))
res=self%conn_(range,:)
end function

end module

module gcellset_3_manifold_module
use kinds_module
use gcellset_module
implicit none

type, extends(gcellset_type) :: gcellset_3_manifold_type
contains
Procedure, pass:: manifdim
end type

contains

subroutine make_gcellset_3_manifold(gcells,conn,id)
type (gcellset_3_manifold_type), intent(out) :: gcells
integer (integer_kind), intent(in) :: conn(:,:)
integer (integer_kind), intent(in), optional :: id
call make_gcellset(gcells%gcellset_type,conn,id)
end subroutine

function manifdim(self) result(res)
class (gcellset_3_manifold_type), intent(in) :: self
integer (integer_kind) :: res
res=3
end function

end module

program test

use kinds_module
use gcellset_module
use gcellset_3_manifold_module
implicit none

type (gcellset_3_manifold_type) :: gcells
integer (integer_kind) :: conns(3,2)
data conns /1, 2,3,2,3,4/
integer (integer_kind) :: range(1)
data range /2/

call make_gcellset_3_manifold(gcells,conns,1)

print *,‘Here id=’,gcells%id(),’ nfens=’,gcells%nfens(),’ conn=’,gcells%conn(range),’ manifdim=’,gcells%manifdim()

end program test

I think that the compiler has run into such difficulties compiling this code that the messages from it are not useful.

With the Linux-X64 version 10.8 of the compiler, an ICE is generated:

PGF90-F-0000-Internal compiler error. interf:new_symbol, symbol not found     584 (pgbug.f90: 55)
PGF90/x86-64 Linux 10.8-0: compilation aborted

Hi Petr,

Sorry for the late reply. I was hoping that we could find a work around. While I can get you around this error, the code will then get the ICE that N. Shamsundar, runtime error, or wrong answers depending on the compiler version and OS.

While this particular error is slightly different and only occurs on Win32, the root cause is the same as TPR#17246. Basically the compiler is getting confused and going down the ‘class’ code generation path for “gcells” in make_gcellset_3_manifold when it should be creating a ‘type’. F2003 support is very new and we obviously have some issues.

We appreciate you taking the time to post your code and we should be able to have this problem fixed by the 11.0 release later this year.

Thanks,
Mat