- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Shareable image
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2004 11:26 PM
тАО10-13-2004 11:26 PM
Shareable image
How to create C++ shareable images on
OpenVMS Alpha.
-Deepak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2004 11:36 PM
тАО10-13-2004 11:36 PM
Re: Shareable image
Check Language USerguide
http://h71000.www7.hp.com/commercial/cplus/alpha_doc/
Compaq C++
Using Compaq C++ for OpenVMS Alpha
http://h71000.www7.hp.com/commercial/cplus/alpha_doc/ugvhdr.html#index_x_299
3.5 Sample Code for Creating OpenVMS Shareable Images
Also check the LINKER reference manual.
If you have SPECIFIC questions/problems, then I'm sure we'll be able to help more.
Regards,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2004 11:37 PM
тАО10-13-2004 11:37 PM
Re: Shareable image
Although I'm not familiar with creating shareable images from modules written in C++, I guess it isn't that much different than for instance from modules written in C.
Please have a look at the OpenVMS Linker Utility Manual, Chapter 4, Creating Shareable Images.
Greetz,
Kris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2004 02:25 AM
тАО10-14-2004 02:25 AM
Re: Shareable image
shareabel images are different from VAX VMS.
On alpha you don't need macro file with shareable entry points. You need declare your entry points and public variables using link; to make this you have to create e .OPT file like follows:
GSMATCH=LEQUAL,1,100
SYMBOL_VECTOR = ( -
ENTRYA = PROCEDURE, -
ENTRYB = PROCEDURE, -
)
PSECT_ATTR=MY_PUBLIC_VAR,NOSHR
PSECT_ATTR=MY_RO_TABLE,SHR,NOWRT
where
ENTRYA, ENTRYB may be your entry points for your C/C++ functions;
MY_PUBLIC may be a public variable, no shareable;
my_RO_TABLE may be a read-only public variable;
HTH
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2004 06:20 AM
тАО10-14-2004 06:20 AM
Re: Shareable image
http://h71000.www7.hp.com/wizard/wiz_3309.html is a good starting point.
Best choice is the first link mentioned: http://www.openvms.digital.com/wizard/swdev/ovms-shexe-cook.html
Willem
OpenVMS Developer & System Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2004 07:19 PM
тАО10-14-2004 07:19 PM
Re: Shareable image
Follow others instructions. If you are not familiar with shareable images on VMS C++ is not the best language to start. When you declare entrypoints, as Antonio suggested, you must look for the "real" procedure names. For this you can use the [.cxx_repository]cxx$demangler_db.; file, which has in the first colon the real name and in the second colon the C++ name of the routine (method).
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2004 07:59 PM
тАО10-14-2004 07:59 PM
Re: Shareable image
Thanks a lot for all the info. But still i am not able to get very clear way how to creat sharable immage.
Example : i have
a.cpp
b.cpp
c.cpp
now i want to create sharable image t.so how should i proced. In all the above links no where they are telling step by step procedure.
-Deepak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2004 08:41 PM
тАО10-14-2004 08:41 PM
Re: Shareable image
Compile all three sources to get the .obj files, then you must create the .opt file where you define which procedures (methods) are global (exported) see Antonios post. To get the names you look to the [.cxx_repository]cxx$demangler_db.; . Maybe copying this file to the .opt file and edit it will be the best solution. When you have the .opt file (say t.opt), link with:
$ CXXLINK/SHAREABLE=t.exe a,b,c,t.opt/OPTIONS
Now you have a T.EXE file, which is a shareable image (like t.so on *NIX).
Now when you want to link this shareable image to another program you have two posibilities:
You can create a new .opt file, where you add a line:
T/SHAREABLE
and use this .opt when linking the programs which use yours T.EXE.
The second posibility is to create a shareable library with:
$ LIBRARY/CREATE/SHARE T.OLB T.EXE
When linking programs you then you link with:
$ LINK program_which_use_t.obj,t.olb/LIBRARY
(or CXXLINK when you are linking C++ programs)
Another posibility is to define a logical name LNK$LIBRARY which points to t.olb (if you have more than one library you start with LNK$LIBRARY then LNK$LIBRARY_1,LNK$LIBRARY_2 and so on logical names). This logical names can be defined in the PROCESS,JOB,GROUP and SYSTEM table. The linker will search all libraryes to resolve symbols. If you define such logical names, there is no need to define anything in the LINK command.
Remeber that shareable images must reside in the SYS$SHARE (or SYS$LIBRARY which is the same) directory or have a logical name which points to the shareable image. The second method is better, because with this you dont mess with system directories. There is an example how to define the logical name for the MYSHAREABLES:T.EXE:
$ DEFINE/table T MYSHAREABLES:T.EXE
the /table qualifier is the table where you want to define the logical. If all users on the system will use this shareable image /SYSTEM will be the right table.
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2004 03:01 AM
тАО10-15-2004 03:01 AM
Re: Shareable image
The responses to this that I've read so far all appear to be factually correct but they don't seem to address the problems that you are going to run into when you try to do this specifically for C++.
By the way, this is also a non-trivial problem on other platforms.
Let me try and enumerate the problems you will run into.
First, you will be dealing with a large number of mangled names. Trying to manage this is not practical, so you will probably want to automate this by parsing the output of a library/list/names command.
Having done that, the next problem you will encounter is that you will have to determine which entry points are data declarations and which are functions (member or otherwise). Data declarations must use a corresponding SYMBOL_VECTOR(name=DATA) statement rather than SYMBOL_VECTOR(name=PROCEDURE). The only way I know to deal with this is to cxxlink and parse the resulting %LINK-W-SYMVABNORMAL messages, fix up the options file and try again.
You might also want to filter out names that you know you don't need to expose. There are some module initiailzation entry points that really should remain hidden. It helps here if the tool you are using provides regular expressions so you can filter these out based on a pattern.
It would also be nice to be able to filter out (e.g.) private class member functions but I don't know an easy way to do this.
You also need to be sure and compile with /extern_model=strict_refdef/noshare because failing to do that will cause some external references to be weak references which will prevent some names from showing up in the list/list/names.
You might want to consider compiling with /names=as_is and then creating an all upper case alias for each of the names. For example:
SYMBOL_VECTOR=(exampleMixedName=PROCEDURE,EXAMPLEMIXEDNAME/exampleMixedName=PROCEDURE)
The last time I needed to do this I wrote a python script.
HTH,
Bruce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2004 04:50 AM
тАО10-15-2004 04:50 AM
Re: Shareable image
>>>
In all the above links no where they are telling step by step procedure.
<<<
Which of the steps in the OpenVMS Shareable cookbook that Willem pointed you to do you have problems with?
To clarify, here's that link again:
http://www.openvms.digital.com/wizard/swdev/ovms-shexe-cook.html
You can also use http://h71000.www7.hp.com/wizard/swdev/ovms-shexe-cook.html if you have problems with URLs pointing to digital.com.
HTH,
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2004 05:58 AM
тАО10-15-2004 05:58 AM
Re: Shareable image
I said:
> The responses to this that I've read so
> far all appear to be factually correct but
> they don't seem to address the problems
> that you are going to run into when you
> try to do this specifically for C++.
Case in point:
> Uh... LINK/SHARE ?
No, that's wrong. You always have to use CXXLINK, not LINK when dealing with C++.
To be fair, though, Hein van den Heuvel was the only one that actually had a C++ specific link:
http://h71000.www7.hp.com/commercial/cplus/alpha_doc/ugvhdr.html#index_x_299
would be a better place to start for a shareable image containing a C++ library.
Martin Vorlaender said:
> To clarify, here's that link again:
> http://www.openvms.digital.com/wizard/swdev/ovms-shexe-cook.html
Sorry, I don't agree that this is the best place to start if you plan to create a shareable image containing C++ code.
Instead, you should start with the C++ specific page that Hein van den Heuvel referenced.
Another example:
> I guess it isn't that much different than
> for instance from modules written in C.
Yes, it is quite different.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2004 06:21 PM
тАО10-17-2004 06:21 PM
Re: Shareable image
>>>
> Uh... LINK/SHARE ?
No, that's wrong. You always have to use CXXLINK, not LINK when dealing with C++.
<<<
It fact, you needn't to. CXXLINK performs two major tasks:
- Searches for and adds template instantiations, if needed
- Adds sys$library:libcxxstd.olb to the linker input
If your application uses template instantiations, you would need to link files from your [.cxx_repository] with the application.
Use CXXLINK/LOG to see which LINK operations CXXLINK performs.
>>>
> To clarify, here's that link again:
> http://www.openvms.digital.com/wizard/swdev/ovms-shexe-cook.html
Sorry, I don't agree that this is the best place to start if you plan to create a shareable image containing C++ code.
<<<
While the SW_SHR example sure is helpful, I still think the cookbook is better to understand what steps are required to build a shareable image in general. The mangled names are just an additional obstacle the C++ has.
cu,
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-17-2004 07:43 PM
тАО10-17-2004 07:43 PM
Re: Shareable image
There is another consideration. If you need only some functions to be visible from other programs and no class methods, you can declare these functions as extern "C". These function names will not be managled and creating a shareable will be slightly simplier. Of course you can use classes in this functions.
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2004 03:15 AM
тАО10-31-2004 03:15 AM
Re: Shareable image
What about http://h18000.www1.hp.com/support/asktima/appl_tools/009EF453-A516039E-1C02A1.html ?
Can't it help you ?
Note this is an inclusive method (i.e.: all external functions are added.) You may have to modify the generated command procedure to replace the link command by cxxlink.
Hoping this can help you.
Regards,
Philippe