rlm_sql_oracle:libclntsh.so.11.1: cannot open shared object file

Okis Chuang okischuang at outlook.com
Tue May 28 05:00:02 CEST 2013


Hi guys,

 

I'm now trying to build another "FreeRADIUS 2.2.0" with rlm_sql_oracle which
using Oracle "instantclient 11.2.0.3.0" and backend "Oracle 11g".

And the OS version is Linux x86_64 (including CentOS 6.2 & RHEL Server 5
Tikanga).

I've tried many times following step by step on google. Unfortunately all i
got was the error like below:

--

Could not link driver rlm_sql_oracle: libclntsh.so.11.1: cannot open shared
object file: No such file or directory

Make sure it (and all its dependent libraries!) are in the search path of
your system's ld.

/opt/freeRADIUS-CoA/etc/raddb/sql.conf[22]: Instantiation failed for module
"sql"

/opt/freeRADIUS-CoA/etc/raddb/sites-enabled/default[191]: Failed to find
"sql" in the "modules" section.

/opt/freeRADIUS-CoA/etc/raddb/sites-enabled/default[69]: Errors parsing
authorize section.

--

I have no idea why it couldn't link libclntsh.so.11.1. I think I must be
wrong in some way but just couldn't find the way out...

 

Here are my installation steps:

 

1. ./configure --prefix=/opt/freeRADIUS
--with-oracle-lib-dir=/usr/lib/oracle/11.2/client64/lib
--with-oracle-include-dir=/usr/include/oracle/11.2/client64

and the following are configure logs

--

=== configuring in ./drivers/rlm_sql_oracle
(/home/okis/freeradius-server-2.2.0/src/modules/rlm_sql/./drivers/rlm_sql_or
acle)

configure: running /bin/sh ./configure '--prefix=/opt/freeRADIUS-Oracle'
'--with-oracle-include-dir=/usr/include/oracle/11.2/client64/'
'--with-oracle-lib-dir=/usr/lib/oracle/11.2/client64/lib'
'--enable-ltdl-install' --cache-file=/dev/null --srcdir=.

checking for oci.h... checking for gcc... gcc

checking for C compiler default output file name... a.out

checking whether the C compiler works... yes

checking whether we are cross compiling... no

checking for suffix of executables...

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ISO C89... none needed

yes

yes

configure: creating ./config.status

config.status: creating Makefile

--

2. make

Making all in rlm_sql_oracle.

gmake[9]: Entering directory
`/home/okis/freeradius-server-2.2.0/src/modules/rlm_sql/drivers/rlm_sql_orac
le'

gmake[9]: Nothing to be done for `all'.

