Operating System - HP-UX
1745833 Members
4373 Online
108723 Solutions
New Discussion юеВ

Where is env variable LPATH defined

 
Ken Englander
Regular Advisor

Where is env variable LPATH defined

Where is LPATH set and defined? When HP-UX boots how does LPATH get set up or when a process is created?

Thanks!
8 REPLIES 8
Dennis Handly
Acclaimed Contributor

Re: Where is env variable LPATH defined

This is set by the driver and you shouldn't be using it.
Do you have a reason for asking?
Ken Englander
Regular Advisor

Re: Where is env variable LPATH defined

Hi Dennis - I do not know the particulars, but we use it to link our application code. I'm not sure, but I suspect HP probably help us set it up.

The doc I have found about it does not say that it is unacceptable to use.

What driver sets it?

Thanks
James R. Ferguson
Acclaimed Contributor

Re: Where is env variable LPATH defined

Hi Ken:

If 'LPATH' isn't set the linker uses default paths for library searches otherwise the colon-separated list of paths specified by 'LPATH" is used.

You could set and export LPATH in your profile if you like.

See the manpage for 'ld_ia' or 'ld_pa' for more information.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Where is env variable LPATH defined

>but we use it to link our application code. I suspect HP probably help us set it up.

If you use it, certain driver options won't work.

>does not say that it is unacceptable to use.

If you use it, you're responsible if things don't work. You should use -L instead.

>What driver sets it?

aCC/cc/c89/c99, f90, etc.

>JRF: otherwise the colon-separated list of paths specified by LPATH is used.

Instead, -L should be used for each path.

>You could set and export LPATH in your profile if you like.

Only if you want to upset the drivers. ;-)
LPATH is likely to be specific to each application you build and shouldn't be in your .profile.
Ken Englander
Regular Advisor

Re: Where is env variable LPATH defined

It could be that AIX has an LPATH used for similar purposes as we ported our application from AIX (and OpenVMS). I do not know the history but HP was helping us along the way.

It may be the -L is a better choice but it is too late now to change things - the use of LPATH is well embedded in our process.

I still would like to understand a bit more. Does the driver (compiler?) set up this variable during the boot or is it only set up on the fly when using the compiler.

I think the main reason we use it is to link with Oracle for our application.
Dennis Handly
Acclaimed Contributor

Re: Where is env variable LPATH defined

>Does the driver set up this variable on the fly when using the compiler.

Only when linking. If you link with -v, the driver will print out the value if it sets it.

>I think the main reason we use it is to link with Oracle for our application.

If you are exporting LPATH, then you should know where you are doing it.
Ken Englander
Regular Advisor

Re: Where is env variable LPATH defined

> If you are exporting LPATH, then you should know where you are doing it

It took a little time to find out where we set it up and I confirmed that we do use it to link with Oracle. It is hard to know everything about what our company is doing! :)
Ken Englander
Regular Advisor

Re: Where is env variable LPATH defined

Thanks for the input!