Mat,
The beta fixes the problem I got with the common block work around:
chulbert@hulbert ~
$ cat testm_com.f90
MODULE TESTM
TYPE A_TYPE
INTEGER :: AN_INT
END TYPE A_TYPE
COMMON /A_COM/ A
TYPE(A_TYPE) :: A
!DEC$ ATTRIBUTES DLLEXPORT :: /A_COM/
CONTAINS
SUBROUTINE PRINT_A
!DEC$ ATTRIBUTES DLLEXPORT :: PRINT_A
WRITE(,) A%AN_INT
END SUBROUTINE
END MODULE
chulbert@hulbert ~
$ cat testp.f90
USE TESTM
A%AN_INT = 1
CALL PRINT_A
END
chulbert@hulbert ~
$ pgf90 -V
pgf90 7.0-1 32-bit target on Windows
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
chulbert@hulbert ~
$ ./testp.exe
1
chulbert@hulbert ~
$ pgf90 -Mmakedll testm_com.f90
Creating library testm_com.lib and object testm_com.exp
chulbert@hulbert ~
$ pgf90 -otestp.exe -I. testp.f90 testm_com.lib
testp.f90:
chulbert@hulbert ~
$ ./testp.exe
1
However, without using the common block, they are still using different symbols:
chulbert@hulbert ~
$ cat testm.f90
MODULE TESTM
TYPE A_TYPE
INTEGER :: AN_INT
END TYPE A_TYPE
TYPE(A_TYPE),PUBLIC :: A
!DEC$ ATTRIBUTES DLLEXPORT :: A
CONTAINS
SUBROUTINE PRINT_A
!DEC$ ATTRIBUTES DLLEXPORT :: PRINT_A
WRITE(,) A%AN_INT
END SUBROUTINE
END MODULE
chulbert@hulbert ~
$ pgf90 -Mmakedll testm.f90
Creating library testm.lib and object testm.exp
chulbert@hulbert ~
$ pgf90 -otestp.exe -I. testp.f90 testm.lib
testp.obj : warning LNK4217: locally defined symbol _testm_0 imported in function MAIN
testp.f90:
chulbert@hulbert ~
$ ./testp.exe
0
This can be seen using dependency walker. In the first case, A_COM shows up as a symbol. In the second, A does not. If I look at the symbols of the object files, I can see that in testm.f90, the variable A gets mapped to _testm_0 (this I should have deduced from the warning about locally importing the symbol when compiling the exe). If I manually export that symbol in the DLL, I get the expected results (Note that this also works for 6.2-5).
chulbert@hulbert ~
$ pgf90 -Mmakedll -Wl,-export:testm_0 testm.f90
Creating library testm.lib and object testm.exp
testm.f90:
chulbert@hulbert ~
$ pgf90 -otestp.exe -I. testp.f90 testm.lib
testp.f90:
chulbert@hulbert ~
$ ./testp.exe
1