User Name
Password
AppleNova Forums » Genius Bar »

Help getting Perl DBI and DBD to install on G5 10.3.4


Register Members List Calendar Search FAQ Posting Guidelines
Help getting Perl DBI and DBD to install on G5 10.3.4
Thread Tools
kretara
Cynical Old Bastard
 
Join Date: May 2004
Location: The Hot, Hazey, Humid South
Send a message via AIM to kretara Send a message via Yahoo to kretara  
2004-07-12, 09:16

I wonder why Apple can't let CPAN work correctly on their OS.

I have a dual 2ghz G5 running 10.3.4.
I am trying to install Perls DBI and DBD modules.
I am unable to get DBI to install at all (source or DBI). Questions at the bottom.
My PB 1.33 12" is also giving my fits about installing DBI.
My PB Ti500 has no issues with it at all (other than the usual hoops that Apple makes you jump through).

CPAN won't install them (no big new here).

I do have the developer tools installed.

I can get DBI and DBD to install on my Ti500 running 10.3.4 with a few "tricks".

Here is what I have done so far: (maybe these steps will help someone in the future)
0. verified that the developer tools are installed
1. in "/System -> Library -> Perl -> 5.8.1 -> darwin-thread-multi-2level -> Config.pm"
replace
ld='MACOSX_DEPLOYMENT_TARGET=10.3 cc'

with

ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc'




macoshints.com

2. I have tried installing DBI via CPAN and source on the G5 -- no luck on either. I was able to install DBI via CPAN on the Ti500.
sudo perl -MCPAN -e shell
invokes the CPAN shell
install DBI
will install DBI

3. I was only able to do this for my Ti500, NOT the G5
download the source of the DBD-mysql module: CPAN--DBD-MYSQL
unzip and untar the module.
cd into the module and run this from the command line:
perl Makefile.PL --cflags=-I'/usr/local/mysql/include' \
--libs=-L"/usr/local/mysql/lib -lmysqlclient -lz -lm"

This should install DBD::mysql


So, has anyone been able to install either DBI or DBD on 10.3.4 (non-server version) on a G5?

I'm pulling out my hair. I've Googled to hell and gone and am not much closer to the solution.

Here is the last part of the install "logs" of the DBI install via CPAN:

Running Mkbootstrap for DBI ()
chmod 644 DBI.bs
rm -f blib/arch/auto/DBI/DBI.bundle
LD_RUN_PATH="" env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_lookup -L/usr/local/lib DBI.o -o blib/arch/auto/DBI/DBI.bundle
ld: warning -L: directory name (/usr/local/lib) does not exist
ld: can't locate file for: -lbundle1.o
make: *** [blib/arch/auto/DBI/DBI.bundle] Error 1
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible

Any help would be well received.

david
  quote
torifile
Less than Stellar Member
 
Join Date: May 2004
Location: Durham, NC
Send a message via AIM to torifile  
2004-07-12, 19:41

I've gotten it to work on my G5. I can't remember how I did it but lemme try to find it.

Here is what I found:

Quote:
pache


Still in terminal, we need to edit our Apache config file. We are basically going to allow for cgi scripts to be executed on the Mac. By default CGI Scripts are located in /Library/WebServer/CGI-Executables/. We need to uncomment the line in the httpd.conf file that reads # AddHandler cgi-script .cgi. I am going to explain how to do it using the vi text editor, but you are more than welcome to use your favorite editor of choice.




sudo vi /etc/httpd/httpd.conf

Go down to the line we want to edit

Remove the # AddHandler by pressing the x key.

:wq

sudo apachectl graceful



The last command simply restarts the apache server without having to restart your system. Oh, the power of Unix.


Perl Modules


Before we can install the DBI and DBD modules, we need to edit a Perl configuration file deep inside OS X to allow the modules to compile. The bug was discovered after OS X was sent to manufacturing, so the only way to repair it at the moment is in the command line.


sudo vi /System/Library/Perl/5.8.1/darwin-thread-multi-2level/Config.pm

Change ld='MACOSX_DEVELOPMENT_TARGET=10.3 cc' to ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc'



Now that we have fixed one of the few shortcomings of Panther, we can get back to work.


Remember that we downloaded the DBI and DBD files earlier. I had them unzipped to my desktop, but you can easily alter these commands to match the location you saved the files.


cd ~/Desktop/

pushd DBI-1.30

perl Makefile.PL

make

make test

sudo make install

popd



