in reply to DBD::Oracle install on Mac OSX 10.8.5 (Mountain Lion)

Any advice?

(mwahaha)

Re^4: Installing 32 BIT DBI and DBD

Its set to 32 bit lib of oracle. and PERL5LIB is set to 32 bit perl

What is set to 32 bit of oracle? What does PERL5LIB have to do with LD_LIBRARY_PATH? Do you still have a problem?

LD_LIBRARY_PATH, Re: perlbrew/cpanm on 64 bit Ubuntu Re: cpanm --sudo installs to /root/perl5 instead of /usr, http://perldoc.perl.org/ExtUtils/MakeMaker.html#LIBS, C_INCLUDE_PATH/LIBRARY_PATH... repeat

Its one of these things, just figure it out :)

Re^2: Installing 32 BIT DBI and DBD

Finally with some work around I fixed it. yeeepeee..!!! Here is the steps I took. Updating for others references.

Congratulations, I know that feeling :)

So you hacked Makefile? That works. The following might also work

Before running Makefile.PL

export CFLAGS='-m32' export CXXFLAGS='-m32' export LDFLAGS='-m32'

Or as arguments to Makefile.PL

perl Makefile.PL CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32

This should propagate -m32 as arguments to gcc/ldd

  • Comment on Re: DBD::Oracle install on Mac OSX 10.8.5 (Mountain Lion) (mwahaha)
  • Download Code

Replies are listed 'Best First'.
Re^2: DBD::Oracle install on Mac OSX 10.8.5 (Mountain Lion) (mwahaha)
by mpettis (Beadle) on Oct 10, 2013 at 01:17 UTC
    Thanks!

    I got it all to work, all on 64bit, and sqlplus even works. Here's my process:

    First, I followed mostly what was at this stackoverflow accepted solution.

    To that end, I did the following:

    I created the directory /Applications/instantclient_11_2.

    I downloaded from Oracle the following packages (not sure they are all necessary, but they were sufficient):

    instantclient-basic-macos.x64-11.2.0.3.0.zip instantclient-sdk-macos.x64-11.2.0.3.0.zip instantclient-sqlplus-macos.x64-11.2.0.3.0.zip

    This was all in my ~/Downloads directory, and they all unzipped into a local 'instantclient_11_2' directory, and I copied all of the results of unzipping that to /Applications/instantclient_11_2.

    Then I did the DBD::Oracle install (see following code), which fails to completely install, but at least gets the files down, which I deal with manually after this step.

    sudo perl -MCPAN -e shell install DBD::Oracle

    That code downloaded to my ~/.cpan/build directory, but per the stack overflow post, you can follow the directions there if that is not where you cpan build directory is.

    Once there I had to cd into the ~/.cpan/build/DBD-Oracle-1.66-(something) directory, then sudo su root. Now, on MacOSX, root is not enabled by default, follow the directions here to get a root account enabled on your machine.

    Now I was ready to build. I had to set two environment variables (while I'm root), like so:

    export ORACLE_HOME=/Applications/instantclient_11_2 export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Applications/instantclien +t_11_2

    to make this work. The second one is paramount because that's why you have to su to root and not just sudo it -- if you try to sudo this, the shell tells you that it doesn't pick up the DYLD_LIBRARY_PATH info. I don't know why, but there you go.

    Now I was ready to do the

    perl Makefile.pl make make install
    commands (while in the module build directory as root).

    This installed, and I got a ton of warnings, but it worked.

    Good luck to you, hope you find these instructions if you hit the same problem I did...

      Well nice tutorial but I have a question, I did all you explain and I have Mountain Lion.. but at the end when I launch < perl example.pl > an error message appear like this:

      DBD::oracle initialisation failed: Can't locate object method "driver" + via package "DBD::oracle" at /System/Library/Perl/Extras/5.16/darwin +-thread-multi-2level/DBI.pm line 808. Perhaps the capitalisation of DBD 'oracle' isn't right. at Modulos/lib +/ConectarDB.pm line 17.

      and this is ConectarDB.pm

      #!/usr/bin/perl package ConectarDB; use strict; use DBI; # variables BD my $db_user = "example"; my $db_pass = "example"; my $host_name = "example"; my $db_name = "example"; # vars my $q_string = "DBI:oracle:host=$host_name;database=$db_name"; sub connect{ return (DBI->connect ($q_string, $db_user, $db_pass, {PrintError => 0, + RaiseError => 1})); } 1;

      So, I try again, but it never works, can you help me??

        Did you read the hint in the error message?

        Perhaps the capitalisation of DBD 'oracle' isn't right. at Modulos/lib +/ConectarDB.pm line 17.

        So, is your DBI connect string really supposed to say oracle? Should it maybe say Oracle?

      Following these instructions, I got the following errors:
      Trying to find an ORACLE_HOME Found /Library/Oracle/instantclient_11_2 WARNING: Setting ORACLE_HOME env var to /Library/Oracle/instantclient_ +11_2 for you. WARNING: If these tests fail you may have to set ORACLE_HOME yourself! Installing on a darwin, Ver#12.0 Using Oracle in /Library/Oracle/instantclient_11_2 Use of uninitialized value $sqlplus_release in pattern match (m//) at +Makefile.pl line 1626. Use of uninitialized value $sqlplus_release in print at Makefile.pl li +ne 1635. Use of uninitialized value $sqlplus_release in pattern match (m//) at +Makefile.pl line 1636. If sqlplus failed due to a linker/symbol/relocation/library er +ror or similar problem then it's likely that you've not configured your environment c +orrectly. Specifically, your DYLD_LIBRARY_PATH environment variable set to include the directory containing the Oracle libraries. I'm having trouble finding your Oracle version number... trying harder WARNING: I could not determine Oracle client version so I'll just default to version 8.0.0.0. Some features of DBD::Oracle may not work. Oracle version based logic in Makefile.PL may produce erroneous result +s. You can use "perl Makefile.PL -V X.Y.Z" to specify a your client versi +on. Oracle version 8.0.0.0 (8.0) DBD::Oracle no longer supports Oracle client versions before 9.2 Try a version before 1.25 for 9 and 1.18 for 8! at Makefile.pl line 2 +71.

        Following these instructions, I got the following errors:

        And then what happened