3

I'm trying to install python-pin. This tool uses Pin (an Intel instrumentation tool) which is 32bit. When I try to run python-pin, I get:

E: Unable to load /home/censored/Documents/tools/Python_Pin/obj-intel64/Python_Pin.so: dlopen failed: library "libpython2.7.so.1.0" not found

I do have libpython2.7.so.1.0, located at:

/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0

But it's in 64 bit while the library requiring it is 32 bit. After doing a fair bit of research, I've found these questions that were similar to mine:

How can I install a 32bit python on 64 bit Ubuntu

This one is for Ubuntu 10.10 and the solution doesn't appear to work for me.

These one were more general:

How do you run a 32-bit program on a 64-bit version of Ubuntu?

How to run 32-bit app in Ubuntu 64-bit?

After having read these, I installed the 32bit version of python-dev with:

$ sudo apt-get install python-dev:i386

The installation was successful, but I can't find the 32bit version of libpython2.7.so.1.0 anywhere and I'm still not able to launch python-pin.

EDIT:

I've manually compiled 32bit python this way:

$ CC="gcc -m32" LDFLAGS="-L/lib32 -L/usr/lib32 \
-Lpwd/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" ./configure --prefix=/opt/pym32 --enable-shared
$ make
$ sudo make install

And now I finally have a 32bit libpython2.7.so.1.0 file in my Python folder. Still, when I do:

$ LD_PRELOAD=/home/censored/Documents/tools/Python-2.7.13/libpython2.7.so.1.0 bin/python-pin Python_Pin/examples/ins_count.py /bin/ls

I get these errors:

ERROR: ld.so: object '/home/censored/Documents/tools/Python-2.7.13/libpython2.7.so.1.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

0 Answers0