Re: [cx-oracle-users] cx_Oracle on HP-UX 11.31 ia64 built with aCC successfully but failed to load
Brought to you by:
atuining
From: Wong W. Meng-R. <r3...@fr...> - 2011-09-25 12:23:09
|
Thanks for your reply. Ok I will take a look at the aspect if of building python as a shared library not static. Also I will try out the LD_PRELOAD thing. I will post out my findings after trying It out. Regards, Wah Meng On Sep 25, 2011, at 4:21 AM, "inkblotter" <ink...@gm...> wrote: > The difference between your chatr and mine > > I used python 2.5.1 and you used python 2.7.1 > we both ran ia64 11.31 hpux > my chatr and yours differ because mine includes these critical libraries > libclntsh.so.11.1 > libttsh11.so > libpython2.5.so > whereas yours only has the Oracle libclntsh.so but not the other two. > when I run python, without LD_PRELOAD, I can import cx_Oracle > successfully and you can't. > > > Now well you may ask how I built that cx_Oracle.so on ia64? Sigh. > > I can't tell you exactly. I think when you rebuild python you must build > it as a shared library, not as a static library, and pass it the ttsh11 > as and extra library. and then you build cx_Oracle against that shared > python library, maybe it works, maybe it doesn't. > > Blush. The plot is thicker. I think in later version of python, like > your python 2.7.1, this trick won't work. Yes, you should always build > python shared, not static. But even that doesn't make it work. That is > why I suggested LD_PRELOAD to get to a point that works, however kludgey. > > LD_PRELOAD=<path_to $ORACLE_HOME/lib/libclntsh.so> python >>> import cx_Oracle > > Or maybe LD_PRELOAD=<path to cx_Oracle.so> python > instead. > > No space before or after the '=' sign. > > But python should be built shared, not static. > > > > > > On 09/19/2011 09:07 PM, Wong Wah Meng-R32813 wrote: >> This is the output of file, ldd and chart, respectively. Can you help to elaborate what does it mean by using "LD_PRELOAD"? It gives me an error when I invoke it by appending LD_PRELOAD with the path of python. LD_PRELOAD is an invalid command when I separate the two. >> >> $ cp cx_Oracle-5.0/build/lib*/*.so $PYTHONPATH >> $ which cx_Oracle.so >> /home/r32813/Build/2.7.1/Python-2.7.1/Lib/cx_Oracle.so >> $ file `which cx_Oracle.so` >> /home/r32813/Build/2.7.1/Python-2.7.1/Lib/cx_Oracle.so: ELF-64 shared object file - IA64 >> $ ldd `which cx_Oracle.so` >> >> /home/r32813/Build/2.7.1/Python-2.7.1/Lib/cx_Oracle.so: >> libclntsh.so.11.1 => /opt/oracle/product/11.1.0/lib/libclntsh.so.11.1 >> libnnz11.so => /opt/oracle/product/11.1.0/lib/libnnz11.so >> libdl.so.1 => /usr/lib/hpux64/libdl.so.1 >> libm.so.1 => /usr/lib/hpux64/libm.so.1 >> libpthread.so.1 => /usr/lib/hpux64/libpthread.so.1 >> libnsl.so.1 => /usr/lib/hpux64/libnsl.so.1 >> libunwind.so.1 => /usr/lib/hpux64/libunwind.so.1 >> libc.so.1 => /usr/lib/hpux64/libc.so.1 >> libxti.so.1 => /usr/lib/hpux64/libxti.so.1 >> libuca.so.1 => /usr/lib/hpux64/libuca.so.1 >> libdl.so.1 => /usr/lib/hpux64/libdl.so.1 >> >> $ chatr `which cx_Oracle.so` >> /home/r32813/Build/2.7.1/Python-2.7.1/Lib/cx_Oracle.so: >> 64-bit ELF shared library >> shared library dynamic path search: >> LD_LIBRARY_PATH enabled first >> SHLIB_PATH enabled second >> embedded path enabled third /opt/oracle/product/11.1.0/lib:/opt/oracle/product/11.1.0 >> shared library list: >> libclntsh.so.11.1 >> shared library mapped private disabled >> shared vtable support disabled >> explicit unloading enabled >> linkage table protection disabled >> segments: >> index type address flags size >> 7 text 4000000000000000 z---c- D (default) >> 8 data 6000000000000000 ---m-- D (default) >> kernel assisted branch prediction enabled >> lazy swap allocation for dynamic segments disabled >> nulptr dereferences trap disabled >> address space model: default >> caliper dynamic instrumentation disabled >> >> $ which python >> /home/r32813/Build/2.7.1/Python-2.7.1/Lib/../python >> $ LD_PRELOAD`which python` >> sh: LD_PRELOAD/home/r32813/Build/2.7.1/Python-2.7.1/Lib/../python: not found. >> $ LD_PRELOAD `which python` >> sh: LD_PRELOAD: not found. >> >> >> Regards, >> Wah Meng >> >> -----Original Message----- >> From: inkblotter [mailto:ink...@gm...] >> Sent: Tuesday, September 20, 2011 5:10 AM >> To: cx-...@li... >> Subject: Re: [cx-oracle-users] cx_Oracle on HP-UX 11.31 ia64 built with aCC successfully but failed to load >> >> >> file /home/r32813/Build/2.7.1/Python-2.7.1/Lib/cx_Oracle.so >> ldd /home/r32813/Build/2.7.1/Python-2.7.1/Lib/cx_Oracle.so >> chatr /home/r32813/Build/2.7.1/Python-2.7.1/Lib/cx_Oracle.so >> >> On Itaium you may need to invoke python as LD_PRELOAD<path to python> and at the python prompt "import cx_Oracle" >> >> If that fails >> try LD_PRELOAD $ORACLE_HOME/lib/libclntsh.so<path to python> and at the python prompt 'import cx_Oracle' >> >> >> On 09/19/2011 01:25 AM, Wong Wah Meng-R32813 wrote: >> >>> Hello there, >>> >>> I have tried to build cx_Oracle on the platform specified in the subject of this email. >>> >>> My python is built with 64-bit option, using aCC. The cx_Oracle can be built. However, when I import that module, it just cannot load and it did not give any explicit indication what goes wrong. Does anyone know why? >>> >>> >>> Regards, >>> >>> Wah Meng >>> >>> $ which python >>> /home/r32813/Build/2.7.1/Python-2.7.1/Lib/../python >>> $ python setup.py build >>> running build >>> running build_ext >>> building 'cx_Oracle' extension >>> creating build >>> creating build/temp.hp-ux-B.11.31-ia64-2.7-11g >>> cc +DD64 -Olimit 1500 -g -DNDEBUG -O +z -I/opt/oracle/product/11.1.0/rdbms/demo -I/opt/oracle/product/11.1.0/rdbms/public -I/home/r32813/Build/2.7.1/Python-2.7.1/Include -I/home/r32813/Build/2.7.1/Python-2.7.1/Lib/.. -c cx_Oracle.c -o build/temp.hp-ux-B.11.31-ia64-2.7-11g/cx_Oracle.o -DBUILD_VERSION=5.0 >>> cc: warning 1913: `1500' does not exist or cannot be read >>> "Connection.c", line 1016: warning #4232-D: conversion from "ub4 *" to a more >>> strictly aligned type "void **" may cause misaligned access >>> (dvoid**)&cacheSize, 0, OCI_ATTR_STMTCACHESIZE, >>> ^ >>> >>> creating build/lib.hp-ux-B.11.31-ia64-2.7-11g >>> ld -b build/temp.hp-ux-B.11.31-ia64-2.7-11g/cx_Oracle.o -L/opt/oracle/product/11.1.0/lib -L/opt/oracle/product/11.1.0 -lclntsh -o build/lib.hp-ux-B.11.31-ia64-2.7-11g/cx_Oracle.so >>> $ cp build/lib.hp-ux-B.11.31-ia64-2.7-11g/cx_Oracle.so $PYTHONPATH >>> $ env | grep PYTHON >>> PYTHONPATH=/home/r32813/Build/2.7.1/Python-2.7.1/Lib >>> $ python >>> Python 2.7.1 (r271:86832, Sep 19 2011, 14:12:09) [C] on hp-ux11 >>> Type "help", "copyright", "credits" or "license" for more information. >>> >>> >>>>>> import cx_Oracle >>>>>> >>>>>> >>> Traceback (most recent call last): >>> File "<stdin>", line 1, in<module> >>> ImportError: Failed to load /home/r32813/Build/2.7.1/Python-2.7.1/Lib/cx_Oracle.so >>> >>> >>>>>> >>>>>> >>> # swlist -l product | grep Compiler >>> >>> ACXX C.06.26.EVAL HP C/aC++ Compiler >>> C-ANSI-C C.06.26.EVAL HP C/aC++ Compiler >>> COMPLIBS B.11.31 Compiler Support Libraries >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA >>> Learn about the latest advances in developing for the >>> BlackBerry® mobile platform with sessions, labs& more. >>> See new tools and technologies. Register for BlackBerry® DevCon today! >>> http://p.sf.net/sfu/rim-devcon-copy1 >>> _______________________________________________ >>> cx-oracle-users mailing list >>> cx-...@li... >>> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >>> >>> >>> >> >> ------------------------------------------------------------------------------ >> All the data continuously generated in your IT infrastructure contains a >> definitive record of customers, application performance, security >> threats, fraudulent activity and more. Splunk takes this data and makes >> sense of it. Business sense. IT sense. Common sense. >> http://p.sf.net/sfu/splunk-d2dcopy1 >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> >> >> >> ------------------------------------------------------------------------------ >> All the data continuously generated in your IT infrastructure contains a >> definitive record of customers, application performance, security >> threats, fraudulent activity and more. Splunk takes this data and makes >> sense of it. Business sense. IT sense. Common sense. >> http://p.sf.net/sfu/splunk-d2dcopy1 >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> >> > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2dcopy2 > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |