[cx-oracle-users] Workarounds for Cygwin compile - still have a problem
Brought to you by:
atuining
From: Dale S. <DS...@Al...> - 2005-09-30 15:05:01
|
Hi there, I installed cx_Oracle using the Windows installer and had no problems. = But I'd also like to have cx_Oracle available in Cygwin. I downloaded = the source and unzipped to /cygdrive/c/Temp. I then ran python setup.py build --compler=3Dmingw32 install 1. gcc reported that it could not find cc1. I tried to un-install and = re-install gcc using the Cygwin setup program, and noticed that cc1.exe = was definitely being installed. I added the cc1.exe location to my path. = That solved the first problem. 2. The linker complained that it couldn't find the file -loci. Of = course, the file it couldn't find was liboci.a. I used the following web = page to make liboci.a and placed it in /cygdrive/c/oracle/ora92/bin http://www.python.org/doc/current/inst/tweak-flags.html See the section for MingW to create the .a file needed. 3. I had to symlink libpython2.4.a to libpython2.4.dll.a as the linker = complained about -lpython2.4. 4. -lgcc was not found either. I did a find and modified the setup.py = file so it has elif sys.platform =3D=3D "cygwin": includeDirs =3D ["/usr/include", "rdbms/demo", "rdbms/public", \ "network/public", "oci/include", "/lib", "/usr/lib", \ "/lib/gcc/i686-pc-cygwin/3.4.4", \ "/usr/lib/gcc/i686-pc-cygwin/3.4.4"] libDirs =3D ["bin", "lib", "/lib", "/usr/lib", \ "/lib/gcc/i686-pc-cygwin/3.4.4", \ "/usr/lib/gcc/i686-pc-cygwin/3.4.4"] At that point, everything worked. My test script (see below) reported a runtime error when calling = connect: Unable to acquire Oracle environment handle ORACLE_HOME is defined and points to the correct place. When connecting = with sqlplus under Cygwin, I get the message Error 6 initializing SQL*Plus Message file sp1<lang>.msb not found SP2-0750: You may need to set ORACLE_HOME to your Oracle software = directory I looked around using Google. I set the appropriate read and execute = permissions on oracle/ora92 and sub-directories in bash. It appears that = the NLS_LANG variable needs to be set in the bash shell. I did that = according to directions in http://www.oracle.com/technology/tech/globalization/htdocs/nls_lang%20faq= .htm but it didn't help. I'm still working on this problem, so if anyone has = information please email me directly. test1.py: import os import sys import cx_Oracle uname =3D "dsmith" passwd =3D "xxx" tnsentry =3D "yyy" conn =3D cx_Oracle.connect(uname, passwd, tnsentry) cursor =3D conn.cursor() cursor.execute("select count(*) from tbl") count, =3D cursor.fetchone() print "rowcount is %d" % count conn.close() sys.exit() Regards, Dale Smith, Ph.D. Aladdin Capital Management LLC Three Landmark Square Stamford, CT 06901 Phone: 203-487-6768 Fax: 203-326-7902 ds...@al... |