Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26755 Discussions

Naming Module shared data section to exclude sharing unshared data

MWind2
New Contributor I
103 Views

In MSVC there is the

#pragma data_seg("sdata")
//....
#pragma data_seg()
#pragma comment(linker, "/Section:sdata,RWS") 

that lets you only share that data section and only that section in a dll. I was trying the module example in   DLL_Shared_Data with the module data being in ".data" with /section:.data,RWS. In my anticipated code, there would be unshared data in it as well, and I was worried how to keep separate as that private data may be put in ".data".   

0 Kudos
1 Solution
Steve_Lionel
Black Belt Retired Employee
103 Views

I don't think there's a way to do this in Intel Fortran. However, my usual advice for sharing data cross-process in a DLL (that's what the linker directive is for) is to put the data you want shared in its own module and build that module into a DLL. Have other code that wants to use that shared data link to that DLL.

View solution in original post

3 Replies
Steve_Lionel
Black Belt Retired Employee
104 Views

I don't think there's a way to do this in Intel Fortran. However, my usual advice for sharing data cross-process in a DLL (that's what the linker directive is for) is to put the data you want shared in its own module and build that module into a DLL. Have other code that wants to use that shared data link to that DLL.

View solution in original post

MWind2
New Contributor I
103 Views

So if I had to use fortran for such, I would need two dll's one private and  one shared data?

Steve_Lionel
Black Belt Retired Employee
103 Views

Yes, I suppose that is true.

Reply