[gdal-dev] Build OGR with Oracle support

Normand Savard nsavard at mapgears.com
Thu Jun 18 16:18:28 EDT 2009


Mateusz Loskot wrote:
>
>
> ./configure generates a log file called config.log.
> If something goes wrong, there should be some diagnostic in this file.
> It would be helpful if you could share it, for instance, here:
>
> http://pastebin.com/
>
> This will help to find what's the problem.
>
>   
Maateusz,

You were right, this help a lot.  I succeeded to build OGR with Oracle 
10g and 11g but for those who may come on a similar issue in the future, 
I'm posting the process I went through.

I downloaded
oracle-instantclient-basic-10.2.0.4-1.i386.zip (library)
oracle-instantclient-devel-10.2.0.4-1.i386.zip (headers)

or
instantclient-basic-linux32-11.1.0.7.zip (library)
instantclient-sdk-linux32-11.1.0.7.zip (headers)


As suggested I checked the config.log (see 1) and noticed that there was 
a link problem (-lclntsh).  I went to the instantclient directory to 
check for libclntsh.so, but it was not there.  So I added a link to 
libclntsh.so.11.1. 

I redid the configure and checked the config.log again (see 2).  I 
noticed that libnnz11.so library was not found.  I went to the 
instantclient directory but the library was present.  Since I use the 
fgs-dev environment the libraries are not in a traditional path so the 
linker could not find it.  To solve this issue, I added the path to 
where the library was installed to $LD_LIBRARY_PATH.  There was a 
problem with libaio.so.1 library.  For this particular issue I had to 
install libaio-dev on my system (Ubuntu:  apt-get install).

It works fine after that.

Thank you to both of you.

Norm



1)config.log
configure:23653: checking for Oracle OCI headers in 
/home/fgs/fgs-dev/built/ins\
tantclient_11_1/sdk/include
configure:23696: g++ -c -fPIC  -g -DDEBUG  
-I/home/fgs/fgs-dev/built/instantcli\
ent_11_1/sdk/include conftest.cpp >&5
configure:23702: $? = 0
configure:23715: result: yes
configure:23740: checking for Oracle OCI libraries in 
/home/fgs/fgs-dev/built/i\
nstantclient_11_1
configure:23743: result: norm: 
-L/home/fgs/fgs-dev/built/instantclient_11_1 -lc\
lntsh
configure:23745: result: norm: 
-I/home/fgs/fgs-dev/built/instantclient_11_1/sdk\
/include
configure:23781: g++ -o conftest -fPIC  -g -DDEBUG  
-I/home/fgs/fgs-dev/built/i\
nstantclient_11_1/sdk/include  
-L/home/fgs/fgs-dev/built/instantclient_11_1 -lc\
lntsh conftest.cpp -L/home/fgs/fgs-dev/built/jpeg 
-L/home/fgs/fgs-dev/built/jpe\
g/lib -ljpeg -L/home/fgs/fgs-dev/built/libgeotiff/lib -lgeotiff 
-L/home/fgs/fgs\
-dev/built/tiff/lib -ltiff -L/home/fgs/fgs-dev/built/libpng 
-L/home/fgs/fgs-dev\
/built/libpng/lib -lpng -lpq -L/home/fgs/fgs-dev/built/postgresql/lib 
-lpq -lz \
-L/home/fgs/fgs-dev/built/zlib -L/home/fgs/fgs-dev/built/zlib/lib  -lm 
-lrt -ld\
l  >&5
/usr/bin/ld: cannot find -lclntsh
collect2: ld returned 1 exit status
configure:23787: $? = 1
configure: failed program was:
|
|                 /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""






2) config.log

configure:23740: checking for Oracle OCI libraries in 
/home/fgs/fgs-dev/built/i\
nstantclient_11_1
configure:23743: result: norm: 
-L/home/fgs/fgs-dev/built/instantclient_11_1 -lc\
lntsh
configure:23745: result: norm: 
-I/home/fgs/fgs-dev/built/instantclient_11_1/sdk\
/include
configure:23781: g++ -o conftest -fPIC  -g -DDEBUG  
-I/home/fgs/fgs-dev/built/i\
nstantclient_11_1/sdk/include  
-L/home/fgs/fgs-dev/built/instantclient_11_1 -lc\
lntsh conftest.cpp -L/home/fgs/fgs-dev/built/jpeg 
-L/home/fgs/fgs-dev/built/jpe\
g/lib -ljpeg -L/home/fgs/fgs-dev/built/libgeotiff/lib -lgeotiff 
-L/home/fgs/fgs\
-dev/built/tiff/lib -ltiff -L/home/fgs/fgs-dev/built/libpng 
-L/home/fgs/fgs-dev\
/built/libpng/lib -lpng -lpq -L/home/fgs/fgs-dev/built/postgresql/lib 
-lpq -lz \
-L/home/fgs/fgs-dev/built/zlib -L/home/fgs/fgs-dev/built/zlib/lib  -lm 
-lrt -ld\
l  >&5
/usr/bin/ld: warning: libnnz11.so, needed by 
/home/fgs/fgs-dev/built/instantcli\
ent_11_1/libclntsh.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libaio.so.1, needed by 
/home/fgs/fgs-dev/built/instantcli\
ent_11_1/libclntsh.so, not found (try using -rpath or -rpath-link)
/home/fgs/fgs-dev/built/instantclient_11_1/libclntsh.so: undefined 
reference to\
 `nzos_ServiceWriteQueue'
/home/fgs/fgs-dev/built/instantclient_11_1/libclntsh.so: undefined 
reference to\
 `nzosCipherSpecToStr'
/home/fgs/fgs-dev/built/instantclient_11_1/libclntsh.so: undefined 
reference to\
 `C_SetCRLBER'



More information about the gdal-dev mailing list