I want to get access to Oracle DBs from my personal computer and there is a slight problem. It looks like compilation of cx_Oracle for Python is extremely difficult. I am running the latest Mac OS X 10.7 version (64-bits), I am also running the latest 2.7 Python from the python.org. I have tried several different recipes trying to compile cx_Oracle, but I am failing with every tutorial I can find. I have used 32-bit and 64-bit Oracle libraries, tried to build 32-bit and 64-bit cx_Oracle builds. I have tried to force Python working in 32-bit and 64-bit modes. I am trying all this different combinations to make it works and currently still cannot get it right.
Any tips? Instructions how it should be done?
Callback.c:186: error: expected expression before ‘OCIError’
Callback.c:186: warning: assignment makes pointer from integer without a cast
Callback.c:187: error: expected expression before ‘ub4’
Callback.c: In function ‘Callback_PrepareArgs’:
Callback.c:211: error: expected expression before ‘OCIStmt’
Callback.c:211: warning: assignment makes pointer from integer without a cast
Callback.c:212: error: expected expression before ‘OCIError’
Callback.c:212: warning: assignment makes pointer from integer without a cast
Callback.c:213: error: expected expression before ‘text’
Callback.c:213: warning: assignment makes pointer from integer without a cast
Callback.c:214: error: expected expression before ‘ub4’
lipo: can't figure out the architecture type of: /var/folders/46/qzxwrnls21lfj9px81zdx2j40000gn/T//cc16enzv.out
error: command 'gcc-4.2' failed with exit status 1
I managed to use Python 2.7 from python.org 64-bit version. I forced cx_Oracle to build only 64-bit binary and forcing to use correct Mac OS X SDK. distutils picks the wrong Mac OS X SDK, i.e. MacOSX10.6.sdk instead of MacOSX10.7.sdk. If you would check the output (OUTPUT), you can see that for the second command it's referring to both 10.6 and 10.7 SDK. Is there any problems how disutils picks Mac OS X SDK? I also import the library, but I am getting warning (WARNING). Any advices are very much welcomed.
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cx_Oracle-5.1.1-py2.7-macosx-10.6-x86_64.egg/cx_Oracle.py:3: UserWarning: Module cx_Oracle was already imported from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cx_Oracle-5.1.1-py2.7-macosx-10.6-x86_64.egg/cx_Oracle.pyc, but /Users/david/bin/cx_Oracle-5.1.1 is being added to sys.path
Looks like 10.6 SDK is picked because Python was compiled using that SDK.