LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-10-2011, 09:45 AM   #1
veerals123
LQ Newbie
 
Registered: May 2011
Posts: 2

Rep: Reputation: 0
Importing 32 bit swig library from python2.4 on 64 bit machine


Hi,
I am using swig framework to invoke certain C APIs in a C Library from a python program. Unfortunately the python software needs to run on a 64 bit virtualization platform, whereas the C library is 32 bit (its a 3rd party library whose 64 bit version is not available). Lets say the name of the swig generated shared library is _my_swig.so. When the python wrapper makes "import _my_swig" call, i see the following error
ImportError: -snipsnip-/_my_swig.so: wrong ELF class: ELFCLASS32

which probably means I am trying to import a 32 bit library from 64 bit python. Can anybody suggest any workaround?

thanks
veerals123
 
Old 05-10-2011, 07:00 PM   #2
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Rep: Reputation: 99
Have you tried installing the 64 bit package for python or any other package which is giving such error.

Try downloading the specified RPM from below sites
http://rpm.pbone.net
http://www.rpmlinux.org

On the other hand, if your machine is connected to internet you can use yum to install it.
Which distro are you using ?
 
Old 05-10-2011, 10:57 PM   #3
veerals123
LQ Newbie
 
Registered: May 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Hi Vikas, Thanks for your kind response. I think I didnt understand your comment. I already have a 64 bit python 2.4 running on my OS. My OS is centOS-5(x86_64) based and runs a hypervisor. Problem occurs because the 64 bit python is trying to import a 32 bit .so library - needed by swig framework. This results in "wrong ELF class: ELFCLASS32" error. If my library was 64 bit, this problem would not occur. But this 3rd party library doesnt have a 64 bit equivalent. Hence I am looking for suggestions on possible workarounds. Hope this makes sense.

Regards
veerals123
 
Old 05-11-2011, 05:26 AM   #4
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Rep: Reputation: 99
Quote:
Originally Posted by veerals123 View Post
Hi Vikas, Thanks for your kind response. I think I didnt understand your comment. I already have a 64 bit python 2.4 running on my OS. My OS is centOS-5(x86_64) based and runs a hypervisor. Problem occurs because the 64 bit python is trying to import a 32 bit .so library - needed by swig framework. This results in "wrong ELF class: ELFCLASS32" error. If my library was 64 bit, this problem would not occur. But this 3rd party library doesnt have a 64 bit equivalent. Hence I am looking for suggestions on possible workarounds. Hope this makes sense.

Regards
veerals123
Hi Veerals,

Please locate that ".so" file, run below commands on it and paste output here.

Code:
rpm -qf  /path/to/your/so/file
rpm -q --qf '%{ARCH}\n' `rpm -qf  /path/to/your/so/file`
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can we install ubuntu AMD 64 bit on intel 64 bit machine ervaneet82 Linux - General 2 11-11-2010 04:40 PM
[SOLVED] Red Hat Enterprise Desktop 5.3 on 64 bit machine need 32-bit library file hhs1982 Linux - Newbie 4 06-29-2010 11:55 AM
Unable to compile 64 bit kernel on 64 bit machine even after successful compilation. atulsdeshmukh Linux - Kernel 2 09-18-2009 02:28 AM
how do I install 32-bit compiler libraries onto a 64-bit machine? charleycat Linux - Software 1 08-16-2007 01:45 PM
32/64 bit libs - FC6/gcc 4.1.1 -m32 picking up 64 bit library marier Fedora 0 04-24-2007 12:57 PM


All times are GMT -5. The time now is 12:08 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration