Shared, non shared libraries need some information about this subject

Shared, non shared libraries need some information about this subject

Post by Louis Banen » Fri, 19 Jan 2001 07:14:00



Hi,

Platform IBM RS6000, AIX 4.3.3

We are forced by our database vendor to compile our programs with their non
shared libraries (.a) instead of their shared object libraries (.so). This
because the programs did not run anymore with their latest database version
(although they did compile and link). So we compiled our programs with the
non-shared libraries but now we experience serious performance problems due
to increased memory usage. Can anybody tell me something about this subject
or give some suggestions ?

Regards,

Louis Banens

 
 
 

Shared, non shared libraries need some information about this subject

Post by Louis Banen » Fri, 19 Jan 2001 07:35:02


Forgotten,

Below are the new compile and link statements, are these optimal/correct for
AIX ?

gcc -DIDI_BIG_ENDIAN -DNOTIMEOUT_SUPPORTED=IDI_TRUE -DOS_SHMADDR_OK=IDI_TRUE
 -DSTRTOUL_SUPPORTED=IDI_TRUE -DUNIX -DSVR4 -DSVR4S -D_REENTRANT -DSTATVFS_S
UPPORTED -DAIO -O -c db_actions.c -DIDI_SERVER  -I/apps/v83/dm/include

gcc -DIDI_BIG_ENDIAN -DNOTIMEOUT_SUPPORTED=IDI_TRUE -DOS_SHMADDR_OK=IDI_TRUE
 -DSTRTOUL_SUPPORTED=IDI_TRUE -DUNIX -DSVR4 -DSVR4S -D_REENTRANT -DSTATVFS_S
UPPORTED -DAIO -s cgi_functions.o fldvalues.o ddb_arrays.o filltempl.o
opi_err.o db_functions.o ddb_functions.o parse_query.o ./db_actions.o
/apps/v83/dm/obj/opilib/opilib.a /apps/v83/dm/obj/opcslib/opcslib.a
/apps/v83/dm/obj/opilib/opilib.a
/apps/v83/dm/obj/opcslib/opcslib.a -L/apps/v83/dm/lib -ldmlib -L/apps/v83/dm
/lib -lsslib -L/apps/v83/dm/lib -luelib -lnsl  -lpthread -lopilib -lm -o
db_actions29236 -DIDI_SERVER  -I/apps/v83/dm/include

Regards,

Louis Banens

Hi,

Platform IBM RS6000, AIX 4.3.3

We are forced by our database vendor to compile our programs with their non
shared libraries (.a) instead of their shared object libraries (.so). This
because the programs did not run anymore with their latest database version
(although they did compile and link). So we compiled our programs with the
non-shared libraries but now we experience serious performance problems due
to increased memory usage. Can anybody tell me something about this subject
or give some suggestions ?

Regards,

Louis Banens

 
 
 

Shared, non shared libraries need some information about this subject

Post by Dave Bruh » Fri, 19 Jan 2001 11:01:09


Louis,
    The libraries are either compiled into the executable (.a) or are linked
in at execution (.so).
So, when your DB vendor recommended that you use the non-runtime libraries
you increased the size of your executable because it includes the libraries.
You can take several approaches:
    1) increase physical memory or optimize the size of your cache.
    2) Talk to your vendor and find out a) when they will have a fix so that
you can use the run-time libraries. or b) if you have to compile in all the
.a libraries for the specific database functions you are performing.  You
may be able to get by with a subset of the libraries.
Another consideration is that the compiled in libraries are faster even
though they may use more memory.

Consider your options for the best choice in your situation.

DaveB

Quote:> Forgotten,

> Below are the new compile and link statements, are these optimal/correct
for
> AIX ?

gcc -DIDI_BIG_ENDIAN -DNOTIMEOUT_SUPPORTED=IDI_TRUE -DOS_SHMADDR_OK=IDI_TRUE
Quote:>  -DSTRTOUL_SUPPORTED=IDI_TRUE -DUNIX -DSVR4 -DSVR4S -D_REENTRANT -DSTATVFS
_S
> UPPORTED -DAIO -O -c db_actions.c -DIDI_SERVER  -I/apps/v83/dm/include

