Entropy.ch Discussion Forums Forum Index Entropy.ch Discussion Forums
Discussion forums about Mac OS X software development.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DBI and DBD::MySQL on Panther
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Entropy.ch Discussion Forums Forum Index -> Perl on Mac OS X
View previous topic :: View next topic  
Author Message
phil



Joined: 06 Dec 2003
Posts: 6
Location: Newcastle Upon Tyne, England

PostPosted: Sat Dec 06, 2003 18:18    Post subject: DBI and DBD::MySQL on Panther Reply with quote

Can anyone point me in the right direction on installing the DBI and DBD modules to link Perl up with MySQL on Panther?

Any advice appreciated.
Back to top
View user's profile Send private message AIM Address
VanGogh



Joined: 12 Dec 2003
Posts: 14
Location: The Netherlands

PostPosted: Fri Dec 12, 2003 23:05    Post subject: DBI and DBD::mysql Reply with quote

There is a link on http://www.entropy.ch/software/macosx/mysql/.

Look at "Additional Information"/"DBI and DBD::mysql" at the bottom of this page.
Miracle:
This link will send you to http://www.heavyhosting.net/AppToolkit/index.html?main=downloads.html.

There you'll find a "MacOS X binary installer for Bundle::DBI and DBD::mysql".

VanGogh
Back to top
View user's profile Send private message Send e-mail
VanGogh



Joined: 12 Dec 2003
Posts: 14
Location: The Netherlands

PostPosted: Sat Dec 13, 2003 0:25    Post subject: DBI and DBD::mysql (2) Reply with quote

I forgot to tell you:

On Panther, Perl will look for modules in a.o.:
/System/Library/Perl/5.8.1/darwin-thread-multi-2level
/System/Library/Perl/5.8.1
/Library/Perl/5.8.1/darwin-thread-multi-2level
/Library/Perl/5.8.1
/Library/Perl
But the modules have been installed in /Library/Perl/darwin/

The solution: install the modules from CPAN and configure them 'by hand'.
But I must admit that I am a newcomer in that wonderful Perl world, so I cannot advise you how to do this before I have tried to do this myself.

VanGogh
Back to top
View user's profile Send private message Send e-mail
phil



Joined: 06 Dec 2003
Posts: 6
Location: Newcastle Upon Tyne, England

PostPosted: Sat Dec 13, 2003 13:48    Post subject: Getting there... Reply with quote

Thanks for the pointers, there does seem to be some problems due to the slight differences of Perl in Panther. Unfortunately I'm also approaching the limit of my knowledge so I'm struggling to 'fix it by hand'. I'd appreciate any further solutions you might find.

Cheers,

Phil
Back to top
View user's profile Send private message AIM Address
Guest






PostPosted: Sun Dec 14, 2003 18:29    Post subject: webmin Reply with quote

I still have some difficulty with CPAN myself, but I am improving. I found it easier to use WebMin to install most of the Perl modules I wanted, including DBI.

http://www.webmin.com/
It's a very cool program. It can administer most aspects of your server, including MySQL databases and Perl modules. You just need to enable web sharing on your Mac in order to use it. You point your web browser at webmin, and under the 'Others' you will find a place to browse for Perl modules. It doesn't make installation automatic though. A module that doesn't install under CPAN probably will have the same problem with webmin; and yet, somehow webmin is easier for me.

Most of the time when a module fails to install, it's because of dependencies. There is a module that needed to be installed first, sometimes more than one. You have to read the error messages carefully to find the reference for the needed package.

The other thing I would suggest is to check your CPAN configuration.
Take a look at ~/.cpan/CPAN/MyConfig.pm
My understanding is that if the 'prerequisites_policy' => q[follow],
then CPAN should try to automatically follow the dependencies and will make installation easier. I set mine by simply deleting my old config file. Then when I re-ran CPAN it prompted me for new settings.

But wait, there's more!
If the module still fails to install, check the ~/.cpan/build directory. You should see the actual directory CPAN is trying to build from: i.e. DBI-1.35.
From inside that directory you can do the "perl Makefile.PL; make; make install" that you often read about. During that manual procedure you may see many other clues, such as a request for the location for some other file.

As an example:
An installation may ask for the location of my wget program.
I usually open another terminal and type 'which wget'. If I don't have the file I open Fink commander and install that before going on. After a rehash I type the location of wget as being /sw/bin/wget.

