[Pythonmac-SIG] Python and Oracle (was Compiling cx_Oracle for OS X)

Barron Snyder barronsnyder@mac.com
Sat, 4 May 2002 08:59:44 -0500


There is an Oracle client for OS X out there! You can find it at 
http://otn.oracle.com/software/tech/java/sqlj_jdbc/content.html (you'll 
need to join the Oracle Technology Network to get it, but it's free). 
They show 2 entries for OS X drivers, the Oracle9i JDBC driver and the 
Oracle8i OCI driver. The OCI driver installs the Oracle client for OS X. 
It looks like this was posted at the end of April. I don't know why 
Oracle decided to list it in their Java section.

With the Oracle client installed, I need a way to talk to OCI (Oracle 
Call Interface) from Python and I think cx_Oracle will do the trick. 
That is, if I can get it set up on OS X! When I tried installing it 
again, I get the following output:

[localhost:/Applications/cx_Oracle-2.4] barron% python setup.py install
running install
running build
running build_ext
building 'cx_Oracle' extension
creating build
creating build/temp.darwin-5.4-Power Macintosh-2.2
cc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -no-cpp-precomp 
-I/Applications/Oracle/rdbms/demo -I/Applications/Oracle/rdbms/public 
-I/Applications/Oracle/network/public -I/sw/include/python2.2 -c 
cx_Oracle.c -o build/temp.darwin-5.4-Power Macintosh-2.2/cx_Oracle.o
In file included from /Applications/Oracle/rdbms/demo/oci.h:1648,
                  from cx_Oracle.c:7:
/Applications/Oracle/rdbms/demo/oci1.h:148: warning: function 
declaration isn't a prototype
In file included from /Applications/Oracle/rdbms/demo/oci.h:1673,
                  from cx_Oracle.c:7:
/Applications/Oracle/rdbms/demo/ociap.h:6274: warning: function 
declaration isn't a prototype
/Applications/Oracle/rdbms/demo/ociap.h:8753: warning: function 
declaration isn't a prototype
/Applications/Oracle/rdbms/demo/ociap.h:8759: warning: function 
declaration isn't a prototype
creating build/lib.darwin-5.4-Power Macintosh-2.2
cc -L/sw/lib -bundle -flat_namespace -undefined suppress 
build/temp.darwin-5.4-Power Macintosh-2.2/cx_Oracle.o 
-L/Applications/Oracle/lib -lclntsh -o build/lib.darwin-5.4-Power 
Macintosh-2.2/cx_Oracle.so -s
/usr/bin/ld: can't use -s with -bundle (file must contain at least 
global symbols, for maximum stripping use -x)
error: command 'cc' failed with exit status 1

I'm not very familiar with c/c++ and compiling anything for OS X (but 
trying to learn).
Do I need to worry about the warnings (warning: function declaration 
isn't a prototype)?
Can anyone tell me what the error "can't use -s with -bundle" means?

Thanks,
Barron


On Friday, May 3, 2002, at 08:10 PM, SNYDER, BARRON F (AIT) wrote:

> Well, compiling this for OS X may be a waste of time since I can't seem 
> to
> find an Oracle client for OS X... Kinda funny since I believe Larry 
> Ellison
> is on Apple's board.
>
> However, regarding the compiling, the download contains a setup.py 
> file. If
> I run this (python setup.py install), might it compile and install 
> itself? I
> tried it, but without an Oracle client installed (need an ORACLE_HOME), 
> it
> errored out. But is this the general idea of setup.py?
>
> If anybody knows of a way to connect to an Oracle database from OS X, 
> please
> send a few hints my way.
>
> Thanks,
> Barron
>
> -----Original Message-----
> From: SNYDER, BARRON F (AIT)
> Sent: Friday, May 03, 2002 7:20 PM
> To: pythonmac-sig@python.org
> Subject: [Pythonmac-SIG] Compiling cx_Oracle for OS X
>
>
> Hello,
>
> I'd like to access a database (specifically Oracle) from my Python code 
> and
> found cx_Oracle through the Vaults of Parnassus:
> http://www.computronix.com/utilities/
>
> They don't offer a package for OS X (surprise, surprise) but one can
> download the source:
> http://www.computronix.com/download/cx_Oracle-2.4.tar.gz
>
> How hard would this be to compile for OS X? There is no visual 
> interface for
> this which I think would make the port much easier. If it's not too 
> hard,
> would someone tell me the basic steps (or point me to a quick tutorial)?
>
> Thanks,
> Barron