gmake[9]: Leaving directory
`/home/okis/freeradius-server-2.2.0/src/modules/rlm_sql/drivers/rlm_sql_orac
le'

It looks like *Nothing* done here.

3. make install

 

After doning those regular steps, and finishing all config setup(e.g.
uncomment $INCLUDE sql.conf, sql in authorize section; set up sql.conf), I
tried to run radius -X, but like I said before, it failed to link .so file.

Hence, I did the following steps again.

 

4. 

(1)cd ./src/modules/rlm_sql/drivers/rlm_sql_oracle 

(2)./configure --with-oracle-lib-dir=/usr/lib/oracle/11.2/client64/lib
--with-oracle-include-dir=/usr/include/oracle/11.2/client64

(3)make

--

/home/okis/freeradius-server-2.2.0/libtool --mode=compile gcc
-I/home/okis/freeradius-server-2.2.0
-I/home/okis/freeradius-server-2.2.0/src
-I//usr/include/oracle/11.2/client64 -Wall -D_GNU_SOURCE -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -DNDEBUG
-I/home/okis/freeradius-server-2.2.0/libltdl -I../..
-I/home/okis/freeradius-server-2.2.0/src/
-I/usr/include/oracle/11.2/client64 -c sql_oracle.c

mkdir .libs

gcc -I/home/okis/freeradius-server-2.2.0
-I/home/okis/freeradius-server-2.2.0/src
-I//usr/include/oracle/11.2/client64 -Wall -D_GNU_SOURCE -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -DNDEBUG
-I/home/okis/freeradius-server-2.2.0/libltdl -I../..
-I/home/okis/freeradius-server-2.2.0/src/
-I/usr/include/oracle/11.2/client64 -c sql_oracle.c  -fPIC -DPIC -o
.libs/sql_oracle.o

sql_oracle.c: In function 'sql_error':

sql_oracle.c:66: warning: pointer targets in passing argument 5 of
'OCIErrorGet' differ in signedness

//usr/include/oracle/11.2/client64/ociap.h:7265: note: expected 'OraText *'
but argument is of type 'char *'

sql_oracle.c: In function 'sql_init_socket':

sql_oracle.c:179: warning: pointer targets in passing argument 4 of
'OCILogon' differ in signedness

//usr/include/oracle/11.2/client64/ociap.h:7143: note: expected 'const
OraText *' but argument is of type 'char *'

sql_oracle.c:179: warning: pointer targets in passing argument 6 of
'OCILogon' differ in signedness

//usr/include/oracle/11.2/client64/ociap.h:7143: note: expected 'const
OraText *' but argument is of type 'char *'

sql_oracle.c:179: warning: pointer targets in passing argument 8 of
'OCILogon' differ in signedness

//usr/include/oracle/11.2/client64/ociap.h:7143: note: expected 'const
OraText *' but argument is of type 'char *'

sql_oracle.c: In function 'sql_query':

sql_oracle.c:253: warning: pointer targets in passing argument 3 of
'OCIStmtPrepare' differ in signedness

//usr/include/oracle/11.2/client64/ociap.h:7163: note: expected 'const
OraText *' but argument is of type 'char *'

sql_oracle.c: In function 'sql_select_query':

sql_oracle.c:311: warning: pointer targets in passing argument 3 of
'OCIStmtPrepare' differ in signedness

//usr/include/oracle/11.2/client64/ociap.h:7163: note: expected 'const
OraText *' but argument is of type 'char *'

gcc -I/home/okis/freeradius-server-2.2.0
-I/home/okis/freeradius-server-2.2.0/src
-I//usr/include/oracle/11.2/client64 -Wall -D_GNU_SOURCE -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -DNDEBUG
-I/home/okis/freeradius-server-2.2.0/libltdl -I../..
-I/home/okis/freeradius-server-2.2.0/src/
-I/usr/include/oracle/11.2/client64 -c sql_oracle.c -o sql_oracle.o
>/dev/null 2>&1

/home/okis/freeradius-server-2.2.0/libtool --mode=link gcc -release 2.2.0 \

        -module -export-dynamic -L/usr/lib/oracle/11.2/client64/lib  -o
rlm_sql_oracle.la \

        -rpath /opt/FR-Oracle/lib sql_oracle.lo
-L/usr/lib/oracle/11.2/client64/lib  -lclntsh -lnnz11

gcc -shared  .libs/sql_oracle.o  -L/usr/lib/oracle/11.2/client64/lib
-lclntsh -lnnz11  -Wl,-soname -Wl,rlm_sql_oracle-2.2.0.so -o
.libs/rlm_sql_oracle-2.2.0.so

(cd .libs && rm -f rlm_sql_oracle.so && ln -s rlm_sql_oracle-2.2.0.so
rlm_sql_oracle.so)

ar cru .libs/rlm_sql_oracle.a  sql_oracle.o

ranlib .libs/rlm_sql_oracle.a

creating rlm_sql_oracle.la

(cd .libs && rm -f rlm_sql_oracle.la && ln -s ../rlm_sql_oracle.la
rlm_sql_oracle.la)

--

(4)make install

--

# make install

if [ "xrlm_sql_oracle" != "x" ]; then \

            /home/okis/freeradius-server-2.2.0/libtool --mode=install
/home/okis/freeradius-server-2.2.0/install-sh -c -c \

                rlm_sql_oracle.la /opt/FR-Oracle/lib/rlm_sql_oracle.la ||
exit $?; \

            rm -f /opt/FR-Oracle/lib/rlm_sql_oracle-2.2.0.la; \

            ln -s rlm_sql_oracle.la
/opt/FR-Oracle/lib/rlm_sql_oracle-2.2.0.la || exit $?; \

        fi

/home/okis/freeradius-server-2.2.0/install-sh -c -c
.libs/rlm_sql_oracle-2.2.0.so /opt/FR-Oracle/lib/rlm_sql_oracle-2.2.0.so

(cd /opt/FR-Oracle/lib && { ln -s -f rlm_sql_oracle-2.2.0.so
rlm_sql_oracle.so || { rm -f rlm_sql_oracle.so && ln -s
rlm_sql_oracle-2.2.0.so rlm_sql_oracle.so; }; })

/home/okis/freeradius-server-2.2.0/install-sh -c -c .libs/rlm_sql_oracle.lai
/opt/FR-Oracle/lib/rlm_sql_oracle.la

/home/okis/freeradius-server-2.2.0/install-sh -c -c .libs/rlm_sql_oracle.a
/opt/FR-Oracle/lib/rlm_sql_oracle.a

chmod 644 /opt/FR-Oracle/lib/rlm_sql_oracle.a

ranlib /opt/FR-Oracle/lib/rlm_sql_oracle.a

PATH="$PATH:/sbin" ldconfig -n /opt/FR-Oracle/lib

----------------------------------------------------------------------

Libraries have been installed in:

   /opt/FR-Oracle/lib

 

If you ever happen to want to link against installed libraries

in a given directory, LIBDIR, you must either use libtool, and

specify the full pathname of the library, or use the `-LLIBDIR'

flag during linking and do at least one of the following:

   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable

     during execution

   - add LIBDIR to the `LD_RUN_PATH' environment variable

     during linking

   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag

   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

 

See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

----------------------------------------------------------------------

--

 

While it still cannot work now...Anyone has any recommendation about this?
If needed any other information for debugging, please let me know directly.

Any help would be appreciate!!

 

Okis.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20130528/d4e31316/attachment-0001.html>


More information about the Freeradius-Users mailing list