Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

How to "dllimport" BLANK COMMON

pco
Beginner
1,084 Views

Hello,

I am trying desperatly to import BLANK COMMON in a DDL.

For named common, it's work fine

CDEC$ ATTRIBUTES DLLIMPORT :: /COMTST/

Is there a special syntax for BLANK COMMON

I have tries //, / / and also names based of BLANK COMMON map name (/_BLNK__/,/__BLNK__/).

PS: I am exporting all symbols of my executable in a generated .DEF file

0 Kudos
5 Replies
Steven_L_Intel1
Employee
1,084 Views
Can't be done. Why not use named common?
0 Kudos
pco
Beginner
1,084 Views
I just have to modify several 100s of routines!

I am surprise that this feature which must required 5 minutes to compiler developer is not done (a // or /_BLNK__/ syntax would be appreciated).

I am sure it is possible to do that in C using "_BLNK__" internal name: I succeed to export this common, why is it not possible to import it ?

I want just to be able to export all symbols including blank common to allow real dynamic loading without any assumption concerning content of the DLL. Export all symbols is possible (a small awk on the map to generate .DEF than a new link). Equilalent dlopen routines are easy to develop. Now the last weak point of Windows is that it is not possible to import all these symbols!



0 Kudos
Steven_L_Intel1
Employee
1,084 Views

It's quite a bit more than five minutes, nobody has asked for it before and the syntax for such a thing would be rather odd.

You can fake it though. Consider the following:

program test
common /blank/ a,b,c
integer a,b,c
!dec$ attributes alias:"__BLNK__" :: /blank/
!dec$ attributes dllimport :: /blank/
type *, a,b,c
end
0 Kudos
pco
Beginner
1,084 Views

Thanks for the work around.

I will try to apply it to my dll module waiting for a cleaner solution.

But, unfortunatly, with this solution I will have not portable (or more precisly "ported") source code (specific "named blank common"for Windows) formy dynamically loadedmodules (CDEC$was OK, same source code can be compiled on all platforms).

All people who want to build dll sharing blank common have the same issue.

I was suprise to be the first one to signal this issue, so I have done a small search and I have founda thread in this forum (http://softwareforums.intel.com/en-us/forums/showpost.php?p=2445 and many other threads concerning this point in other forums).

I will wait for a Intel Fortran patch fixing this issue .

Somebody knows the right method to ask for a improvment of IFC?

0 Kudos
Steven_L_Intel1
Employee
1,084 Views

No matter what you do, you're not going to have portable code if you rely on things such as DLLIMPORT. If portability is of interest to you, don't use blank common, which has peculiar rules and restrictionson various implementations.

The way to make a feature request is to file an issue with Intel Premier Support and ask for it. These get sent on to the development team which considers such requests in future planning.

This is not a bug to be "fixed" - you're asking for a new feature.

0 Kudos
Reply