Commit Graph

407 Commits

Author SHA1 Message Date
Martin Braun
170f1133e5 cmake: Remove Boost version hacks from UHDBoost
Our internal helper UHDBoost.cmake includes several hacks for Boost
version compatibility. Now that we require at least Boost 1.71, these
hacks are just clutter and can be removed.
2025-09-24 11:35:07 +02:00
Martin Braun
b181415077 cmake: Bump minimum Boost version to 1.71 2025-09-24 11:35:07 +02:00
Martin Braun
3c6df18579 cmake: Fix Boost settings for static builds
Building static libraries with UHD was broken due to the way that
UHDBoost was structured. The following changes to UHDBoost.cmake were
applied:

- This file no longer observes ENABLE_STATIC_LIBS. That's because in UHD,
  setting ENABLE_STATIC_LIBS is supposed to build both static and shared
  libraries, but the way UHDBoost.cmake was written, it would apply
  settings for static builds to all libraries. If ENABLE_STATIC_LIBS was
  set, then this would cause linker errors.
  - As a consequence, users of UHDBoost.cmake must specify
    Boost_USE_STATIC_LIBS manually before including it.
- BUILD_SHARED_LIBS is no longer modified. UHD always specifies the
  correct library modifier (SHARED, STATIC, etc.) directly in the
  add_library() call, and that is good practice. By overriding
  BUILD_SHARED_LIBS in UHDBoost.cmake, this file can make changes to
  CMake files that call add_library() without a modifier.

In host/lib/CMakeLists.txt, we now call UHDBoost a second time for
static builds but set Boost_USE_STATIC_LIBS beforehand. This allows to
specify linker targets for the static library independently from the
shared library.

We also factored out some common library property manipulations that are
shared between uhd and uhd_static.
2025-09-18 15:38:01 +02:00
Jörg Hofrichter
006d7f7646 debian: align install files to Debian/Ubuntu official (2)
- For Ubuntu/Debian, the package lib dir (PKD_LIB_DIR), is set to
  /usr/libexec/uhd. This is the path where examples, tests and
  utils get installed.