I hope this is helpful and not too obvious. Most installations aren't difficult when you pay attention to messages about modules or files not found. As I said, I haven't gotten everything to work, but DBI did install for me.
Back to top
keath



Joined: 21 Jun 2003
Posts: 114
Location: Leawood, KS

PostPosted: Sun Dec 14, 2003 21:09    Post subject: an example Reply with quote

A little while ago I installed DBD :: Pg

I tried to install using webmin. (I had previously installed DBI.)
I received an error message saying that there was a problem with /usr/local/pgsql/lib/libpq.a and I would need to rerun ranlib. So I opened a terminal and navigated to /usr/local/pgsql/lib, then typed 'ranlib libpq.a'.

That took care of that problem, but the make test still failed with a lot of undefined symbol errors or something. I figured there was a problem with the include path, so I opened the terminal again and navigated to ~/.cpan/build/DBD-Pg-1.31. The README file explained what environment variables needed to be set. Once I set up the POSTGRES_LIB variable as they specified, the make install worked without any errors.
Back to top
View user's profile Send private message
VanGogh



Joined: 12 Dec 2003
Posts: 14
Location: The Netherlands

PostPosted: Wed Dec 17, 2003 22:03    Post subject: exit; Reply with quote

I talk about the installation of Bundle::DBI on a G5 with MacOS X version 10.3.1 (Panther).

I followed the advices of 'Guest'.
I installed webmin.
Didn't work (Webmin did, but the installation of Bundle::DBI didn't).
I received the same kind of error messages as I received using the 'Perl cpan install module' and the installation from the CPAN site. (see below)

I studied the 'Larry Wall thick book' on the subject 'modules/objects' (as far as my IQ and progress let me of course).
I used the 'use lib' pragma pointing to the directory the Bundle had been installed into.
And:
Hurrah! My BBEdit text editor did not report any errors.
However, the following 'Unix script output' stated:
dyld: perl Undefined symbols:
_PL_DBsub
_PL_curcop
_PL_curpad
_PL_curstackinfo
_PL_dirty
_PL_dowarn
_PL_markstack_max
_PL_markstack_ptr
_PL_na
_PL_op
_PL_stack_base
_PL_stack_max
_PL_stack_sp
_PL_sv_no
_PL_sv_undef
_PL_sv_yes
_PL_tainted
_PL_tainting
_Perl_safemalloc
_perl_call_method
_perl_call_sv
_perl_get_sv

(Has this something to do with 'DynaLoader'???)

But I hopefully tested the script on my local Apache webserver.
Helas: : Error message.

(I got a headache and throwed my G5 panther out of the window (sixth floor).
This is a joke!)

Every kind of installation trial allways ended with something like:
Checking if your kit is complete...
Looks good

Error: Unable to locate installed Perl libraries or Perl source code.

It is recommended that you install perl in a standard location before
building extensions. Some precompiled versions of perl do not contain
these header files, so you cannot build extensions. In such a case,
please build and install your perl from a fresh perl distribution. It
usually solves this kind of problem.

(You get this message, because MakeMaker could not find "/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE/perl.h")
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install
Bundle summary: The following items in bundle Bundle::DBI had installation
problems:
DBI DBI::Shell Net::Daemon RPC::PlServer DBD::Multiplex


And then I realised that:
I did not read more than 250 pages of 'Programming Perl';
I had just boiled some simple eggs from the 'Perl Cookbook';
I thought I could understand the basics of 'Programming the Perl DBI' after having read just a few chapters;

So, I will shut up.
And I will carry on learning and enjoying Perl.
And I will wait for the solution to my problem, which, to my opinion, should come from persons who do speak the Perl language.

exit;
Back to top
View user's profile Send private message Send e-mail
phil



Joined: 06 Dec 2003
Posts: 6
Location: Newcastle Upon Tyne, England

PostPosted: Thu Dec 18, 2003 19:00    Post subject: Reply with quote

Found a useful post on the macosx@perl.org mailing list which may help some people with issues around DBD::mysql on Panther -

http://www.mail-archive.com/macosx@perl.org/msg05736.html
Back to top
View user's profile Send private message AIM Address
keath



Joined: 21 Jun 2003
Posts: 114
Location: Leawood, KS

PostPosted: Sat Dec 20, 2003 15:56    Post subject: Re: VanGogh Reply with quote

Could not find:
/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE/perl.h