pushd pushes a directory name onto the directory stack. popd removes the element from the stack. Other than that, it is just simply compiling the DBI module and installing it onto the system. Simple stuff.


pushd DBD-mysql-2.1028

perl Makefile.PL

perl -pi -e's/MACOSX/env MACOSX/' Makefile

make

make test

sudo make install

popd



Now that we have our perl modules setup, we can celebrate. We are over halfway to our goal!
The directions said to make a change to the perl config file, but I didn't need to do that. HTH.
  quote
kretara
Cynical Old Bastard
 
Join Date: May 2004
Location: The Hot, Hazey, Humid South
Send a message via AIM to kretara Send a message via Yahoo to kretara  
2004-07-13, 10:34

Yup, have already done that, DBI still will not install.
It fails while looking for /usr/local/lib.
All my windows buddies are laughing at how difficult this installing something as simple as the DBI module is on OS X.
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-07-13, 19:59

Quote:
Originally Posted by kretara
Yup, have already done that, DBI still will not install.
It fails while looking for /usr/local/lib.
All my windows buddies are laughing at how difficult this installing something as simple as the DBI module is on OS X.
ok, we have two options. you don't seem to have been introduced to the wonders of FINK. their web page doesn't seem to be working for me right now, but it might be an issue on my computer. the idea behind fink is to make compilation and installation of traditionally unixy things easy and straight forward on macosx (darwin too). i'm about 80% sure that fink has the dbi and dbd packages. if their site was working for me, i'd be able to confirm that. they have a package search dealie on their site. i'm also not on a mac right now, so i can't do a search using their command line system. after you install fink, you can run the following commands to search for those packages:
apt-cache search dbd
apt-cache search dbi

installing a package with the fink system is identical to using the Debian GNU/Linux "Apt" system. It's like this:
sudo apt-get install packagename

replacing packagename accordingly. The dbi and dbd packages are probably named "perl-dbi" or similarly (again, assuming that fink has them). The exact name would be available on their online search or from the above apt-cache commands.

If you can get fink, that would be the preferably route. But, if that doesn't work, we have the alternate:
What exactly was the error you got, from what command, and from which tarball. I might be able to track down the problem if you give me a little more detail. You mentioned a failure relating to /usr/local/lib. Does that folder exist (ls /usr/local/lib >/dev/null && echo "confirmed !!!")? Is it just looking for the folder, or a particular library within that folder?
  quote
torifile
Less than Stellar Member
 
Join Date: May 2004
Location: Durham, NC
Send a message via AIM to torifile  
2004-07-13, 20:44

Those directions didn't work for you? That's weird. They worked fine for me.

To add to what teh freek said, you can just use fink commander and bypass all that apt-get nonsense
  quote
kretara
Cynical Old Bastard
 
Join Date: May 2004
Location: The Hot, Hazey, Humid South
Send a message via AIM to kretara Send a message via Yahoo to kretara  
2004-07-14, 13:11

I did the fink and finkcommander thing. It worked fine.

Of course, I am still wondering why I could not complie the DBI module via CPAN or source. I have not had any issues with other *nix distributions that I have used with the exception of Solaris.
Is Apple going the way of Sun? Forcing you to complie your own programs with gcc just to make them work on your system? Or, is this another screw up on Apples *nix section? Or, did I do something wrong?
Very frustrating. I have filed a bug report with Apple.
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-07-14, 14:22

Quote:
Originally Posted by kretara
I did the fink and finkcommander thing. It worked fine.

Of course, I am still wondering why I could not complie the DBI module via CPAN or source. I have not had any issues with other *nix distributions that I have used with the exception of Solaris.
Is Apple going the way of Sun? Forcing you to complie your own programs with gcc just to make them work on your system? Or, is this another screw up on Apples *nix section? Or, did I do something wrong?
Very frustrating. I have filed a bug report with Apple.
i hadn't noticed before that you had printed the error log. looking over it, the error was it couldn't find a file named "bundle1.o". that's curious. i suspect its a file that gets linked in when you create a "bundle" (which the last cc line was trying to do). if you are still interested in the source route, you can try doing this:
sudo /usr/libexec/locate.updatedb
locate bundle1.o

the first line will take a while to run, but will create a database of all the files on your hard drive. the second line searches through that database and tells you the full location of any file which has that name. i suspect that the file is either missing (possibly due to a botched or incomplete dev tools install), or out of place. if its out of place, we can copy it over to one of the standard search locations, and the source install would work from there (assuming no further errors ).
  quote
