Ubuntu 10.04 64bit Error
Hi, I am getting the following error when I try to call pymqi.
ImportError: libmqic_r.so: wrong ELF class: ELFCLASS32
this is on a 64bit ubuntu 10.04 machine. Python is looking for libmqic_r.so in the /opt/mqm/lib instead of /opt/mqm/lib64. I don't know how to get it to look into lib64 and not the lib directory.
Any and all help will be greatly appreciated.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- PyMQI Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Alberto
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Hi Alberto,
first thing is, how did you install PyMQI? Using pip? Downloaded the package and installed it manually? If the latter, which package was it exactly? What's its name?
Here's how the installation process looks like on a Ubuntu 10.04 box of mine. Note that uname tells me it's a 64bit system, the installer says "Building PyMQI client 64bits" and gcc is then linking to /opt/mqm/lib64. I'd be curious to see the log from your end.
Note that if you already have PyMQI installed you need to hand delete it by removing the following files and directories (obviously, substitute /usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
$ uname -m
x86_64
$
$ sudo pip install pymqi
Downloading/
Downloading pymqi-1.1.tar.gz (54Kb): 54Kb downloaded
Running setup.py egg_info for package pymqi
Building PyMQI client 64bits
Installing collected packages: pymqi
Running setup.py install for pymqi
Building PyMQI client 64bits
building 'pymqe' extension
gcc -pthread -fno-strict-
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-
changing mode of build/scripts-
changing mode of build/scripts-
changing mode of build/scripts-
changing mode of /usr/local/
changing mode of /usr/local/
changing mode of /usr/local/
Successfully installed pymqi
Cleaning up...
$
import pymqi
import CMQC, CMQCFC, CMQXC
queue_manager = "QM01"
channel = "SVRCONN.1"
host = "192.168.1.126"
port = "1418"
conn_info = "%s(%s)" % (host, port)
qmgr = pymqi.QueueMana
qmgr.connectTCP
pcf = pymqi.PCFExecut
pcf.MQCMD_
qmgr.disconnect()
Revision history for this message
|
#2 |
Hi Alberto,
first thing is, how did you install PyMQI? Using pip? Downloaded the package and installed it manually? If the latter, which package was it exactly? What's its name?
Here's how the installation process looks like on a Ubuntu 10.04 box of mine. Note that uname tells me it's a 64bit system, the installer says "Building PyMQI client 64bits" and gcc is then linking to /opt/mqm/lib64. I'd be curious to see the log from your end.
Note that if you already have PyMQI installed you need to hand delete it by removing the following files and directories (obviously, substitute /usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
/usr/local/
$ uname -m
x86_64
$
$ sudo pip install pymqi
Downloading/
Downloading pymqi-1.1.tar.gz (54Kb): 54Kb downloaded
Running setup.py egg_info for package pymqi
Building PyMQI client 64bits
Installing collected packages: pymqi
Running setup.py install for pymqi
Building PyMQI client 64bits
building 'pymqe' extension
gcc -pthread -fno-strict-
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-
changing mode of build/scripts-
changing mode of build/scripts-
changing mode of build/scripts-
changing mode of /usr/local/
changing mode of /usr/local/
changing mode of /usr/local/
Successfully installed pymqi
Cleaning up...
$
import pymqi
import CMQC, CMQCFC, CMQXC
queue_manager = "QM01"
channel = "SVRCONN.1"
host = "192.168.1.126"
port = "1418"
conn_info = "%s(%s)" % (host, port)
qmgr = pymqi.QueueMana
qmgr.connectTCP
pcf = pymqi.PCFExecut
pcf.MQCMD_
qmgr.disconnect()
Revision history for this message
|
#3 |
Dariusz,
I used the package from launchpad (tar.gz) 1.1
Here is the log:
# python setup.py install
Building PyMQI client 64bits
running install
running build
running build_py
creating build
creating build/lib.
copying pymqi.py -> build/lib.
copying CMQC.py -> build/lib.
copying CMQCFC.py -> build/lib.
copying CMQXC.py -> build/lib.
running build_ext
building 'pymqe' extension
creating build/temp.
gcc -pthread -fno-strict-
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-
running build_scripts
creating build/scripts-2.6
copying and adjusting scripts/mqmess.py -> build/scripts-2.6
copying and adjusting scripts/browse.py -> build/scripts-2.6
copying and adjusting scripts/inq.py -> build/scripts-2.6
changing mode of build/scripts-
changing mode of build/scripts-
changing mode of build/scripts-
running install_lib
creating /usr/local/
copying build/lib.
copying build/lib.
copying build/lib.
copying build/lib.
copying build/lib.
byte-compiling /usr/local/
byte-compiling /usr/local/
byte-compiling /usr/local/
byte-compiling /usr/local/
running install_scripts
copying build/scripts-
copying build/scripts-
copying build/scripts-
changing mode of /usr/local/
changing mode of /usr/local/
changing mode of /usr/local/
running install_egg_info
Writing /usr/local/
Thank you for your help.
Revision history for this message
|
#4 |
Hm hm hm.. frankly, I have no idea why it would happen, I've never seen it on any of my 64 bit systems so it seems unlikely it has anything to do with PyMQI. Sorry for asking the obvious, but are you 200% sure it's a 64bit MQ installation? What was the MQ package name?
Revision history for this message
|
#5 |
I don't know either. One workaround was to copy libmqic_r.so to the /lib directory. This works but it bothers me that I had to do this. I am almost positive that the rpm that I used is MQSeriesServer-
I really don't want to re-install MQ. My uname -m command result is: x86_64.
This is just my developing machine. After I am done with building the program I am working on, I will test it on our production server which is also running Ubuntu 10.04 x64 and see what happens...
Since MQ is not officially supported on Ubuntu, how did you install it in yours?
Thank you for your help.
Revision history for this message
|
#6 |
I've just found http://
> I will test it on our production server which is also running Ubuntu 10.04 x64 and see what happens...
OK, just take the note of what MQ package it is then. I can't be certain of course but it really sounds like you have a 64 bit system and a 32 bit MQ. In which case the LD_LIBRARY_PATH workaround won't work around anything. And if it doesn't, that will in fact prove that MQ is 32 but and you have no choice but to reinstall MQ - PyMQI doesn't support that configuration, I simply have no environment to test it on.
> Since MQ is not officially supported on Ubuntu, how did you install it in yours?
Well, I've just followed my own blog post :-) http://
Revision history for this message
|
#7 |
I've just fixed the problem on my system by adding the path /opt/mqm/lib64 to a file. I named the file mqlib64.conf and put it in the /etc/ld.so.conf.d directory. Afterwards, ran sudo ldconfig. All is well now. Setting the LD_LIBRARY_PATH also worked but its not the recommended way according to some experts.
Again, Thank you for all your help.