That's an interesting error message. The script is specifically looking in that directory for that file. Did you navigate to that directory using the terminal and verify perl.h is actually in there? It doesn't really make sense that it wouldn't be.

Also, please check the Config.pm file that several threads refer to:
Quote:

We recently discovered the DBD::mysql problem as well. The patch is to edit /System/Library/Perl/5.8.1/darwin-thread-multi-2level/Config.pm, replacing:

ld='MACOSX_DEPLOYMENT_TARGET=10.3 cc'

with

ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc'


Unfortunately, this change is too late to get into Panther.
---------------------------------------------------------------
Edward Moy
Apple


Have you set the DYLD_LIBRARY_PATH environment variable? You can check it with printenv at the terminal. Mine is set as:
DYLD_LIBRARY_PATH=/sw/lib:/sw/lib/X11:/usr/lib:/usr/local/lib:/usr/X11R6/lib
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Dec 29, 2003 21:41    Post subject: Reply with quote

Had some holidays.

Re:
Posted 'Sat Dec 20, 2003 16:56'. From 'keath'.
---------------------------------------------------------------

Thanks keath,

I couldn't find a file called perl.h in the directory /System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE/.
I even couldn't find a perl.h at all on my disk.
The only file in CORE is libperl.dylib and nothing else.
---------------------------------------------------------------

I edited the Config.pm file and did the patch on /System/Library/Perl/5.8.1/darwin-thread-multi-2level/Config.pm.

---------------------------------------------------------------

The 'printenv' resulted in:
TERM_PROGRAM=Apple_Terminal
TERM=xterm-color
SHELL=/bin/bash
TERM_PROGRAM_VERSION=100
USER=hvv
__CF_USER_TEXT_ENCODING=0x1F5:0:5
PATH=/bin:/sbin:/usr/bin:/usr/sbin
PWD=/

etc.

So: No DYLD_LIBRARY_PATH environment variable.

Most directories of your 'DYLD_LIBRARY_PATH' don't exist on my computer: I couldn't find /sw/lib[/X11], /usr/local/lib, /usr/X11R6[/lib] directories. I only found: /usr/lib, containing the 'mysql-standard-4.0.17-apple-darwin6.8-powerpc' directory.
---------------------------------------------------------------

I edited the Config.pm file and did the patch on /System/Library/Perl/5.8.1/darwin-thread-multi-2level/Config.pm.
---------------------------------------------------------------


I did that and a lot of thinking.
I sure did.
But I still can't figure out why I can't write a descent Perl script with a 'use DBI;' for my Panther system's Apache webserver.

I think that "something is rotten in the state of Denmark".
And I changed my password into 'Hamlet', to have more fun.

Yours sincerely,
VanGogh
Back to top
keath



Joined: 21 Jun 2003
Posts: 114
Location: Leawood, KS

PostPosted: Thu Jan 01, 2004 4:08    Post subject: Happy New Year Reply with quote

I'm guessing that you did not install the Apple Developer Tools. They are available as a free download, or come on a separate disk with Jaguar and Panther.

Some one had the same problem here:
http://dbforums.com/arch/96/2002/7/437594

The 5.8 Perl included with Panther is in a different place than 5.6 on Jaguar, so maybe you installed Panther but didn't upgrade the developer tools yet.

You mentioned the additional directories in my Library Paths. The /sw directory is a part of Fink. You should consider installing Fink also, as it is a good source of ported Unix software that helps when compiling Perl modules. Binaries and source are available from Fink, and you can also install the Fink Commander, a separate app with a GUI to make searching and installing easier.

As for the DYLD_LIBRARY_PATH, Apple doesn't set it. You need to either just type it in at the command line in Terminal.app before compiling; or better yet, edit your shell configuration script to always set it. I use the tcsh still, and I have a .cshrc file that includes:
Code:

setenv PATH ${PATH}:/usr/local/pgsql/bin
setenv PATH ${PATH}:/Developer/Tools

setenv LD_LIBRARY_PATH /sw/lib:/sw/lib/X11:/usr/lib:/usr/local/lib:/usr/X11R6/lib

setenv DYLD_LIBRARY_PATH ${LD_LIBRARY_PATH}

As you can see, I just created a DYLD_LIBRARY_PATH variable which is a duplicate of my LD_LIBRARY_PATH.

Sometimes I feel that I'm speaking gibberish here. I hope some of this helps.
Back to top
View user's profile Send private message
VanGogh



