| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
This allows a UHD build to link to python modules installed in a virtual
environment such a venv or pyenv.
Signed-off-by: mattprost <matt.prost@ni.com>
|
|
|
|
|
|
|
|
| |
The original commit incorrectly fails the build
uhd in the meta-ettus context. This uses prefix
instead to get the base path.
Signed-off-by: Steven Koo <steven.koo@ni.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit replaces uses of distutils.sysconfig's get_python_lib()
function with sysconfig's near-equivalent get_path() function to get the
directory for site-specific, platform-specific files. Unfortunately,
get_path() does not have a way to easily modify or strip the prefix
applied to the path like get_python_lib() does, so the code must
manually modify the path to get the same effect:
- First, the platlib path is retrieved from the get_path() call.
- Next, the default base that is used to form the pathlib path is
queried via the get_config_var('base') call.
- Next, the portion of the platlib path that matches the default base is
stripped, and any leading path separator remaining is stripped. This
fundamentally replicates the behavior of get_python_lib() with an empty
prefix (i.e., the prefix positional parameter is specified as '').
- If a different prefix is desired, then the os.path.join() function is
used to combine the new prefix with the stripped pathlib path, ensuring
that the platform-specific path separator is used in crafting the path.
|
|
|
|
|
|
|
| |
This commit replaces the use of distutils.version.LooseVersion() with
CMake's version comparison operator, which implements relational version
string checking in the same manner (i.e., comparing numeric components
of a version string numerically).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See the CMake 3.8 documentation on these two variables:
https://cmake.org/cmake/help/v3.8/variable/PROJECT-NAME_SOURCE_DIR.html
https://cmake.org/cmake/help/v3.8/variable/CMAKE_SOURCE_DIR.html
Under normal circumstances, these two are identical. For sub-projects
(i.e., when building UHD as part of something else that is also a CMake
project), only the former is useful. There is no discernible downside of
using UHD_SOURCE_DIR over CMAKE_SOURCE_DIR.
This was changed using sed:
$ sed -i "s/CMAKE_SOURCE_DIR/UHD_SOURCE_DIR/g" \
`ag -l CMAKE_SOURCE_DIR **/{CMakeLists.txt,*.cmake}`
$ sed -i "s/CMAKE_BINARY_DIR/UHD_BINARY_DIR/g" \
`ag -l CMAKE_BINARY_DIR **/{CMakeLists.txt,*.cmake}`
At the same time, we also replace the CMake variable UHD_HOST_ROOT (used
in MPM) with UHD_SOURCE_DIR. There's no reason to have two variables
with the same meaning and different names, but more importantly, this
means that UHD_SOURCE_DIR is defined even in those cases where MPM calls
into CMake files from UHD without any additional patches.
Shoutout to GitHub user marcobergamin for bringing this up.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This a mapping of uhd::device::find() into uhd.find() on the Python
side. The uhd::device is intentionally not mapped into Python (prefer
MultiUSRP or RfnocGraph instead), so the namespace is moved up one
level.
Example:
>>> import uhd
>>> # Now print the device args for all found B200s:
>>> for dev_args in uhd.find("type=b200")): print(dev_args.to_string())
|
|
|
|
|
|
|
| |
Example:
>>> usrp = uhd.usrp.multi_usrp("")
>>> tree = usrp.get_tree()
>>> print(tree.access_int("/name").get())
|
|
|
|
|
| |
This helps with recompilation times of UHD.
No functional changes.
|
|
|
|
|
|
|
| |
When ENABLE_SIM and ENABLE_PYTHON_API are set, this commit embeds MPM
(Built with -DMPM_DEVICE=sim) into the pyuhd package.
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
|
| |
|
|
|
|
|
|
|
| |
This changes two things in all applicable files:
- Remove imports from __future__
- Change default shebangs from /usr/bin/env python to /usr/bin/env
python3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On UNIX systems, CMake will set the RPATH of the Python library to the
build directory, which is very helpful because it allows unit and other
tests to be executed from within the build directory.
On installation, the RPATH is removed, but only if install(TARGETS) is
used, which we were not, thus resulting in incorrect RPATHs.
This would surface as a bug, too. Calling uhd.get_lib_path() would
always point to the build directory, thus resulting in no FPGA images
being found automatically, e.g. when running a B200 through the Python
API.
This change installs the Python .so file separately, using the correct
CMake mechanisms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the host/python/uhd subdirectory, which will add all files
that go into the actual Python module once installed. Before, all Python
files were directly in host/python and got sorted into their appropriate
destination folders during configuration and installation.
This change doesn't change anything (Python modules will look the same
as they do now), except that it makes the source tree a tad neater, but
more importantly, it creates a consistent directory structure when
adding submodules to the uhd module. Apart from the PyBind11-generated
shared object file (which gets generated during build time), the uhd/
subdirectory in host/python exactly resembles the Python module once
installed, so it's more obvious where to add new submodules and files.
|
|
|
|
|
|
|
|
|
| |
This adds the python implementation, major and minor version numbers,
and any additional flags (debug, pymalloc, wide unicode) to the
extension module suffix as specified in PEP 3149.
Hat tip to @isuruf:
https://github.com/conda-forge/staged-recipes/pull/10076#discussion_r348721448
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a segmentation fault when trying to use the python module on
OSX when built with conda (unsure why it doesn't arise otherwise).
Instead of linking against the python library, it is proper to not link
against the library and, for OSX builds, add linker options for
"-undefined" and "dynamic_lookup". This is precisely what the CMake
FindPython module does for linking against the Python::Module target.
See https://blog.tim-smith.us/2015/09/python-extension-modules-os-x
and https://bugs.python.org/issue36721
|
|
|
|
|
|
| |
Instead of renaming the library file, this sets the suffix in CMake so
that the filename turns out as desired and also linker references know
the correct name.
|
|
|
|
|
|
|
|
| |
Adding Python bindings for the RFNoC API. This includes the
rfnoc_graph, noc_block_base, and several other supporting classes.
Templated functions are not currently supported. For example,
`rfnoc_graph::get_block` can only return the basic block controller.
|
|
|
|
|
|
| |
- Makes use of more modern find_package(Python2/3) if available
- Moves almost all Python-related code to UHDPython.cmake
- ENABLE_PYTHON3 is no longer necessary
|
| |
|
|
|
|
|
|
|
| |
Changing the CMake variable used in determining the extension of the
Python API library for better cross-platform support.
Specifically, `CMAKE_SHARED_MODULE_SUFFIX` corresponds to .so for *nix
and MacOS, which is the extension Python expects.
|
|
|
|
|
|
|
| |
setuptools isn't compatible with Unix style path on Windows 10
machines. We need to convert any path before running setuptools.
Signed-off-by: Trung Tran <trung.tran@ettus.com>
|
|
|
|
|
|
| |
This does not change the Python API itself, but it is still
a significant change. Most importantly, it removes the dependency on
Boost.Python.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also updates our coding style file.
Ancient CMake versions required upper-case commands. Later command
names became case-insensitive. Now the preferred style is lower-case.
Run the following shell code (with GNU compliant sed):
cmake --help-command-list | grep -v "cmake version" | while read c; do
echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done > convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \
'*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed
(Make sure the backslashes don't get mangled!)
|
|
|
|
|
|
| |
With Boost 1.64 to 1.65 (which, of course, Ubuntu LTS ships), the
`PyInit_Libraryname` are invisible when one sets the default visibility
to "hidden" (which is reasonable, and which we do).
|
|
|
|
| |
To support python api installer
|
|
|
|
|
|
|
|
|
|
| |
The Python API should now be installed to
`PREFIX/lib/pythonVER/dist-packages/uhd`
where the PREFIX is set by CMake and the Python version is determined
by the Python module `distutils`. This should match user expectations
much more than the previous behavior.
Behavior in Virtualenvs is unchanged.
|
| |
|
|
|
|
|
|
|
|
|
| |
- Separating exposed Python data structures into logical sections
- Exposes all of the multi_usrp API
- Adds a layer of Python for documentation and adding helper methods
- Adds improvements and fixes to the MultiUSRP object
- Includes additional exposed data structures (like time_spec_t, etc.)
- Add code to release the Python GIL during long C++ calls
|
|
Initial commit of the Python API using Boost.Python. Bind the
MultiUSRP API for use in Python. Bindings intended to provide as
complete coverage as possible.
- Wrap most multi_usrp calls
- Adding multi channel send/recv examples in examples/python
- Adding setuptools support
- Initial attempt at binding the UHD types and filters
|