1834754 Members
3501 Online
110070 Solutions
New Discussion

Perl and dynamic linking

 
Glenn S. Davidson
Trusted Contributor

Perl and dynamic linking

I have spent the last 2 days researching and building and re-researching and re-building and I still don't have a good answer.

I have HPUX 11i and perl 5.6.1 (B.5.6.1.E because it was in our depot). I have learned about all the caveats regarding the compilers and that the modules have to be compiled with the same compiler and I understand all that stuff. I have compiled the DBI, DBB modules for Oracle and they work but here is where the rubber 'leaves' the road.

In order to get the DBI-DBD modules to work I had to "statically" link them to the executable. I tried everything else (believe me when I say everything). I modified the Makefile several time (re-building each time). I tried all the tricks in all the news groups and forums I could find and read just trying to get this to work the way it is supposed to but I just never could get any satisfactory results until I statically linked them (actually the DBD module - the DBI worked fine until I statically link the DBD).

And then the next problem reared it's ugly head. Once I statically linked the DBI-DBD modules I had to do all the other modules that way also. It seems that no-one could use any of the other modules (except root) until I did the static linking. I checked root's environment over and over. I went back to research and could find nothing. I'm not a programmer so I'm not even sure what I am looking for. I assume (I know, I know) that I'm looking for a permissions problem but I can't tell. I'm getting no other errors than the standard "Can't locate loadable object for module blah, blah, blah..." output from perl and that's it. I've checked @INC and looked in the lib directories but I find nothing that would prevent a "normal" user from using the modules.

So what am I looking for? Why can't the dynamic linking work the way it's supposed to? Why do I have to statically link everything?

After these last two days I'm probably going to be downloading the perl source and creating my own distribution unless someone can come up with a real reason for this or at least a creative solution.

I hope I didn't sound too frustrated. I'm going home for the weekend and I promice not to let this bother me until Monday.

I hope someone out there knows something!

Glenn
Conformity Destroys a mans initiative and independence. It supresses his powerful inner drive to do his own thing.
4 REPLIES 4
Hemanth Gurunath Basrur
Honored Contributor

Re: Perl and dynamic linking

Hello Glenn,

I hope this document helps you in troubleshooting your problem.

http://search.cpan.org/src/TIMB/DBD-Oracle-1.09/README.hpux

Regards,
Hemanth
H.Merijn Brand (procura
Honored Contributor

Re: Perl and dynamic linking

Hermanth, good ref, but it's rather Old :(

That doc has been totally rewritten in the past three month, and will be up to date in the latest release in DBI-1.39 which is already included in my perl-5.8.2 prebuild binary port for 11i available on my site

For site location see attachment

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Glenn S. Davidson
Trusted Contributor

Re: Perl and dynamic linking

That is all nice information and most of it I had already read. I was hoping I would get a more specific answer regarding the HP published build of Perl. The reason I used it was because I wanted to save time but the way it turned out I would have been better off downloading the source and doing it all myself.
I guess a more pointed question would be:
Why publish something like this if it's going to cause more pain to use in a real world environment?

I'm not at all happy with what I had to do to get things to work so I will be rebuilding perl from the source so I can add modules that I need when I need them. I've always said "Experience is what you get when you don't get what you want." Now I've got some good experience.
Conformity Destroys a mans initiative and independence. It supresses his powerful inner drive to do his own thing.
Hemanth Gurunath Basrur
Honored Contributor

Re: Perl and dynamic linking

Hello Glenn,

I found the foll. links about Perl 5.6.1 in HP Websites:

http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?locBasepartNum=wk155en〈=English

http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=PERL

Alternative 1:
From this link http://mail.gnu.org/archive/html/bug-m4/2001-08/msg00007.html
I infer that a symlink libperl.so has to be installed and everything works fine.

Alternative 2:

Perl maintains a record of all module installations. To look at this list, simply type:

perldoc perllocal

That's all you need to do on Unix systems with dynamic linking. Most Unix systems have dynamic linking--if yours doesn't, or if for another reason you have a statically-linked perl, and the module requires compilation, you'll need to build a new Perl binary that includes the module. Again, you'll probably need to be root.

Source: http://www.perlpod.com/5.6.1/perlmodinstall.html

You may want to give it a shot.

Hope this helps.

Regards,
Hemanth