Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for installing python as a non-system package
Debian's python, unlike stock python, expects system packages to be installed in `/usr/local/lib/python3.X/dist-packages/` and not `/usr/local/lib/python3.X/site-packages/`. As such debian's python setuptools has a flag `--install-layout deb` which places library files in the correct place. `src/python/CMakeLists.txt` checks if the system is debian and adds this flag. However, if you're trying to use BCC with a non-system version of python (for example miniconda) the different package layout (and setuptools flag) aren't there. Also, libraries aren't expected to be placed in /usr, but whatever prefix the alternative python install is using. This PR adds two flags to the CMAke build: * PY_SKIP_DEB_LAYOUT - which skips adding the `--install-layout deb` flag to the python install command * PYTHON_PREFIX which (if set) takes the place of CMAKE_INSTALL_PREFIX as a target for installing python packages Both are needed to allow installing python bindings into python installs that aren't the system install on debian hosts. For example, for a miniconda install on ubuntu: With this PR, I can get a working install with miniconda on ubuntu 22 using: ``` cmake .. -DPY_SKIP_DEB_LAYOUT=true -DPYTHON_PREFIX=/home/vagrant/miniconda3/envs/ddpy3/ ```
- Loading branch information