- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am dynamically loading several shared libraries from a main program. Each library contains fortran subroutines. One of the libraries links in a module that contains data that should be shared by all of the other libraries that will be dynamically loaded. The problem is that after I load the libraries, each subroutine seems to be looking at a separate copy of the module data. If I change the value in one subroutine, the value is not reflected in the data when viewed from a subroutine that resides in a separate shared library. This result is also dependent on the order that I load in the libraries.
For compiling, I am using ifortwith the following options:
-shared -extend_source -save -fpic -c
For linking, I am using icc.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Typically the way you would do this is have one .so that contains just the shared storage and all the other libraries link against that, so when any of them is loaded, they pull in the same common shared data. I don't know how you do this in detail on Linux - I have done it on other platforms.
If you don't do it that way, each library thinks it is its own definition of the storage.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page