10-15-2014
Embedding Runtime Search Path into Library on AIX
My product has 2 libraries say "x & y".
x depends on y.
During the installation of my products package, user will be prompted for his own location to copy my product libraries.
Installation will copy libraries "x & y" and create my product specific ENV variable say "MYPATH" pointing to User picked install location.
Here User doesn't want to set LIBPATH nor he want to create any softlinks in "/usr/lib or /lib".
Now I should make my library "x" find its dependent "y" in the environment where there is no LIBPATH set nor softlinks created in "/usr/lib or /lib".
On other UNIX platforms, there is a concept of $ORIGIN and i am successful using this on other Unix platforms.
Since there is no concept of $ORIGIN on AIX, trying out alternatives on AIX
My Scenario:
************
My package install creates ENV variable “MYPATH” pointing to the User picked installed location.
Let say, User selected /home/lib and install will set "MYPATH=/home/lib"
Now I thought of accessing this variable in the runtime search path (Either specifying using -L or –blibpath) while building my libraries (x & y).
For a particular library, runtime search path(dump -X32 -H) should be like
INDEX PATH
0 $MYPATH
I’ve tried specifying $MYPATH in the makefile using “-L or –blibpath” but as MYPATH is not available during build time, NULL value got replaced.
INDEX PATH
0
I want $MYPATH to be considered as is so that at runtime it gets replaced with its value.
Tried Escaping $ and also used quotes but no use.
ex: $$\(MYPATH\)
Can this be possible? If possible, then how?
-Srikrishna Erra.
Last edited by erra_krishna; 10-15-2014 at 04:35 PM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How do you get an application to use an alternate library?
Dave:confused: (2 Replies)
Discussion started by: nucca
2 Replies
2. Linux
Hi,
I am working with red hat Linux and i want to install one program but I am getting the error
This product requires the GNU C++ Runtime Library (libstdc++-libc6.2-2.so.3)
or later. Your system must be upgraded before installation can proceed.
So please tell me how can i remove this... (2 Replies)
Discussion started by: smartgupta
2 Replies
3. Solaris
Hi guys,
I have commands like
/solaris/opt/VRTS/bin/vxdisk
/opt/VRTS/bin/vxdisk
From these two commands, i need to get the directory path value before /VRTS/bin/vxdisk at runtime.
e.g
/solaris/opt/VRTS/bin/vxdisk as /solaris/opt
/opt/VRTS/bin/vxdisk as /opt
I have tried with cut... (1 Reply)
Discussion started by: Nandagopal
1 Replies
4. Solaris
Thank u vgesh99
It works well.. (1 Reply)
Discussion started by: Nandagopal
1 Replies
5. AIX
Hi ,
I need some inputs on runtime or shared libs for an application(s) in AIX .
i have a requirement saying i need to rehost all the production applications into new AIX OS .
Here Source and target oS is AIX but with different versions
so for this i need to identify what are the... (1 Reply)
Discussion started by: naren_chella
1 Replies
6. Programming
My executable was linked under RedHat using the LessTif GUI shared library. When I try to run it under UBUNTU, I get an error message that the LessTif library cannot be found. The LessTif library is there, but it is a newer VERSION. My executable is looking for the older version it was linked with.... (1 Reply)
Discussion started by: imagtek
1 Replies
7. AIX
Hi Experts,
How to Check the what runtime package is applied on AIX OS?
I would like to verify if “xlcpp.rte.10.1.0.aix.base” package is applied or not ?
thanks in advance.
-Mallela (1 Reply)
Discussion started by: meetmallela
1 Replies
8. Programming
Hello,
How to set up the path for downloaded C/C++ libraries (or, header files) so that they can be included like system headers (stdio.h or iostream)? The libraries/headers are from a package containing different folders each has different sets of headers and put in... (1 Reply)
Discussion started by: yifangt
1 Replies
9. UNIX for Advanced & Expert Users
I hope my title is accurate enough.
I have a product that we port to various UNIX platforms. It is known to run on AIX but using the IBM compiler from years ago. Recently we got a different used AIX P5 platform running AIX 5.3 and we setup the GCC compiler (4.4.5 I think). C and C++ source code.... (5 Replies)
Discussion started by: Pug
5 Replies
10. AIX
Can somebody help me too identify full path to socket library on AIX? Cannot find anything
Thanks
for contribution (2 Replies)
Discussion started by: digioleg54
2 Replies
LEARN ABOUT DEBIAN
rheolef-config
rheolef-config(1rheolef) rheolef-6.1 rheolef-config(1rheolef)
NAME
rheolef-config -- get installation directories
EXAMPLE
The following command returns the rheolef libraries directory:
rheolef-config --libdir
An environment sanity check writes:
rheolef-config --check
DESCRIPTION
This command is usefull when linking executables with rheolef: libraries locations are required by the link editor. Such directories are
defined while configuring rheolef, before to compile and install see . Installing}'. The rheolef-config command returns these settings.
Note that rheolef-config could be used in Makefiles for the determination of linker flags.
Another usefull feature is the --check option. When rheolef is installed in a user directory, i.e. not as root, the sane run-time environ-
ment depends upon two environment variables. The first one is the PATH: bkindir directory may be present in PATH. The second environment
variable is related to shared libraries, and its name is system-dependent, e.g. LD_LIBRARY_PATH on most platforms and SHLIB_PATH on HP-UX.
Its content may contains bindir.
rheolef-config --shlibpath-var
Since it is a common mistake to have incorrect values for these variable, for novice users or for adanced ones, especialy when dealing with
several installed versions, the environment sanity check writes:
rheolef-config --check
If there is mistakes, a hint is suggested to fix it and the return status is 1. Instead, the return status is 0.
FILE OPTIONS
--version
rheolef version.
--help print option summary and exit.
--prefix
install architecture-independent files location.
--exec-prefix
architecture-dependent files location.
--includedir
include header directory.
--bindir
executables directory.
--mandir
man documentation directory.
--libdir
object code libraries directory.
--datadir
--datarootdir
read-only architecture-independent data location.
--pkgdatadir
read-only architecture-independent data location; specific for package.
--includes
include compiler flags.
--libs library compiler flags.
--shlibpath-var
the shared library path variable.
--library-interface-version
the library interface version.
--hardcode-libdir-flag-spec
flag to hardcode a libdir into a binary during linking.
--is-distributed
true or false: whether it is the distributed version.
--have-old-code
--have-new-code
true or false: whether it is the new/old code branch that is installed.
rheolef-6.1 rheolef-6.1 rheolef-config(1rheolef)