Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > mkmf and oracle problem - not detecting header files

Reply
Thread Tools

mkmf and oracle problem - not detecting header files

 
 
Daniel Berger
Guest
Posts: n/a
 
      06-28-2005
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


 
Reply With Quote
 
 
 
 
marcus baker
Guest
Posts: n/a
 
      06-28-2005
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

On 6/28/05, Daniel Berger <(E-Mail Removed)> wrote:
> Hi all,
>=20
> Oracle 9.2.0.4
> Mandriva Linux 2.6.8.1
> Ruby 1.8.2
>=20
> 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:
>=20
> # extconf.rb
> require "mkmf"
> dir_config("oracle")
> have_header("oci.h")
>=20
> # To demonstrate that the oci.h file does exist
> >ls /home/oracle/9204/rdbms/demo/oci.h

> /home/oracle/9204/rdbms/demo/oci.h
>=20
> I tried several different things - what am I doing wrong?
>=20
> >ruby extconf.rb

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

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

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

> checking for oci.h... no
>=20
> Regards,
>=20
> Dan
>=20
>



 
Reply With Quote
 
 
 
 
Daniel Berger
Guest
Posts: n/a
 
      06-28-2005
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


 
Reply With Quote
 
marcus baker
Guest
Posts: n/a
 
      06-28-2005
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 <(E-Mail Removed)> 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?

>=20
> >printenv ORACLE_HOME

> /home/oracle/9204
>=20
> Yep, though it shouldn't matter for my mini example.
>=20
> >echo $SHELL

> /bin/bash
>=20
> Any other ideas?
>=20
> Dan
>=20
>



 
Reply With Quote
 
nobu.nokada@softhome.net
Guest
Posts: n/a
 
      06-28-2005
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


 
Reply With Quote
 
KUBO Takehiro
Guest
Posts: n/a
 
      06-29-2005
Daniel Berger <(E-Mail Removed)> 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..._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
> >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: http://www.velocityreviews.com/forums/(E-Mail Removed)
web: http://www.jiubao.org
GnuPG fingerprint = 5F7B C8EF CA16 57D0 FDE1 9F47 C001 1F93 AC08 2262


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Header files with "header.h" or <header.h> ?? mlt C++ 2 01-31-2009 02:54 PM
Help with adding header files for 'mkmf' - new to Swig/mkmf james.d.masters@gmail.com Ruby 0 10-24-2007 08:19 PM
require "mkmf" ---> can't find header files for ruby? anne001 Ruby 0 01-15-2006 09:35 PM
install_driver(Oracle) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified procedure could not be found at C:/Perl/lib/DynaLoader.pm line 230. Feyruz Perl Misc 4 10-14-2005 06:47 PM
Header files included in header files John Smith C Programming 18 07-24-2004 04:55 AM



Advertisments