kretara
Cynical Old Bastard
 
Join Date: May 2004
Location: The Hot, Hazey, Humid South
Send a message via AIM to kretara Send a message via Yahoo to kretara  
2004-07-14, 14:48

Neither my G5 or PB 1.33 can find bundle1.o

Both had the developer tools installed the day they came out of the box.
I just reinstalled developer tools on the G5 and I still can't find bundle1.o

I do not have my Ti500 with me right now so I can't check it.
  quote
kretara
Cynical Old Bastard
 
Join Date: May 2004
Location: The Hot, Hazey, Humid South
Send a message via AIM to kretara Send a message via Yahoo to kretara  
2004-07-14, 15:04

I just went back to the xcode cd and manually "upgraded" the following packages:
BSKSDK.pkg
DevSKD.pkg
DeveloperTools.pkg

bundle1.o is still missing.
I also did sudo find / -name bundle1 -print
still no luck
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-07-14, 15:42

Quote:
Originally Posted by kretara
I just went back to the xcode cd and manually "upgraded" the following packages:
BSKSDK.pkg
DevSKD.pkg
DeveloperTools.pkg

bundle1.o is still missing.
I also did sudo find / -name bundle1 -print
still no luck
hmm. the only other place i can think it might be is in the dbi sources. were there any other error lines in the log besides the "can't locate file for: -lbundle1.o" and the warning about /usr/local/lib (by the way, you should be able to get rid of that warning with the following command: `sudo mkdir -p /usr/local/lib`, then re-running the cpan install).
  quote
kretara
Cynical Old Bastard
 
Join Date: May 2004
Location: The Hot, Hazey, Humid South
Send a message via AIM to kretara Send a message via Yahoo to kretara  
2004-07-14, 15:56

I thought about making /usr/local/lib but didn't want to mess up any links that might be hiding somewhere.
I made the directory and reran cpan.

Here is the output, sorry for the massive size:

DBI-1.43/
DBI-1.43/t/
DBI-1.43/t/06attrs.t
DBI-1.43/t/80proxy.t
DBI-1.43/t/41prof_dump.t
DBI-1.43/t/09trace.t
DBI-1.43/t/30subclass.t
DBI-1.43/t/pod.t
DBI-1.43/t/03handle.t
DBI-1.43/t/60preparse.t
DBI-1.43/t/20meta.t
DBI-1.43/t/40profile.t
DBI-1.43/t/42prof_data.t
DBI-1.43/t/15array.t
DBI-1.43/t/10examp.t
DBI-1.43/t/08keeperr.t
DBI-1.43/t/04mods.t
DBI-1.43/t/02dbidrv.t
DBI-1.43/t/50dbm.t
DBI-1.43/t/01basics.t
DBI-1.43/t/05thrclone.t
DBI-1.43/t/07kids.t
DBI-1.43/dbiprof.PL
DBI-1.43/DBI.xs
DBI-1.43/Driver_xst.h
DBI-1.43/lib/
DBI-1.43/lib/DBD/
DBI-1.43/lib/DBD/Proxy.pm
DBI-1.43/lib/DBD/DBM.pm
DBI-1.43/lib/DBD/File.pm
DBI-1.43/lib/DBD/NullP.pm
DBI-1.43/lib/DBD/Sponge.pm
DBI-1.43/lib/DBD/ExampleP.pm
DBI-1.43/lib/DBI/
DBI-1.43/lib/DBI/Const/
DBI-1.43/lib/DBI/Const/GetInfoType.pm
DBI-1.43/lib/DBI/Const/GetInfo/
DBI-1.43/lib/DBI/Const/GetInfo/ODBC.pm
DBI-1.43/lib/DBI/Const/GetInfo/ANSI.pm
DBI-1.43/lib/DBI/Const/GetInfoReturn.pm
DBI-1.43/lib/DBI/DBD/
DBI-1.43/lib/DBI/DBD/Metadata.pm
DBI-1.43/lib/DBI/ProfileDumper/
DBI-1.43/lib/DBI/ProfileDumper/Apache.pm
DBI-1.43/lib/DBI/FAQ.pm
DBI-1.43/lib/DBI/SQL/
DBI-1.43/lib/DBI/SQL/Nano.pm
DBI-1.43/lib/DBI/W32ODBC.pm
DBI-1.43/lib/DBI/Profile.pm
DBI-1.43/lib/DBI/ProfileDumper.pm
DBI-1.43/lib/DBI/ProxyServer.pm
DBI-1.43/lib/DBI/DBD.pm
DBI-1.43/lib/DBI/PurePerl.pm
DBI-1.43/lib/DBI/ProfileData.pm
DBI-1.43/lib/Bundle/
DBI-1.43/lib/Bundle/DBI.pm
DBI-1.43/lib/Win32/
DBI-1.43/lib/Win32/DBIODBC.pm
DBI-1.43/Changes
DBI-1.43/DBIXS.h
DBI-1.43/MANIFEST
DBI-1.43/typemap
DBI-1.43/dbiproxy.PL
DBI-1.43/Perl.xs
DBI-1.43/META.yml
DBI-1.43/Driver.xst
DBI-1.43/dbi_sql.h
DBI-1.43/dbd_xsh.h
DBI-1.43/dbivport.h
DBI-1.43/DBI.pm
DBI-1.43/ToDo
DBI-1.43/test.pl
DBI-1.43/dbipport.h
DBI-1.43/README
DBI-1.43/Makefile.PL
Removing previously used /Users/dmgill/.cpan/build/DBI-1.43