- List usrp_hwd.py explicitly as not installed.
2025-09-01 15:24:04 +02:00
Jörg Hofrichter
e14ba329f7 debian: align install files to Debian/Ubuntu official
- Align the distribution of the files to packages (debian/*.install)
  files to the Debian/Ubuntu official version from
  https://salsa.debian.org/bottoms/pkg-uhd (branch experimental)
- Import rfnoc-blocks-track-runtime-abi patch from the official debian
  sources at https://salsa.debian.org/bottoms/pkg-uhd.
  This changes the UHD package data path to include the ABI version, e.g.:
    old: /usr/share/uhd
    new: /usr/share/uhd/4.9.0

Co-authored-by: A. Maitland Bottoms <bottoms@debian.org>
2025-08-29 15:14:04 +02:00
Martin Braun
0320e7918d cmake: Skip more files when staging usrp3 HDL sources
These sources are not required when building RFNoC bitfiles, and they
also reference csh, which causes some build systems to produce warnings.

As a consequence, we can also remove csh from the uhd-rfnoc-dev
dependency list.
2025-08-28 16:58:04 +02:00
Frank Dietze
43875c9f25 host: cmake: fix patch version used for packaging
When called from a branch the patch version contained letters
which cmake is not able to process. This change set it to numbers.
2025-08-26 20:11:30 +02:00
Frank Dietze
b2d396d436 Prepare for 4.9.0.0 RC2
Update Changelog
- Add mention of new RFNoC OOT block repository to changelog.
  Add link to RFNoC OOT block github repository to README.
Update Readme with reference to new OOT block repo
Update Manifest

Co-authored-by: Niels Garibaldi <niels.steffen.garibaldi@emerson.com>
Co-authored-by: Marian Koop <marian.koop@emerson.com>
2025-08-23 00:21:06 +02:00
Aki Tomita
9018f578b2 cmake: Adjust the UHD_VERSION check to work with cmake 4.1
UHD_VERSION needs to be also checked against an empty string
since cmake 4.1 sets this variable during project setup, also
if it was undefined before. Furthermore we need to backup and
restore custom UHD_VERSION when defined for e.g. by using option
-DUHD_VERSION=<version>, because project() setup will reset the
version to an empty string.
2025-08-22 16:18:42 +02:00
Martin Braun
aa0c47877d debian: Enable building of uhd-rfnoc-dev
When building Debian packages, we now enable -DENABLE_RFNOC_DEV=ON and
put the HDL source files into a new package (uhd-rfnoc-dev).
2025-08-22 15:56:03 +02:00
Jörg Hofrichter
e82dcd6518 cmake: deb: add patch to fix UHD package path 2025-08-22 13:36:21 +02:00
Marian Koop
ccf87ebb90 cmake: win: Add winusbdriver packages for NI branded B-Series devices
Co-authored-by: Sascha Hoener <sascha.hoener@emerson.com>
2025-08-21 14:13:35 +02:00
Marian Koop
d2f401da2f Prepare for 4.9.0.0 release
- Updated version string
- Updated CHANGELOG
- Updated Debian-related files
- Updated manifest
2025-08-11 19:12:16 +02:00
Jörg Hofrichter
652108ff95 cmake: deb: Fix linting errors for Ubuntu 24.04
Starting from Ubuntu 24.04 (noble), the following package dependencies need to
be adopted:

    libncurses5-dev => libncurses-dev
    pkg-config => pkgconf
2025-08-08 10:22:44 +02:00
Marian Koop
9ba99b5799 host: cpack: windows: Integrated applying inf win drivers into NSIS template
- Adds calling pnpdriver util to apply all installed inf win drivers
- Change installer to be aware of the target proc architecture of
  installed files. This reults into a 64-bit installer to default
  installing registry keys into the 64-bit registry hive.
- Extended file info of installer executable to incl. publisher and
  copyright and make installer binary version match version of
  deployed binaries.
- Add custom icon to installer and uninstaller binaries as well as
  ARP entry.
2025-08-05 09:58:37 +02:00
Lars Amsel
8812898bf3 host: add retransmission capabilities to tx streamer
With this commit the host enables retranmit capabilities to tx
streamer. This can be used for host to FPGA transmission that
are real time depended but need absolut reliability. The main
use case will be transmissions from host to replay block. The
current implementation supports only single channel transmissions.
To enable retransmissions the streamer has to change the op mode
using the new STREAM_MODE_STOP_ON_SEQ_ERROR. The streamer will
check whether the FPGA reports that this mode was enabled before
proceeding. When enabled on the FPGA the FPGA will reject data
from the host when it detects a sequence error. Only after a new
initialize stream command is sent the host can transfer more data
to the FPGA. When the tx streamer detects a sequence error from the
FPGA it will stop the current send command and return the samples
sent so far. Note: This might be more than the FPGA has actually
processed. It is up to the user logic to determine if and where
the transmission has to restart (e.g. query the replay block for
arrived samples). If the tx streamer calls send again the
reinitialization is triggered automatically.
2025-07-18 11:19:52 +02:00
Martin Braun
c5a56ce822 cmake: Add ENABLE_RFNOC_DEV target
With -DENABLE_RFNOC_DEV=ON (the default is OFF), the HDL sources for
building RFNoC blocks and RFNoC images through rfnoc_image_builder are
now also installed into $PREFIX/share/uhd/rfnoc/fpga/usrp3. This re-uses
the existing share/uhd/rfnoc/fpga directory.

This commit also includes a Python script that copies the fpga/usrp3
directory into a staging directory inside the build dir. The
installation happens from the staging directory, not the fpga/usrp3
directory itself. This allows us to filter the usrp3 source dir without
having to use highly verbose CMake for that.

The uhd-host Debian install file is also modified so that the RFNoC
sources are not packaged into the uhd-host package.
2025-07-17 15:29:54 +02:00
Jörg Hofrichter
18f87b8395 rfnoc_modtool: fix wrong substitution in README.md
The word "again" was accidently replaced.
2025-07-10 09:08:30 +02:00
Martin Braun
132d7aa7f7 cmake: Create 'rfnoc' install component and use it
The YAML files that get installed as part of UHD in order to enable
RFNoC image building support are no longer in the 'header'component, but
are moved to a newly created 'rfnoc' component. This allows separate
rules for installing YAML files vs. C/C++ header files.
2025-06-24 16:08:36 +02:00
Martin Braun
4d81adca90 cmake: Change install rule for headers when ENABLE_LIBUHD=OFF
When ENABLE_LIBUHD is OFF, headers are no longer installed. This is
relevant for the use case where only Python utilities (like the RFNoC
tooling) is installed.
2025-06-24 16:08:36 +02:00
Martin Braun
53402804dc cmake: Remove references to UHD_RFNOC_DIR
This environment variable is obsolete since UHD 4.0.
2025-06-23 10:01:22 +02:00
Marian Koop
2ddc080605 cmake: win: Modernize USRP inf files (NI signed), add B206mini inf file
Modernized USRP inf files by:
- Removing using co-installers and depend instead on WINUSB.NT
  install service (provided by Windows OS itself)
- Defined version string in addition to date string
- Switched to using unique USRPs specific ClassGuid, instead of
  standard Windows defined ClassGuid to avoid infver (WDK) errors
  - ERROR(1280) Class name and ClassGuid mismatch, expecting Class
    "Sample" for ClassGuid "{78A1C341-4539-11d3-B88D-00C04FAD5171}"
  - ERROR(1285) Cannot specify [ClassInstall32] section for
    Microsoft-defined class
- Verified inf files with WDK infver utility.
Added new inf file for B206mini.
Extended erllc_uhd_b200_reinit.inf file to support initializing
unprogrammed FX3 based USRPs (B200 Series).
2025-05-15 11:15:51 +02:00
Martin Braun
560f0cf1e8 examples: rfnoc-gain: Add CMake config file
This adds rfnoc-gainConfig.cmake, which can be used by other projects to
find this OOT after installation by calling

```cmake
find_package(rfnoc-gain)
```
2025-05-09 15:21:26 +02:00
Martin Braun
a7f757e1d6 examples: rfnoc-gain: Add config.hpp for API exports
For identifying the export type of symbols in rfnoc-gain, the OOT
previously used UHD's config.hpp. However, that file requires defining
a specific preprocessor macro for setting the export types correctly.
Now, every OOT should carry their own config.hpp file, which means the
export-API macros need to be renamed (for rfnoc-gain, instead of
recycling UHD_API, it is now rfnoc_gain_API).

The corresponding template for rfnoc_modtool has also been adapted.
2025-05-09 15:21:26 +02:00
Martin Braun
ffa9b9906f rfnoc_modtool: Fix paths
This is a bugfix for 8684d3c1:

- rfnoc_modtool create would generate an rfnoc/CMakeLists.txt that said
  'gain' instead of 'newmod'.
- rfnoc_modtool add would put the gateware files in the wrong directory
  (fpga/<modulename>/<blockname> instead of (rfnoc/fpga/...).
2025-05-05 08:54:27 +02:00
Martin Braun
f33195843b cmake: Remove reference to UHD_RFNOC_FOUND
This is a vestage from the UHD-3 era, where RFNoC was optional. To
reduce confusion, we remove the CMake variable UHD_RFNOC_FOUND, although
we leave it in UHDConfig.cmake for not breaking 3rd party applications.
2025-05-05 08:49:39 +02:00
Martin Braun
8684d3c15a rfnoc oot: Move fpga/ subdir into rfnoc/
During redesign of the OOT module directory layout, the block YAMLs and
dts files were moved under `rfnoc/`, but the gateware was not. This
causes an inconsistency in the directory layout before and after
installation, making it hard to switch between installed and
not-installed versions of RFNoC modules.

For example, block YAMLs are in `./rfnoc/blocks/*.yml`, and gateware is
in `fpga/gain/rfnoc_block_gain/*`. After installation, block YAMLs are
in `$PREFIX/share/uhd/rfnoc/blocks/*.yml`, and gateware is in
`$PREFIX/share/uhd/rfnoc/fpga/gain/rfnoc_block_gain/*` -- note the
discrepancy.

This fixes two immediate issues:

- When building the X410 example in-tree, the DTS file was not being
  found because it used the same finding logic as the gateware source files.
- When building any image core file post-installation, none of the
  gateware could be found because it used the same logic for finding
  gateware inside the OOT, which is in a different location relative to
  the block YAMLs.

By removing the inconsistencies, both these use cases work.

A note on backward compatibility:

- Existing OOT modules already have the issue that building bitfiles
  post-install does not work, and that will continue to not work.
  However, otherwise, they will keep working as before.
- Because people may have gotten accustomed to specifying the RFNoC OOT
  module as the include directory (e.g., `rfnoc_image_builder -I
  /path/to/rfnoc-gain`), we allow for this use case, and auto-correct
  the include path in this case with some backward compatibility code.
- Building the rfnoc-gain/icores/x410_XG_200_rfnoc_image_core.yml
  example image core file now also works, even with older versions of
  rfnoc-gain.
2025-04-15 09:43:04 +02:00
Martin Braun
fdb5ab4b4b cmake: Remove minimum CMake version from CMakeRC.cmake
This line is redundant (we call CMakeRC.cmake from other cmake files,
and we have our own cmake_minimum_required() call in
host/CMakeLists.txt), and it is also less strict than our own
requirements (we currently require at least 3.12 for all of UHD). With
recent CMake versions, this causes warnings so we remove this line.

This is the warning that is now removed:

```
CMake Deprecation Warning at cmake/Modules/CMakeRC.cmake:63
(cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
```
2025-02-20 15:35:05 -06:00
nzqo
8f92754ca1 cmake: Improve formatting, comments and Apple DPDK support
- Newer versions of cmake do not set install_name, so we need to do it
  ourselves.
- Made Boost a system dependency to suppress compiler warnings from it.
2025-02-20 09:47:01 +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
Marian Koop
1e4d0a7d56 doc: Appended changelog for UHD 4.8 release
Added mention for bug fix of usrp_update_fs utility.
2025-01-23 20:42:29 +01:00
Marian Koop
1677b4ec81 doc: Correct grammar in copyright string 2025-01-22 20:19:24 +01:00
Marian Koop
ee4c15c5c3 doc: Prepare branch for 4.8.0.0 release
- Updated version string
- Updated CHANGELOG
- Updated Debian-related files
- Updated images package
2025-01-13 22:45:43 +01:00
Marian Koop
a95735d133 cmake: deb: Raise debhelper compatibility version to 12
Raise debhelper compatibility version from 9 to 12 to follow
current recommendations from http://man.he.net/man7/debhelper.
2025-01-13 22:45:43 +01:00
Lars Amsel
c6274925ba host: add patch version number to poetry version
Add the patch version number to poetry version. Because UHD uses
the patch number for adding branch information on development branches
we need to save the patch number in some different variable for later
access.
2025-01-10 15:03:45 +01:00
Lars Amsel
023bb39121 host: Cleanup UHD Python utilities
This moves the calibration Python utilities into the
uhd Python module (because they have dependencies to
uhd). Also the poetry script adds them as scripts to
the uhd module.

The install Python module is not executed on Windows
systems.

usrpctl, rfnoc image builder and rfnoc modtool are
not affected.
2025-01-10 15:03:45 +01:00
Lars Amsel
c36e40a5fc cmake: Set classifiers in pyproject.toml
This sets classifiers in pyproject.toml. Most of them
are static except for the development status. The status
is set to 2 (pre alpha) as a default. Only if UHD_RELEASE_MODE
is set it changes to 4 (beta) if we are on a release canditate tag
or 5 (release) if we are on release tag. If we aren't on any tag
or the tag does not meet the correct formatting we stay on 2
and a warning is issued.
2024-12-13 15:53:09 +01:00
Marian Koop
57ef1fb88c cmake: Extend Windows Installer w libusb dll & erllc_uhd_winusb_driver
Simplifying the Windows installer experience by reducing the
number of individual downloads from 4 (for USB devices) to 2.
Including the libusb.dll into the installer will remove a common
onboarding error.
This change introduces a now, optional cmake feature called
-DENABLE_EXTEND_WIN_PACKAGING=ON, that defaults to off.
Enabling this feature will cause a number of convenience components
to be included into the windows deployment package (aka. installer).
Enabling this feature has no effect on other platforms.
The changes to the NSIS itself are trivial and limited to another
license dialog (for libusb redistribution). Most changes were in
the cmake code used by cpack (for which NSIS is the utilized Windows
cpack generator option).
These additional components now controlled via the feature
component are currently:
- incl. of MSVC Runtime binaries into ${RUNTIME_DIR}
- incl. of libusb.dll into ${RUNTIME_DIR}
- incl. of erllc_uhd_winusb_driver into ${PKG_DATA_DIR}/usbdriver
2024-12-13 15:51:56 +01:00
Marian Koop
0eb24b3727 cmake: Added MSVC_VERSION definition for VC2022. 2024-12-13 15:51:56 +01:00
Martin Braun
09bd68aa2d rfnoc: modtool: Fix various issues with block creation
- icores/CMakeLists.txt now contains the correct macro example
- The CMakeLists.txt file for the gateware itself is now created, and
  will dynamically contain the correct argument for
  RFNOC_REGISTER_BLOCK() depending on --skip-testbench
- To enable this, the fpga/<module_name>/CMakeLists.txt is now also
  properly updated on `rfnoc_modtool add`
   - This was facilitated by adding the `append` step option
- The autogenerated Makefile.srcs has the correct file endings now (.sv
  instead of .v)
- There was a bug in the autogenerated Python block controller wrapper,
  which referenced the wrong namespace
- Fix more missing commas in generated HDL.
2024-12-10 13:58:44 +01:00
Lars Amsel
22396d4666 host: python: Add pyproject.toml to enable poetry builds
This adds a pyproject.toml to generate Python wheels using poetry.
The toml file is generated by cmake to add build dependend information to the
file. On Windows the build process invokes poetry using the configured
Python executable. The existing distribution way (copy python data
to site-packages folder of UHD installation) is not changed yet.
2024-12-10 13:02:52 +01:00
Martin Braun
8a903dd80f cmake: Remove all references to PythonInterp and PythonLibs
This is deprecated, and with CMake 3.12 and above, we have better
options. This fully relies on find_package(Python3).
2024-12-10 08:36:00 +01:00
Martin Braun
3ae44b1d96 cmake: Bump minimum CMake from 3.8 to 3.12 2024-12-10 08:36:00 +01:00
Martin Braun
afae7a1ef6 cmake: Bump minimum Boost version to 1.66
This is mainly to be able to more easily handle newer version of
Boost.Asio.
2024-12-05 11:32:25 +01:00
Marian Koop
d435d85504 all: use uhd.maintainer@emerson.com as new maintainer email
Replaced instances of email address packages@ettus.com with new
corporate email address uhd.maintainer@emerson.com.

For some yet undefined transition time emails to the old address
are being forwarded to the new one.
2024-12-03 09:23:49 +01:00
Martin Braun
0ab9ad52fe deb: Move content of /usr/share into uhd-host
Previously, the content of /usr/share was packaged with the
`libuhd4.x.y` package. However, this was both problematic and incorrect:

- The problem is that the intention of the `libuhd.4.x.y` packages is
  that multiple packages with different versions can be installed
  side-by-side, which doesn't work if different versions contain the
  same file paths.
- The files that were shipped in the `libuhd` package are not actually
  required by the UHD library (DLL).
- Specifically, they include:
  - The .fbs files used for calibration data, only required when
    manually inspecting and modifying cal data using flatbuffer, see the
    section "Modify Calibration Data" in the manual.
  - The rfnoc-newmod directory, which is required by rfnoc_modtool,
    which itself is packaged in `uhd-host`.
  - The rfnoc/ subdirectory which contains the block and device BSP
    YAMLs. These are currently only used by `rfnoc_image_builder`, which
    is also packaged in `uhd-host`.

Because the UHD library itself requires none of these files, and the
consumers that actually require these files are packaged in `uhd-host`,
we move them into `uhd-host` as well.
2024-12-02 17:31:47 +01:00
Martin Braun
4b45492529 deb: Make python3-uhd a dependency of uhd-host
That's because rfnoc_image_builder is part of `uhd-host`, but requires
`python3-uhd`.
2024-12-02 17:31:47 +01:00
Joerg Hofrichter
088cba271e dpdk: find DPDK using pkg-config
The parameters for compiling and linking against DPDK (DPDK_CFLAGS
and DPDK_LDFLAGS or DPDK_INCLUDE_DIRS, DPDK_LIBRARIES and
DPDK_LIBRARY_DIRS) are not trivial to determine and can be best
provided by pkg-config. Therefore, use pkg-config to find DPDK and
do not allow user provided DPDK variables.

To compile UHD against DPDK which was installed to a custom prefix,
e.g. /opt/dpdk-22.11, provide this path as parameter
CMAKE_PREFIX_PATH:

    cmake .. -DCMAKE_PREFIX_PATH=/opt/dpdk-22.11
2024-10-02 14:05:42 +02:00
Martin Braun
1fb022a35f Add rfnoc-modtool
This replaces rfnoc_modtool that was previously shipped with gr-ettus.
It is fully RFNoC/UHD4.x compatible. There is no shared code between
this version and the old one; this is a clean rewrite.

As of now, it lacks many of the features that were available with the
previous version, most importantly, the ability to generate GNU Radio
bindings.
2024-09-02 08:22:58 +02: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