Commit Graph

43 Commits

Author SHA1 Message Date
Martin Braun
736fd1b85c cmake: Remove some Boost dependencies
With the most recent changes, Boost.Thread and all Boost date/time
libraries are no longer required. This updates the CMake and Debian
files to reflect those changes.
2026-06-15 09:50:16 +02:00
Martin Braun
0ca6dd7f56 mpm: Bump C++ version to 20
This matches the UHD version and allows using advanced C++ constructs in
MPM also.
2025-10-15 11:34:59 +02:00
Martin Braun
ec8dcf8ce2 mpm: cmake: Use GNUInstallDirs
Like with UHD, we switch to using GNUInstallDirs instead of
hand-crafting the equivalent code.
2025-04-30 15:56:11 +02:00
Martin Braun
d665ba24c7 Revert "mpm: cmake: Fix Boost components"
This reverts commit 5ccaa959ac.

The USRP E320 exhibits linker issues with this change.
2025-02-17 20:36:55 -06:00
Martin Braun
5ccaa959ac mpm: cmake: Fix Boost components
MPM only depends on header-only components, so we can simplify the Boost
inclusion. There is no Boost linkage required.
2025-02-13 22:27:28 +01:00
Martin Braun
a68838b42b mpm: cmake: Declare minimum CMake as 3.12
This aligns with the minimum version used for UHD, and allows us to make
use of the same CMake features in MPM as compared to UHD.
2025-02-11 08:08:17 +01:00
Martin Braun
e2dc8128a7 cmake: Require NumPy component in FindPython3
In UHDPython.cmake, when calling find_package(Python3), we now add the
NumPy component. However, because this component was added in CMake 3.14,
and our minimum version is 3.12, we do this conditionally. For older
CMake versions, we rely on UHD_PYTHON_CHECK_MODULE_VERSION() to detect
numpy, which can fail to properly find the include headers in some
corner cases.
2025-01-31 10:19:30 +01:00
Martin Braun
38b89ae965 cmake: Make UHDPython.cmake available to OOTs
This installs UHDPython.cmake to lib/uhd/, so that OOT RFNoC modules can
use it (and don't have to use a version that ships with the OOT). This
makes maintanance of that file a lot easier.

Now that this file can (and should) be used outside of UHD, we
"namespace" the macros and functions by prefacing them with 'UHD_'
(e.g., there's now UHD_PYTHON_CHECK_MODULE).

This file requires creating UHDMinDepVersions.cmake, which also gets
installed.
2024-09-02 08:22:58 +02:00
Aaron Rossetto
6d746fd296 cmake: Replace distutils with CMake for version checks
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).
2022-01-14 14:36:39 -06:00
Martin Braun
09d94529e5 cmake: Replace CMAKE_{SOURCE,BINARY}_DIR with UHD_*_DIR
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.
2021-09-10 15:08:10 -05:00
Lars Amsel
2a575bf9b5 uhd: Add support for the USRP X410
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Michael Auchter <michael.auchter@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Paul Butler <paul.butler@ni.com>
Co-authored-by: Cristina Fuentes <cristina.fuentes-curiel@ni.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Lane Kolbly <lane.kolbly@ni.com>
Co-authored-by: Max Köhler <max.koehler@ni.com>
Co-authored-by: Andrew Lynch <andrew.lynch@ni.com>
Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com>
Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
Co-authored-by: Thomas Vogel <thomas.vogel@ni.com>
2021-06-10 12:01:53 -05:00
Toni Jones
902f458137 cmake: Add RegMaps build component to MPM
Add RegMaps build component to MPM. The PYTHON_CHECK_MODULE is
included from UHDPython in order to look up the presence of Mako.
Mako is required for generating the regmaps and RegMap will be
disabled without it. The RegMaps component creates custom commands for
generating all regmaps, creates a Python submodule "ic_reg_maps" with a
custom __init__.py file, and creates a target "ic_reg_maps" which gets
installed with usrp_mpm.
2021-03-01 15:57:01 -06:00
Samuel O'Brien
6394a7c6ea sim: Lay Groundwork for Simulator
At this point, only about half of the mpm methods work on the simulator
    over the mpm shell, and it hasn't been tested with uhd at all.
    If you want to give it a try, first install all of the python
    dependencies of mpm (The simulator doesn't require libusrp or any of
    the C++ deps). In addition, running mpm on a desktop machine requires
    the python lib netifaces. Next, make an /mpm/build directory and open
    it. Run `cmake .. -DMPM_DEVICE=sim`, then `make`. Finally, run
    `python3 python/usrp_hwd.py`. You should be able to open another
    terminal and run `mpm/tools/mpm_shell.py localhost` to connect to the
    mpm server.

Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
2020-10-07 15:29:19 -05:00
Joerg Hofrichter
2bc89c8f1d mpm: cmake: use UHDPython module to find Python
Use UHDPython module (from UHD) to find Python interpreter,
libraries and include directories.
2020-08-04 07:38:40 -05:00
Joerg Hofrichter
c0a6bb1720 mpm: cmake: added date_time as required boost component
this fixes the error of a missing symbol
_ZNK5boost9gregorian10greg_month15as_short_stringEv
in /usr/lib/libusrp-periphs.so.4 when building
with Boost 1.71
2020-02-10 10:19:26 -06:00
Joerg Hofrichter
84bb89878c mpm: cmake: adopt default enable values of modules
The cmake script (macro MPM_REGISTER_COMPONENT) has an issue that the default
value is ignored which will be fixed in the following commit.

As a result of this issue, the modules Mykonos, Magnesium, E320 and E300 never
got enabled per default. It was always necessary to use an override
like ENABLE_MYKONOS=ON.

Therefore, change the default enable values so that a fix to MPM_REGISTER_COMPONENT
does not change the current behavior.
2020-01-22 12:54:54 -08:00
Sugandha Gupta
178b35569b e310/e320: Move E310 to MPM architecture and refactor
- Turns the E310 into an MPM device (like N3xx, E320)
- Factor out common code between E320 and E310, maximize sharing between
  the two devices
- Remove all pre-MPM E310 code that is no longer needed
- Modify MPM to remove all existing overlays before applying new ones
  (this is necessary to enable idle image mode for E310)

Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
2019-05-01 15:17:23 -07:00
Martin Braun
164d76dcfd mpm: python: Move from Boost.Python to PyBind11 2019-04-02 10:39:57 -07:00
Toni Jones
8b080a8a14 cmake: Add unit testing framework to MPM
Add unit testing framework to MPM which can be run by calling
"make test". The testing is done using the built in unittest Python
module. Tests can be run on a dev machine or on the USRP itself when
compiling natively.
2019-03-26 15:15:05 -07:00
Martin Braun
a12b943b73 mpm: cmake: Clean out top-level CMake file
This file contained a whole lot of copy pasta from during its inception.
Removed all the special cases for Windows, MinGW, and RedHat.
2019-03-21 12:06:26 -07:00
Martin Braun
a69ab0c23a cmake: Update coding style to use lowercase commands
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!)
2018-11-14 14:10:09 -08:00
Brent Stapleton
300a5e3f6e mpm: initial commit of E320 code
Co-authored-by: Sugandha Gupta <sugandha.gupta@ettus.com>
2018-07-18 15:37:27 -07:00
Martin Braun
5316636fb9 mpm: Set C++ standard to C++14 2018-04-30 10:49:53 -07:00
Alex Williams
7dcd16f5a6 mpm: Use configurable components for build system
For a minimal build, default to off for components unless the MPM_DEVICE
or the user requests it specifically.
2018-04-18 15:34:51 -07:00
Brent Stapleton
e733e590c4 mpm: Validate MPM_DEVICE in CMake 2018-04-18 15:26:30 -07:00
Trung Tran
3ccd06f6ba mpm: update cmake to find the correct python3
We need to set it before including UHDPython.cmake where PythonInterp is set without
version requirement.

Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-04-17 09:24:35 -07:00
Martin Braun
a5b87ab7c4 mpm: cmake: Add git hash and version info to Python module
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-04-02 15:27:05 -07:00
Martin Braun
94fcb32310 mpm: cmake: Make default install path /usr 2018-03-05 15:56:41 -08:00
Martin Braun
725debb964 mpm: Rename n310 to n3xx
This module (and class) are, in fact, used for all N3xx-derivates so
renaming it is the more correct thing to do.
2018-03-05 15:56:41 -08:00
Martin Braun
8997654efb mpm: cmake: Disable Python 2
Removing Python 2 makes repo management for MPM a lot easier, and it's
2018 after all.
2018-01-04 15:41:07 -08:00
Moritz Fischer
46fd417253 mpm: systemd: Add a systemd service file for MPM
Add a service file to start MPM on bootup via systemd.

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-01-04 15:01:41 -08:00
Martin Braun
8815098747 mpm: Harmonize all license header
Now uses SPDX headers everywhere.
2017-12-22 15:05:58 -08:00
Mark Meserve
b7b4718b31 mpm: fix cmake on windows targets 2017-12-22 15:03:59 -08:00
Martin Braun
cd533c8080 mpm/cmake: Remove invalid additional Python versions 2017-12-22 15:03:58 -08:00
Martin Braun
34c2fa0bee mpm: Cleaned up CMake, made Python version an option 2017-12-22 15:03:58 -08:00
Martin Braun
d16d342be2 mpm: Made CMake more future-proof w.r.t. newer Boost and Python 2017-12-22 15:03:58 -08:00
Moritz Fischer
8b111dd123 mpm: libusrp-periphs: Add SOVERSION and VERSION
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2017-12-22 15:03:53 -08:00
Moritz Fischer
dfb1b95686 mpm: Fix missing library install
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2017-12-22 15:03:53 -08:00
Martin Braun
151ba5fb06 mpm: Major refactoring
- Created clean interfaces for SPI and registers
- Severed most links to UHD
- Added a lockable class which allows exposing mutexes into Python
2017-12-22 15:03:52 -08:00
Andrej Rode
8ac9014d5c mpm: CMake cleanup, Python code enhancements
- Send user defined data in ping
- Improve rpc_shell, add mpm_debug.py, fix tracebacks in multiprocessing
2017-12-22 15:03:44 -08:00
Andrej Rode
ef6326a174 mpm: python refactoring 2017-12-22 15:03:44 -08:00
Andrej Rode
1b4af85e10 mpm: cleanup CMakeLists, fixup minor bugs 2017-12-22 15:03:44 -08:00
Martin Braun
1a4348038d Initial commit for N3xx development.
- Creates mpm/ subdirectory
- First pass at hardware daemon/MPM
- New code for LMK04828, AD9371
- spidev integration

Contributions by:

Martin Braun <martin.braun@ettus.com>
Derek Kozel <derek.kozel@ettus.com>
Mark Meserve <mark.meserve@ni.com>
Andrej Rode <andrej.rode@ettus.com>
2017-12-22 15:03:44 -08:00