1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

oracle, python cx_Oracle for amd64

Discussion in 'Web and Network Services' started by zhuangyan, Jul 10, 2012.

  1. zhuangyan

    zhuangyan New Member

    Messages:
    4
    Thanks Received:
    0
    Code:
    bsd# uname -a
    FreeBSD bsd.localdomain 8.3-RELEASE FreeBSD 8.3-RELEASE #0: Mon Apr  9 21:23:18 UTC 2012     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
    bsd# python
    Python 2.7.2 (default, Jul  9 2012, 13:49:49) 
    [GCC 4.2.2 20070831 prerelease [FreeBSD]] on freebsd8
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import cx_Oracle
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: /usr/lib/libdl.so.2: unsupported file layout
    >>> 
    bsd# ldd /usr/local/lib/python2.7/site-packages/cx_Oracle.so
    /usr/local/lib/python2.7/site-packages/cx_Oracle.so:
    	libclntsh.so.10.1 => /usr/lib/oracle/instantclient10_1/libclntsh.so.10.1 (0x800c00000)
    	libthr.so.3 => /lib/libthr.so.3 (0x801ac1000)
    	libc.so.7 => /lib/libc.so.7 (0x800648000)
    	libnnz10.so => /usr/lib/oracle/instantclient10_1/libnnz10.so (0x801bda000)
    	libdl.so.2 => not found (0x0)
    	libm.so.6 => not found (0x0)
    	libpthread.so.0 => not found (0x0)
    	libnsl.so.1 => not found (0x0)
    	libc.so.6 => not found (0x0)
    	libc.so.6 => not found (0x0)
    
     
  2. zhuangyan

    zhuangyan New Member

    Messages:
    4
    Thanks Received:
    0
    Code:
    bsd# ll /usr/lib/libdl.so.2
    lrwxr-xr-x  1 root  wheel  32 Jul 10 17:54 /usr/lib/libdl.so.2 -> /usr/compat/linux/lib/libdl.so.2
    bsd# ll /usr/compat/linux/lib/libdl.so.2
    lrwxrwxrwx  1 root  wheel  12 Jul 10 14:07 /usr/compat/linux/lib/libdl.so.2 -> libdl-2.9.so
    bsd# ll /usr/compat/linux/lib/libdl-2.9.so 
    -rwxr-xr-x  1 root  wheel  18568 Jul 10 15:49 /usr/compat/linux/lib/libdl-2.9.so
     
  3. zhuangyan

    zhuangyan New Member

    Messages:
    4
    Thanks Received:
    0
    Code:
    bsd# file /usr/local/lib/python2.7/site-packages/cx_Oracle.so
    /usr/local/lib/python2.7/site-packages/cx_Oracle.so: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, not stripped
     
  4. zhuangyan

    zhuangyan New Member

    Messages:
    4
    Thanks Received:
    0
    Code:
    bsd# file /usr/compat/linux/lib/libdl-2.9.so
    /usr/compat/linux/lib/libdl-2.9.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
     
  5. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,628
    Thanks Received:
    2,386
    I don't think it's possible. I have been searching for a solution but I've only seen people try it but never succeeding.
     
    zhuangyan thanks for this.
  6. firass

    firass New Member

    Messages:
    2
    Thanks Received:
    0
    zhuangyan: I have tried to get cx_Oracle working on 64-bit FreeBSD with no luck either.

    The problem I had is that linux_base-f10 is available for amd64, but runs in i386/32 bit mode. This didn't seem all that bad, since the linux-oracle-instantclient-* ports are 32-bit only.

    Then, however, I tried to build cx_Oracle and it fails, because it's trying to build it against a 64-bit version of libclntsh.so, and we installed the 32-bit instantclient.

    I exported the following flag, to tell cx_Oracle to build in 32-bit:
    Code:
    # export CFLAGS=-m32


    But then it complained about not finding 32-bit version of libgcc.a


    Currently, we have cx_Oracle working in 32-bit FreeBSD, so I am going to wait until a 64-bit linux_base package is released before trying again. It seems like a big hassle to have to run oracle instant client, cx_Oracle, python, and whatever else in 32-bit while the rest of your system is 64-bit.