gcc -DIDI_BIG_ENDIAN -DNOTIMEOUT_SUPPORTED=IDI_TRUE -DOS_SHMADDR_OK=IDI_TRUE
Quote:>  -DSTRTOUL_SUPPORTED=IDI_TRUE -DUNIX -DSVR4 -DSVR4S -D_REENTRANT -DSTATVFS
_S
> UPPORTED -DAIO -s cgi_functions.o fldvalues.o ddb_arrays.o filltempl.o
> opi_err.o db_functions.o ddb_functions.o parse_query.o ./db_actions.o
> /apps/v83/dm/obj/opilib/opilib.a /apps/v83/dm/obj/opcslib/opcslib.a
> /apps/v83/dm/obj/opilib/opilib.a

/apps/v83/dm/obj/opcslib/opcslib.a -L/apps/v83/dm/lib -ldmlib -L/apps/v83/dm
> /lib -lsslib -L/apps/v83/dm/lib -luelib -lnsl  -lpthread -lopilib -lm -o
> db_actions29236 -DIDI_SERVER  -I/apps/v83/dm/include

> Regards,

> Louis Banens


> Hi,

> Platform IBM RS6000, AIX 4.3.3

> We are forced by our database vendor to compile our programs with their
non
> shared libraries (.a) instead of their shared object libraries (.so). This
> because the programs did not run anymore with their latest database
version
> (although they did compile and link). So we compiled our programs with the
> non-shared libraries but now we experience serious performance problems
due
> to increased memory usage. Can anybody tell me something about this
subject
> or give some suggestions ?

> Regards,

> Louis Banens

 
 
 

Shared, non shared libraries need some information about this subject

Post by Ed L Cashi » Fri, 19 Jan 2001 11:22:50



> Forgotten,

> Below are the new compile and link statements, are these optimal/correct for
> AIX ?

> gcc -DIDI_BIG_ENDIAN -DNOTIMEOUT_SUPPORTED=IDI_TRUE -DOS_SHMADDR_OK=IDI_TRUE
>  -DSTRTOUL_SUPPORTED=IDI_TRUE -DUNIX -DSVR4 -DSVR4S -D_REENTRANT -DSTATVFS_S
> UPPORTED -DAIO -O -c db_actions.c -DIDI_SERVER  -I/apps/v83/dm/include

> gcc -DIDI_BIG_ENDIAN -DNOTIMEOUT_SUPPORTED=IDI_TRUE -DOS_SHMADDR_OK=IDI_TRUE
>  -DSTRTOUL_SUPPORTED=IDI_TRUE -DUNIX -DSVR4 -DSVR4S -D_REENTRANT -DSTATVFS_S
> UPPORTED -DAIO -s cgi_functions.o fldvalues.o ddb_arrays.o filltempl.o
> opi_err.o db_functions.o ddb_functions.o parse_query.o ./db_actions.o
> /apps/v83/dm/obj/opilib/opilib.a /apps/v83/dm/obj/opcslib/opcslib.a
> /apps/v83/dm/obj/opilib/opilib.a
> /apps/v83/dm/obj/opcslib/opcslib.a -L/apps/v83/dm/lib -ldmlib -L/apps/v83/dm
> /lib -lsslib -L/apps/v83/dm/lib -luelib -lnsl  -lpthread -lopilib -lm -o
> db_actions29236 -DIDI_SERVER  -I/apps/v83/dm/include

Did you strip the statically linked binaries?  That often reduces the
size quite a bit.  By 60% or so for me on Linux.

--
--Ed Cashin                     integrit file-verification system:

    Note: If you want me to send you email, don't munge your address.

 
 
 

Shared, non shared libraries need some information about this subject

Post by Louis Banen » Fri, 19 Jan 2001 18:32:15


Dave,

