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

bob ackerman rdacker@pacbell.net
Sat, 04 May 2002 11:14:42 -0700


--Boundary_(ID_1kw1lG8ZFf9+h68EtnJPfg)
Content-type: text/plain; charset=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT


On Saturday, May 4, 2002, at 06:59  AM, Barron Snyder wrote:

> 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 have a note to myself that says i need to use:
-bundle -flat_namespace -undefined suppress
when compiling python modules on osx.
i remember some documentation somewhere that explains it in detail, but i 
don't remember where.
one could probable find it in a search, if just putting that line in your 
makefile doesn't fix it.

> 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
>
>
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>

--Boundary_(ID_1kw1lG8ZFf9+h68EtnJPfg)
Content-type: text/enriched; charset=US-ASCII
Content-transfer-encoding: 7BIT


On Saturday, May 4, 2002, at 06:59  AM, Barron Snyder wrote:


<excerpt>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

</excerpt>


i have a note to myself that says i need to use:

<fixed><fontfamily><param>Courier New</param><color><param>6666,0000,6666</param><bigger>-bundle
-flat_namespace -undefined suppress

</bigger></color></fontfamily></fixed>when compiling python modules on
osx.

i remember some documentation somewhere that explains it in detail,
but i don't remember where.

one could probable find it in a search, if just putting that line in
your makefile doesn't fix it.


<excerpt>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:


<excerpt>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

</excerpt>



_______________________________________________

Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org

http://mail.python.org/mailman/listinfo/pythonmac-sig


</excerpt>

--Boundary_(ID_1kw1lG8ZFf9+h68EtnJPfg)--