CPAN.pm: Going to build T/TI/TIMB/DBI-1.43.tar.gz


*** You are using a perl configured with threading enabled.
*** You should be aware that using multiple threads is
*** not recommended for production environments.

*** Note:
The optional PlRPC-modules (RPC::PlServer etc) are not installed.
If you want to use the DBD::Proxy driver and DBI::ProxyServer
modules, then you'll need to install the RPC::PlServer, RPC::PlClient,
Storable and Net:aemon modules. The CPAN Bundle:BI may help you.
You can install them any time after installing the DBI.
You do *not* need these modules for typical DBI usage.

Optional modules are available from any CPAN mirror, in particular
http://search.cpan.org/
http://www.perl.com/CPAN/modules/by-module
http://www.perl.org/CPAN/modules/by-module
ftp://ftp.funet.fi/pub/languages/per...ules/by-module

Creating DBI::PurePerl test variant: t/zvpp_01basics.t
Creating DBI::PurePerl test variant: t/zvpp_02dbidrv.t
Creating DBI::PurePerl test variant: t/zvpp_03handle.t
Creating DBI::PurePerl test variant: t/zvpp_04mods.t
Creating DBI::PurePerl test variant: t/zvpp_05thrclone.t (use threads)
Creating DBI::PurePerl test variant: t/zvpp_06attrs.t
Creating DBI::PurePerl test variant: t/zvpp_07kids.t
Creating DBI::PurePerl test variant: t/zvpp_08keeperr.t
Creating DBI::PurePerl test variant: t/zvpp_09trace.t
Creating DBI::PurePerl test variant: t/zvpp_10examp.t
Creating DBI::PurePerl test variant: t/zvpp_15array.t
Creating DBI::PurePerl test variant: t/zvpp_20meta.t
Creating DBI::PurePerl test variant: t/zvpp_30subclass.t
Creating DBI::PurePerl test variant: t/zvpp_40profile.t
Creating DBI::PurePerl test variant: t/zvpp_41prof_dump.t
Creating DBI::PurePerl test variant: t/zvpp_42prof_data.t
Creating DBI::PurePerl test variant: t/zvpp_50dbm.t
Creating DBI::PurePerl test variant: t/zvpp_60preparse.t
Creating DBI::PurePerl test variant: t/zvpp_80proxy.t
Checking if your kit is complete...
Looks good

I see you're using perl 5.008001 on darwin-thread-multi-2level, okay.
Remember to actually *read* the README file!
Use 'make' to build the software (dmake or nmake on Windows).
Then 'make test' to execute self tests.
Then 'make install' to install the DBI and then delete this working
directory before unpacking and building any DBD::* drivers.

