[lldb-dev] Where is the Python Shared Library put on Linux?

Charles Davis cdavis at mymail.mines.edu
Thu Jun 16 13:40:42 PDT 2011

On 6/16/11 2:18 PM, Caroline Tice wrote:
> I don't have a Linux box available so I can't check this directly;  I'm hoping one of the Linux developers on this list can help me:
> When you build LLDB, there's a Python component (runs SWIG, generates a C++ file and a .py file and finally gets compiled into
> a Python shared library object).  Where, on a Linux system, do the SWIG-generated .py file and the Python shared library 
> object get put? I.e. If I want to run Python, from Linux, and tell it where to look for the lldb Python module, where should I tell it
> to look?  Thanks in advance!
According to source/Interpreter/Makefile...

PYTHON_DEST_DIR := $(shell python -c 'import sys; print
sys.exec_prefix')/lib/python$(shell python -c 'import sys; print

Here it is in pure Python:

import sys

def python_dest_dir():
  return sys.exec_prefix+"/lib/python"+sys.version[:3]+"/site-packages";

On a typical Linux system, for example, this would return
"/usr/lib/python2.7/site-packages" (assuming the user had installed
Python 2.7 from the distro's packages).

The symlink to the shared library that lldb.py needs (_lldb.so) gets
installed to $(PYTHON_DEST_DIR)/lib-dynload.

I would know, because I wrote the Makefile logic that installs the
Python module.


More information about the lldb-dev mailing list