Joined: 12 Dec 2003
Posts: 14
Location: The Netherlands

PostPosted: Wed Jan 07, 2004 21:48    Post subject: Thanks keath Reply with quote

Re:
Posted: Thu Jan 01, 2004 4:08
by: keath

--------------------------------------------------
"I'm guessing that you did not install the Apple Developer Tools."

Embarassed
Right. I didn't.
(It was not on that Dutch 'Micky Mouse' CD I received with my G5. The only thing on it was a kind of Panther system. CD: N691-4680-A)
I downloaded the Tools from the ADC link. This costed about 2 days. It's a very, very slow download.
Result: Magnificant.
I can even see that important perl.h file in the CORE directory now.

--------------------------------------------------
"Some one had the same problem here"

I red the http://dbforums.com/arch/96/2002/7/437594 link.
It was of great help.

--------------------------------------------------
"The /sw directory is a part of Fink."

I will consider a Fink installation. But, to be honest, I don't like to make things easy for me in this stage of learning perl.
My goal is to understand what happens at a basic (low) level.
(I hope you'll understand what I mean, because I am a Dutchman who is trying to master the English/American language and the Perl language as well.)

--------------------------------------------------

And there are many more advices you gave me.
Thanks very much.
And, please, never ever feel that you are talking gibberish.
Because YOU HELPED ME A LOT.
You made me think how I - just a beginner in the Perl World - should think.

--------------------------------------------------

To be honest:
I met some new problems with perl scripts.
But, from now on, I know that I should first take a good look at manpages, perl sites, the cpan site, README and INSTALL docs, error messages, diccussion boards, etc, etc.
It's fun!

Thanks.

VanGogh
Back to top
View user's profile Send private message Send e-mail
keath



Joined: 21 Jun 2003
Posts: 114
Location: Leawood, KS

PostPosted: Fri Jan 09, 2004 4:20    Post subject: Thanks also! Reply with quote

Thanks for your feedback. I'm really glad I could help.

Your English is excellent by the way. I would never have guessed it was not your native language from your posts.

I'm a long time Mac user but also new to Perl. I'm learning a lot and having a great time. You're right, it is fun!
Back to top
View user's profile Send private message
Matt



Joined: 25 Mar 2004
Posts: 12

PostPosted: Thu Mar 25, 2004 6:08    Post subject: install DBD::mysql problems: dyld undefined symbols Reply with quote

I hope someone here can help, I have read every article on this on every newsgroup and every mailing list. I have made all the suggested edits but I simply cannot install DBD::mysql so that it works.

I keep getting this error:

Checking if your kit is complete...
Looks good
dyld: /usr/bin/perl Undefined symbols:
_PL_DBsub
_PL_curcop
_PL_curpad
_PL_curstackinfo
_PL_dirty
_PL_dowarn
_PL_markstack_max
_PL_markstack_ptr
_PL_na
_PL_op
_PL_stack_base
_PL_stack_max
_PL_stack_sp
_PL_sv_no
_PL_sv_undef
_PL_sv_yes
_PL_tainted
_PL_tainting
_Perl_safemalloc
_perl_call_method
_perl_call_sv
_perl_get_sv
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install

As a complete beginner I have no idea what dyld means, or what to edit to fix it. All I know is that scripts that used to run on Jaguar now don't run on Panther. I've been tearing my hair out trying to get an answer to this and I would love it if someone could tell me what I am missing and how to fix it.

I have Apple developer tools for Panther, I have edited the config.pm file as suggested elsewhere, I have tried using the Bundle-DBI.dmg installer, and I am stumped.

Cheers,
Matt
Back to top
View user's profile Send private message
keath



Joined: 21 Jun 2003
Posts: 114
Location: Leawood, KS

PostPosted: Fri Mar 26, 2004 20:21    Post subject: Jaguar/Panther Reply with quote

dyld is a dynamically loaded library I believe.

The error messages suggest that needed include files were not found. Were there any additional error messages that might suggest what is going wrong?

Also, try re-installing DBI from CPAN, rather than using the Bundle.dmg. Some things need to be built against your version of Perl. There was a change from 5.6 to 5.8 when moving from Jaguar to Panther, and you may have to re-install some things. Also, you may get additional error messages which could make it easier to track down.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Entropy.ch Discussion Forums Forum Index -> Perl on Mac OS X All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group