Strange thing is that one running process seems to slow down al other
processes. I cannot imagine that it only has to do with memory. Can it also
have something to do how is dealt with threads ?

By the way, the physical size of the executable (with .a) is smaller than
before compilation (.so). Isn't that strange.

Regards,

Louis Banens


Louis,
    The libraries are either compiled into the executable (.a) or are linked
in at execution (.so).
So, when your DB vendor recommended that you use the non-runtime libraries
you increased the size of your executable because it includes the libraries.
You can take several approaches:
    1) increase physical memory or optimize the size of your cache.
    2) Talk to your vendor and find out a) when they will have a fix so that
you can use the run-time libraries. or b) if you have to compile in all the
.a libraries for the specific database functions you are performing.  You
may be able to get by with a subset of the libraries.
Another consideration is that the compiled in libraries are faster even
though they may use more memory.

Consider your options for the best choice in your situation.

DaveB

Quote:> Forgotten,

> Below are the new compile and link statements, are these optimal/correct
for
> AIX ?

gcc -DIDI_BIG_ENDIAN -DNOTIMEOUT_SUPPORTED=IDI_TRUE -DOS_SHMADDR_OK=IDI_TRUE
Quote:>  -DSTRTOUL_SUPPORTED=IDI_TRUE -DUNIX -DSVR4 -DSVR4S -D_REENTRANT -DSTATVFS
_S
> UPPORTED -DAIO -O -c db_actions.c -DIDI_SERVER  -I/apps/v83/dm/include

gcc -DIDI_BIG_ENDIAN -DNOTIMEOUT_SUPPORTED=IDI_TRUE -DOS_SHMADDR_OK=IDI_TRUE
Quote:>  -DSTRTOUL_SUPPORTED=IDI_TRUE -DUNIX -DSVR4 -DSVR4S -D_REENTRANT -DSTATVFS
_S
> UPPORTED -DAIO -s cgi_functions.o fldvalues.o ddb_arrays.o filltempl.o
> opi_err.o db_functions.o ddb_functions.o parse_query.o ./db_actions.o
> /apps/v83/dm/obj/opilib/opilib.a /apps/v83/dm/obj/opcslib/opcslib.a
> /apps/v83/dm/obj/opilib/opilib.a

/apps/v83/dm/obj/opcslib/opcslib.a -L/apps/v83/dm/lib -ldmlib -L/apps/v83/dm
> /lib -lsslib -L/apps/v83/dm/lib -luelib -lnsl  -lpthread -lopilib -lm -o
> db_actions29236 -DIDI_SERVER  -I/apps/v83/dm/include

> Regards,

> Louis Banens


> Hi,

> Platform IBM RS6000, AIX 4.3.3

> We are forced by our database vendor to compile our programs with their
non
> shared libraries (.a) instead of their shared object libraries (.so). This
> because the programs did not run anymore with their latest database
version
> (although they did compile and link). So we compiled our programs with the
> non-shared libraries but now we experience serious performance problems
due
> to increased memory usage. Can anybody tell me something about this
subject
> or give some suggestions ?

> Regards,

> Louis Banens

 
 
 

Shared, non shared libraries need some information about this subject

Post by Jose Pina Coelh » Sat, 20 Jan 2001 04:34:01



> Louis,
>     The libraries are either compiled into the executable (.a) or are linked
> in at execution (.so).
> So, when your DB vendor recommended that you use the non-runtime libraries
> you increased the size of your executable because it includes the libraries.
> You can take several approaches:
>     1) increase physical memory or optimize the size of your cache.
>     2) Talk to your vendor and find out a) when they will have a fix so that
> you can use the run-time libraries. or b) if you have to compile in all the
> .a libraries for the specific database functions you are performing.  You
> may be able to get by with a subset of the libraries.
> Another consideration is that the compiled in libraries are faster even
> though they may use more memory.

If the program is only used one instance at a time, yes.  Else you get better
performance
with shared libraries.
 
 
 

Shared, non shared libraries need some information about this subject

