mkmf and oracle problem - not detecting header files

D

Daniel Berger

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
 
M

marcus baker

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=3D/home/oracle/9204
 
M

marcus baker

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?
 
N

nobu.nokada

Hi,

At Wed, 29 Jun 2005 03:49:33 +0900,
Daniel Berger wrote in [ruby-talk:146673]:
checking for oci.h... no

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

KUBO Takehiro

Daniel Berger said:
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/viewcv...aconf.rb?cvsroot=ruby-oci8&only_with_tag=MAIN

# 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
/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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top