mkmf and oracle problem - not detecting header files

Discussion in 'Ruby' started by Daniel Berger, Jun 28, 2005.

  1. 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
     
    Daniel Berger, Jun 28, 2005
    #1
    1. Advertising

  2. Daniel Berger

    marcus baker Guest

    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 <> 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
    >
     
    marcus baker, Jun 28, 2005
    #2
    1. Advertising

  3. 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
     
    Daniel Berger, Jun 28, 2005
    #3
  4. Daniel Berger

    marcus baker Guest

    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 <> 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
    >
     
    marcus baker, Jun 28, 2005
    #4
  5. Daniel Berger

    Guest

    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
     
    , Jun 28, 2005
    #5
  6. Daniel Berger <> 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/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
    > >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:
    web: http://www.jiubao.org
    GnuPG fingerprint = 5F7B C8EF CA16 57D0 FDE1 9F47 C001 1F93 AC08 2262
     
    KUBO Takehiro, Jun 29, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Smith

    Header files included in header files

    John Smith, Jul 21, 2004, in forum: C Programming
    Replies:
    18
    Views:
    608
    Jack Klein
    Jul 24, 2004
  2. mlt
    Replies:
    2
    Views:
    845
    Jean-Marc Bourguet
    Jan 31, 2009
  3. anne001
    Replies:
    0
    Views:
    239
    anne001
    Jan 15, 2006
  4. Replies:
    0
    Views:
    132
  5. Feyruz
    Replies:
    4
    Views:
    2,186
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page