Re: [opendx-dev] AIX c++ modules

2003-08-21 Thread David Thompson
So you no longer need to set the -e flag to set the entry point? Does 
the file dxexec.exp work as a -bE file if you change the first line 
to #!. I guess what I'm asking is can you fix dxexec.exp to work for 
both import and export? AIX is the only one that uses the .exp file. 
What does the -G option do?


David


David,

I am sending instructions related to AIX and C++ modules.


BUILDING MODULES


I am building C++ modules, so I figured the options for the xlC
compiler.  I tested these options and they work on POWER-based AIX
5.1.  The command that builds a module is:

xlC -G -qmkshrobj -bI:/path_to_dx/lib/dxexec.imp -o libour_module.so 
list of object files or libraries



The IBM docs say that a C module should be built this way, but I did
not test it:

cc -G -bI:/path_to_dx/lib/dxexec.imp -o libour_module.so list of 
object files or libraries



CHANGES TO OPENDX
-

ATTENTION!  Notice that above is an extra file introduced:
dxexec.imp.  This file is just a modification of the
/path_to_dx/lib/dxexec.exp file: the first line of the file (which is
#!) should be changed to #!..  So it seems that there must be
another file added to OpenDX that is only for AIX.  That's a bummer,
but for now I don't see another solution.

My another instruction is to remove the first few lines at the very
beginning of the dxexec.exp file, because the dxexec.exp doesn't have
to have directives (lines beginning with #!), it should be a file
only with names of exported symbols.  Apparently the directive #!
that is at the beginning of the dxexec.exp file does not hurt, because
OpenDX builds fine.  My guess is that initially the dxhdf5.exp file
was meant as both the import and export file.  Now that apparently (I
am not sure) IBM made changes to their compilers, these files have to
be separate for OpenDX.

You need to apply the patch I sent you to the loader.c file.

The way of building dxexec need not be changed.

Now, the changes mentioned above work on the computer I am using.  I
don't know if they are right for other versions of AIX, because I
don't have access to other AIX computers.

I'll look into other projects that support AIX: Perl, PHP, Apache and
Python to see how they handle AIX.  I want Libtool to work right with
our modules on AIX, so I'll work on this too.  When I get more
information, I will write you another e-mail.

Please let me know if I can be of further assistance.


Irek


On Tue, 19 Aug 2003, David Thompson wrote:


 Actually, if you can just send me the appropriate command line
 options for xlc, that is good enough. I just need to document it in
 the code as well as within the Makefiles produced by the module
 builder. We can wait on the libtool solution longer if need be.

 David



--
.
David L. Thompson   Visualization and Imagery Solutions, Inc.
mailto:[EMAIL PROTECTED]5515 Skyway Drive, Missoula, MT 59804
Phone : (406)756-7472


Re: [opendx-dev] AIX c++ modules

2003-08-21 Thread Ireneusz SZCZESNIAK
On Thu, 21 Aug 2003, David Thompson wrote:

 So you no longer need to set the -e flag to set the entry point?

No.  When you build libraries that will be open with the dlopen
function, the entry point set with the -e flag will not be used.  You
also do not need to set an entry point to DXEntry, because DXEntry in
the loader.c file (in the section with dl functions) is explicitely
called.

On AIX, you had to set the entry point with the -e flag, because the
section of the loader.c file for AIX used the load function.  The
load function called the entry point of the library, which had to be
set to DXEntry.  The result was that using this approach the
DXEntry did not have to be explicitely called.

If your module needs some initialization, you use the
-binitfini:my_entry_function flag to say which function of the library
should be called from within the dlopen function.

 Does the file dxexec.exp work as a -bE file if you change the first
 line to #!.  I guess what I'm asking is can you fix dxexec.exp to
 work for both import and export?

It doesn't work.  I thought of this too.  If I change #! to #!.  in
the lib/dxexec.exp, OpenDX doesn't build.  We really need the import file
to begin with #!..

 What does the -G option do?

This option is equivalent to these flags together: -berok, -brtl,
-bnortllib, -bsymbolic, -bnoautoexp and -bM:SRE.  Of these
flags we only need -berok to ignore the dxexec undefined symbols,
and -bM:SER for reentrant library.

The IBM docs say to use this -G flag.  If you want to build a C++
library, you need to use -qmkshrobj if you are on a POWER-based
computer, and -G -qmkshrobj if you are on an Italium-based compuer
(I did not test the Italium computer, because I don't have access to
one).  I tried -G -qmkshrobj on POWER-based, and it worked, so it's
best to tell that you build C++ libraries on AIX with -G -qmkshrobj.


Best,
Irek