Writing Makefile for DBI
cp Changes blib/lib/DBI/Changes.pm
cp lib/DBI/ProfileDumper/Apache.pm blib/lib/DBI/ProfileDumper/Apache.pm
cp lib/DBD/Proxy.pm blib/lib/DBD/Proxy.pm
cp lib/DBD/NullP.pm blib/lib/DBD/NullP.pm
cp lib/DBI/Const/GetInfo/ANSI.pm blib/lib/DBI/Const/GetInfo/ANSI.pm
cp lib/DBI/DBD/Metadata.pm blib/lib/DBI/DBD/Metadata.pm
cp dbd_xsh.h blib/arch/auto/DBI/dbd_xsh.h
cp lib/DBD/File.pm blib/lib/DBD/File.pm
cp lib/DBD/Sponge.pm blib/lib/DBD/Sponge.pm
cp lib/DBI/Profile.pm blib/lib/DBI/Profile.pm
cp dbi_sql.h blib/arch/auto/DBI/dbi_sql.h
cp lib/DBI/ProfileData.pm blib/lib/DBI/ProfileData.pm
cp lib/DBI/ProxyServer.pm blib/lib/DBI/ProxyServer.pm
cp lib/DBI/DBD.pm blib/lib/DBI/DBD.pm
cp Driver.xst blib/arch/auto/DBI/Driver.xst
cp lib/DBI/Const/GetInfoReturn.pm blib/lib/DBI/Const/GetInfoReturn.pm
cp lib/DBD/ExampleP.pm blib/lib/DBD/ExampleP.pm
cp lib/DBI/FAQ.pm blib/lib/DBI/FAQ.pm
cp Driver_xst.h blib/arch/auto/DBI/Driver_xst.h
cp lib/DBD/DBM.pm blib/lib/DBD/DBM.pm
cp lib/DBI/PurePerl.pm blib/lib/DBI/PurePerl.pm
cp lib/DBI/ProfileDumper.pm blib/lib/DBI/ProfileDumper.pm
cp dbivport.h blib/arch/auto/DBI/dbivport.h
cp lib/DBI/SQL/Nano.pm blib/lib/DBI/SQL/Nano.pm
cp dbipport.h blib/arch/auto/DBI/dbipport.h
cp lib/Bundle/DBI.pm blib/lib/Bundle/DBI.pm
cp DBI.pm blib/lib/DBI.pm
cp lib/DBI/Const/GetInfoType.pm blib/lib/DBI/Const/GetInfoType.pm
cp DBIXS.h blib/arch/auto/DBI/DBIXS.h
cp lib/Win32/DBIODBC.pm blib/lib/Win32/DBIODBC.pm
cp lib/DBI/W32ODBC.pm blib/lib/DBI/W32ODBC.pm
cp lib/DBI/Const/GetInfo/ODBC.pm blib/lib/DBI/Const/GetInfo/ODBC.pm
/usr/bin/perl -p -e "s/~DRIVER~/Perl/g" ./Driver.xst > Perl.xsi
/usr/bin/perl /System/Library/Perl/5.8.1/ExtUtils/xsubpp -typemap /System/Library/Perl/5.8.1/ExtUtils/typemap -typemap typemap Perl.xs > Perl.xsc && mv Perl.xsc Perl.c
cc -c -g -pipe -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"1.43\" -DXS_VERSION=\"1.43\" "-I/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE" -Wall -Wno-comment Perl.c
/usr/bin/perl /System/Library/Perl/5.8.1/ExtUtils/xsubpp -typemap /System/Library/Perl/5.8.1/ExtUtils/typemap -typemap typemap DBI.xs > DBI.xsc && mv DBI.xsc DBI.c
cc -c -g -pipe -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"1.43\" -DXS_VERSION=\"1.43\" "-I/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE" -Wall -Wno-comment DBI.c
Running Mkbootstrap for DBI ()
chmod 644 DBI.bs
rm -f blib/arch/auto/DBI/DBI.bundle
LD_RUN_PATH="" env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_lookup -L/usr/local/lib DBI.o -o blib/arch/auto/DBI/DBI.bundle
ld: can't locate file for: -lbundle1.o
make: *** [blib/arch/auto/DBI/DBI.bundle] Error 1
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-07-14, 16:43

i did some poking around on google, and i may have found a solution. 't does seem to be apple's fault (the dirty wankers ). try this command:
ls /Developer/SDKs/MacOSX10.3.0.sdk/usr/lib/bundle1.o >/dev/null && echo "we have found the file"

if it prints back "we have found the file", then the solution is:
sudo ln -s /Developer/SDKs/MacOSX10.3.0.sdk/usr/lib/bundle1.o /usr/lib

That will create a symbolic link between where apple has installed that file and where they were supposed to install the file. presumably the MACOS_DEPLOYMENT_TARGET environment variable was supposed to address that, but alas it hasn't. you might try pushing that into the environment before running cpan, but if the above `ln -s` command works you dont have to bother. what version of gcc are you using (gcc --version)? maybe the dev tools are old?
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools

« Previous Thread | Next Thread »

All times are GMT -5. The time now is 06:52.


Powered by vBulletin®
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2020, AppleNova