Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python CMakeLists incorrectly determines PYTHON_LIB_DIR #168

Closed
tallpgr opened this issue Dec 10, 2019 · 0 comments · Fixed by #169
Closed

Python CMakeLists incorrectly determines PYTHON_LIB_DIR #168

tallpgr opened this issue Dec 10, 2019 · 0 comments · Fixed by #169

Comments

@tallpgr
Copy link
Contributor

tallpgr commented Dec 10, 2019

The current Python/CMakeLists.txt is responsible for setting the destination directory of the shared python library PyHSPlasma.so. It currently does so by executing a Python code snippet obtaining the value of distutils.sysconfig.get_python_lib().

Unfortunately it does so with a call to that routine with no arguments, which sets PYTHON_LIB_DIR to the installation directory of the currently running Python interpreter.

While that may be appropriate for building/installing as a manner of installing HSPlasma for the machine performing the build, it becomes inappropriate when HSPlasma is being built in a build environment such as Jenkins, where the Jenkins build process attempts to do a make install with CMAKE_INSTALL_PREFIX set to a non-live destination. If the build is performed (as it should be) in Jenkins under a non-privileged user, the make install operation will attempt to install PyHSPlasma.so into the working Python library directories, and fail because of privileges. As it should. If for no other reason than that make install ignored CMAKE_INSTALL_PREFIX.

I am suggesting for the NOT WIN32 situation to alter your snippet to use

get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}')

instead of the base get_python_lib() call. This will properly pick up the destination for the Python library in an isolated build environment.

-rarified

tallpgr added a commit to tallpgr/libhsplasma that referenced this issue Dec 10, 2019
…mines PYTHON_LIB_DIR

Allow ${CMAKE_INSTALL_PREFIX} to override Python's installation prefix
when determining where to place PyHSPlasma.so library for Python.
@zrax zrax closed this as completed in #169 Dec 11, 2019
zrax added a commit that referenced this issue Dec 11, 2019
Suggested fix for issue #168 Python CMakeLists incorrectly determines…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant