[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

mkmf and oracle problem - not detecting header files

Berger, Daniel

6/28/2005 6:50:00 PM

Hi all,

Oracle 9.2.0.4
Mandriva Linux 2.6.8.1
Ruby 1.8.2

I suspect I need a good dose of caffeine, because I can't figure out why
the ruby-oci package isn't picking up the Oracle header files. To
simplify things as much as possible, I created a test extconf.rb script
that looks like this:

# extconf.rb
require "mkmf"
dir_config("oracle")
have_header("oci.h")

# To demonstrate that the oci.h file does exist
>ls /home/oracle/9204/rdbms/demo/oci.h
/home/oracle/9204/rdbms/demo/oci.h

I tried several different things - what am I doing wrong?

>ruby extconf.rb
checking for oci.h... no

>ruby extconf.rb --with-oracle-dir=/home/oracle/9204
checking for oci.h... no

>ruby extconf.rb --with-oracle-dir=/home/oracle/9204/rdbms/demo
checking for oci.h... no

>ruby extconf.rb --with-oracle-include=/home/oracle/9204/rdbms/demo
checking for oci.h... no

Regards,

Dan


5 Answers

marcus baker

6/28/2005 7:00:00 PM

0

Have you set your ORACLE_HOME environment variable to the directory
containing 'rdbms/demo/oci.h', in your case /home/oracle/9204?

run a 'printenv ORACLE_HOME' to see if it shows up as such.

if not, then depending on your shell:
export ORACLE_HOME=/home/oracle/9204

On 6/28/05, Daniel Berger <Daniel.Berger@qwest.com> wrote:
> Hi all,
>
> Oracle 9.2.0.4
> Mandriva Linux 2.6.8.1
> Ruby 1.8.2
>
> I suspect I need a good dose of caffeine, because I can't figure out why
> the ruby-oci package isn't picking up the Oracle header files. To
> simplify things as much as possible, I created a test extconf.rb script
> that looks like this:
>
> # extconf.rb
> require "mkmf"
> dir_config("oracle")
> have_header("oci.h")
>
> # To demonstrate that the oci.h file does exist
> >ls /home/oracle/9204/rdbms/demo/oci.h
> /home/oracle/9204/rdbms/demo/oci.h
>
> I tried several different things - what am I doing wrong?
>
> >ruby extconf.rb
> checking for oci.h... no
>
> >ruby extconf.rb --with-oracle-dir=/home/oracle/9204
> checking for oci.h... no
>
> >ruby extconf.rb --with-oracle-dir=/home/oracle/9204/rdbms/demo
> checking for oci.h... no
>
> >ruby extconf.rb --with-oracle-include=/home/oracle/9204/rdbms/demo
> checking for oci.h... no
>
> Regards,
>
> Dan
>
>


Berger, Daniel

6/28/2005 7:05:00 PM

0

marcus baker wrote:
> Have you set your ORACLE_HOME environment variable to the directory
> containing 'rdbms/demo/oci.h', in your case /home/oracle/9204?

>printenv ORACLE_HOME
/home/oracle/9204

Yep, though it shouldn't matter for my mini example.

>echo $SHELL
/bin/bash

Any other ideas?

Dan


marcus baker

6/28/2005 7:51:00 PM

0

I don't think your short test extconf.rb would work here, as the
have_header directive after the dir_config specifically looks in an
'include' subdirector for header files, and as it stands Oracle's
installation of oci.h is in an odd place of rdbms/demo/oci.h.

I believe that ruby-oci (8, at least) plays around with setting some
environment variables and search paths based on the ORACLE_HOME
variable before it does it's own have_header('oci.h') test.

Which ruby-oci package are you trying this out on? 8? 9? Is it
failing to install or run afterwards?

On 6/28/05, Daniel Berger <Daniel.Berger@qwest.com> wrote:
> marcus baker wrote:
> > Have you set your ORACLE_HOME environment variable to the directory
> > containing 'rdbms/demo/oci.h', in your case /home/oracle/9204?
>
> >printenv ORACLE_HOME
> /home/oracle/9204
>
> Yep, though it shouldn't matter for my mini example.
>
> >echo $SHELL
> /bin/bash
>
> Any other ideas?
>
> Dan
>
>


nobu.nokada

6/28/2005 9:46:00 PM

0

Hi,

At Wed, 29 Jun 2005 03:49:33 +0900,
Daniel Berger wrote in [ruby-talk:146673]:
> >ruby extconf.rb --with-oracle-include=/home/oracle/9204/rdbms/demo
> checking for oci.h... no

You should show the mkmf.log file, if you have a problem with
extconf.

--
Nobu Nakada


KUBO Takehiro

6/29/2005 2:15:00 PM

0

Daniel Berger <Daniel.Berger@qwest.com> writes:

> Hi all,
>
> Oracle 9.2.0.4
> Mandriva Linux 2.6.8.1
> Ruby 1.8.2
>
> I suspect I need a good dose of caffeine, because I can't figure out why
> the ruby-oci package isn't picking up the Oracle header files. To
> simplify things as much as possible, I created a test extconf.rb script
> that looks like this:
>
> # extconf.rb
> require "mkmf"
> dir_config("oracle")
> have_header("oci.h")

How about using oraconf.rb in ruby-oci8.
http://rubyforge.org/cgi-bin/viewcvs.cgi/ruby-oci8/ext/oci8/oraconf.rb?cvsroot=ruby-oci8&only_wit...

# extconf.rb
require "mkmf"
require File.dirname(__FILE__) + '/oraconf'
oraconf = OraConf.new()
$CFLAGS += oraconf.cflags
$libs += oraconf.libs

> # To demonstrate that the oci.h file does exist
> >ls /home/oracle/9204/rdbms/demo/oci.h
> /home/oracle/9204/rdbms/demo/oci.h

The simpest way is:

# extconf.rb
require "mkmf"
oracle_home = ENV['ORACLE_HOME']
$CFLAGS += " -I#{oracle_home}/rdbms/demo -I#{oracle_home}/rdbms/public "
$libs += " -L#{oracle_home}/lib -lclntsh "
have_header("oci.h")

It will work on Oracle 9i or later.

--
KUBO Takehiro
email: kubo@jiubao.org
web: http://www....
GnuPG fingerprint = 5F7B C8EF CA16 57D0 FDE1 9F47 C001 1F93 AC08 2262