Add path to installed libraries to ffi.py #460
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By default,
libfive/bin/python/ffi.py
searches for thelibfive
andlibfive-stdlib
libraries in the relative paths.
andlibfive
; as a consequence,from libfive import stdlib
fails if the script is not run in the build directory.Cmake installs the libraries to
${CMAKE_INSTALL_PREFIX}/lib
. I added that path to thepaths
variable inffi.py
, using the cmakeconfigure_file
function to replace the${CMAKE_INSTALL_PREFIX}
variable with the correct path. As a consequence,ffi.py
is now copied into the build directory by cmake, rather than deferring to make. I don't know if that approach is acceptable here. Additionally, I've only been able to test this on linux (Ubuntu 20.04), so I put the changes toffi.py
behind a system check.This change means, after running
make install
, the python bindings can be used from anywhere on the system.