-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
cmake: reliably determine python prefix #5148
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works good. Tested with a custom prefix /opt/gnuradio-3.10.0git/
. Python install directory is now /opt/gnuradio-3.10.0git/lib/python3.9/site-packages
, which matches UHD.
- distro: 'CentOS 8.3' | ||
containerid: 'gnuradio/ci:centos-8.3-3.9' | ||
cxxflags: '' | ||
ctest_args: '-E "qa_agc|qa_cpp_py_binding|qa_cpp_py_binding_set|qa_ctrlport_probes|qa_qtgui"' | ||
ldpath: /usr/local/lib64/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it become necessary to specify ldpath as part of the qa step here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because Fedora and CentOS by default do not have /usr/local/lib64
in their search path: https://unix.stackexchange.com/questions/356624/why-isnt-usr-local-lib-on-the-library-path-by-default/357867#357867
There are of course other options how to make ld aware of this directoy, I simply did it this way to point out that it is a Fedora/CentOS specific thing. It could also be added to the docker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about setting PYTHONPATH (and LD_LIBRARY_PATH if needed) in the environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also an option if that is preferred
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I was only thinking about LD_LIBRARY_PATH
in the answer above. Why would you want to modify PYTHONPATH
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the best approach that will satisfy most users by ensuring the modules install to the right place in the path when the prefix is known and defaulting to where Python thinks they should go otherwise. I don't think it changes anything for packagers, and I'd guess almost all of them are already setting GR_PYTHON_DIR
anyway.
This looks great - the logic of where to put things seems very sane. @schneider42 - when you get a chance can you rebase and squash? |
Signed-off-by: schneider <schneider@blinkenlichts.net>
Installs GNURadio into the container and checks if Python can find, import and use the gnuradio package. Signed-off-by: schneider <schneider@blinkenlichts.net>
3e7435a
to
1eb2173
Compare
@mormj rebased and squashed into two different commits |
Based on #5131
This shows where I would like to go with the changes proposed in #5121. It allows to get rid of having to manipulate
$PYTHONPATH
on Debian/Ubuntu machines after installing GNURadio from source (see 3e7435a)