Post by Andrew Giert » Sat, 20 Jan 2001 05:07:44


 [shared vs. static libraries]

 Jose> If the program is only used one instance at a time, yes.  Else
 Jose> you get better performance with shared libraries.

as a general rule this is only true if you have multiple _different_
programs using the same shared libraries.

Multiple copies of the _same executable_ share all their code
regardless of the type of library.

--
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
                           or <URL: http://www.whitefang.com/unix/>

 
 
 

Shared, non shared libraries need some information about this subject

Post by peck.. » Sat, 20 Jan 2001 06:19:57




>Hi,

>Platform IBM RS6000, AIX 4.3.3

>We are forced by our database vendor to compile our programs with their non
>shared libraries (.a) instead of their shared object libraries (.so). This

I don't know what product you're using, but on AIX, an archive can contain
shared objects.  For example, libc.a contains a member, shr.o, which is
a shared object.  It also contains members that are not shared objects, such
as strcmp.o.  If you want to link statically, you use the -bnso linker
flag, and the linker treats shr.o as a static *.o instead of a shared object.

The convention of have a *.a and *.so just doubles the amount of disk
space required with no benefit.

So, are you sure the *.a file is an archive with static members?  Are you
sure that *.so is a shared object (and treated as such by the linker)?

 
 
 

Shared, non shared libraries need some information about this subject

Post by Louis Banen » Sat, 20 Jan 2001 07:03:34





>Hi,

>Platform IBM RS6000, AIX 4.3.3

>We are forced by our database vendor to compile our programs with their non
>shared libraries (.a) instead of their shared object libraries (.so). This

:
:I don't know what product you're using, but on AIX, an archive can contain
:shared objects.  For example, libc.a contains a member, shr.o, which is
:a shared object.  It also contains members that are not shared objects,
such
:as strcmp.o.  If you want to link statically, you use the -bnso linker
:flag, and the linker treats shr.o as a static *.o instead of a shared
object.
:
:The convention of have a *.a and *.so just doubles the amount of disk
:space required with no benefit.
:
:So, are you sure the *.a file is an archive with static members?  Are you
:sure that *.so is a shared object (and treated as such by the linker)?

Good question. I don't know. I used to compile without specifying the .a
libraries but only with -L/libdir and with option -lopilib. I assume
that -lopilib is used here to tell that the .so libraries in libdir should
be linked at runtime or not ?

Regards,

Louis

 
 
 

1. Need a Shared Library Guru: beyond simple shared library question

I need to come up with a shared library whose name and function names are NOT
known at compile/link time - only known at runtime. This requires the
application program to be able to dynamically load a shared library at runtime
whose name is in a variable and request a function whose name is also in
a variable.

It would work like this: At run the application program would make a system
call to dynamically load a library by the name of the string it passed. Once
loaded, the application would, using a "handle" to the library, request a
reference to a function in the library passing the name of the function. In
servicing the request the library would lookup the function name in its table
and return a pointer to the function. The application would call the function
using the pointer.

If you're familiar with Windows (I'm not that familiar with) it would be
equivalent to the "LoadLibrary" and "GetProcAddress" functions in Windows.

I've read through a number of FAQs and group posting and so far haven't come
across anything of this nature.

ANY HELP YOU CAN PROVIDE WOULD BE WELCOME!!!

TIA, Mike

--

5910 N Central Exprwy, Suite 800   phone: (214)891-6638
Dallas, TX 75206-5140              fax:   (214)987-8187

2. Can't cat a file to the printer

3. basic information on shared libraries needed

4. spoof ip address?

5. Will strip(debug shared library) == nodebug shared library ?

6. Can't run executables from xterms opened during login

7. Help with building shared libraries with dependencies on other shared libraries

8. VxFS and Oracle create datafile statement

9. Question: Inclusion of shared libraries during linking of shared libraries

10. Shared library loading shared library.

11. When is a shared library not a shared library?

12. Linking with Shared and Non-shared libs.

13. help sharing shared memory between non sibling processes