Ubuntu20.04下的gnuradio 3.10.5.1环境搭建-手工增加RTL-SDR Source

本文介绍了在Ubuntu 20.04上使用VMware安装gnuradio 3.10.5.1的详细步骤,包括添加PPA源、卸载旧版本、解决gnuradio与osmosdr源的问题,以及安装RTL-SDR和相关命令。

使用vmware的典型安装模式安装Ubuntu20.04

自动安装了常用软件和虚拟机增强工具,屏幕分辨率也自动设置并拉伸,比较方便。

安装gnuradio的命令

参考资料:
https://wiki.gnuradio.org/index.php?title=InstallingGR
https://wiki.gnuradio.org/index.php?title=LinuxInstall
https://wiki.gnuradio.org/index.php?title=LinuxInstall#Ubuntu_PPA_Installation

Quick Start

Ubuntu 20.04 gnuradio v3.10.5.1

sudo add-apt-repository ppa:gnuradio/gnuradio-releases
sudo apt-get update
sudo apt-get install gnuradio python3-packaging

Ubuntu PPA的安装

对于Ubuntu,最新的构建(包括发布的和从主分支拉出的)都以PPA的形式在launchpad上维护。
请务必先卸载之前安装的gnuradio版本。参见UnInstallGR。
要访问当前的发布版本(3.10),请添加gnuradio/gnuradio-releases ppa(如果已经配置了其他gnuradio的ppas,请删除)。

sudo add-apt-repository ppa:gnuradio/gnuradio-releases

要访问3.9发布版本,请添加gnuradio/gnuradio-releases-3.9 ppa(如果已经配置了其他gnuradio的ppas,请删除)。

sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.9

要访问3.8发布版本,请添加gnuradio/gnuradio-releases-3.8 ppa(如果已经配置了其他gnuradio的ppas,请删除)。

sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.8

要访问3.7发布版本(遗留),请添加gnuradio/gnuradio-releases-3.7 ppa(如果已经配置了其他gnuradio ppas,请删除)。

sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.7

然后,更新apt源,并安装gnuradio

sudo apt-get update
sudo apt install gnuradio

注意。不要试图通过Ubuntu的软件包管理(即使用 “apt”)来安装更多的软件包,如gr-osmosdr。Ubuntu将尝试安装一个可能不兼容的版本,你的系统将处于未定义状态。
相反,请首先打开GNURadio-Companion,在右侧的块状列表中,打开 “Soapy”->"Source "或 “Sink”,看看你最可能使用的硬件是否已经被集成。
关于3.10包装依赖性的说明 对于某些发行版,你可能需要用pip安装python模块 “packaging”(可能还需要安装)。

sudo apt install python3-pip
pip install packaging

Ubuntu上的Modtool

注意:在Ubuntu 18.04 (bionic)的发布版本中,在GNU Radio从PPA中安装后,使用gr_modtool有一个问题。这是由于安装后modtool模板中仍有字节编译的代码。为了解决这个问题。

cd /usr/share/gnuradio/modtool/templates/gr-newmod
sudo py3clean .

这个问题不会出现在Ubuntu 19及以后的软件包中

=========================================

安装完成后打开还是没有osmosdr的source,需要手工安装

git clone git://git.osmocom.org/gr-osmosdr
cd gr-osmosdr/
mkdir build
cd build/
cmake ../
make
sudo make install
sudo ldconfig

cmake log

$ cmake ../
-- The CXX compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Build type not specified: defaulting to release.
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_cr
### 配置Ubuntu 20.04下的Python、CUDA Toolkit、TensorFlow(GPU版本)和Sionna 为了在Ubuntu 20.04上成功配置Python 3.10.13、CUDA Toolkit 11.8.0、TensorFlow 2.14.0 GPU版本以及Sionna 1.0.2,需要按照一定的顺序安装相关依赖,并确保各个组件之间的兼容性。 #### 安装特定版本的Python Ubuntu 20.04默认可能已经安装了多个Python版本。如果需要安装Python 3.10.13,可以通过`deadsnakes` PPA来实现: ```bash sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update sudo apt install python3.10 ``` 验证安装是否成功: ```bash python3.10 --version ``` #### 安装CUDA Toolkit 11.8.0 NVIDIA提供了针对不同Linux发行版的CUDA Toolkit安装包。对于Ubuntu系统,推荐使用.deb包进行安装。首先,从[NVIDIA官方网站](https://developer.nvidia.com/cuda-downloads)下载适用于Ubuntu 20.04的CUDA 11.8.0工具包。然后执行以下命令: ```bash sudo dpkg -i cuda-repo-ubuntu2004-11-8-local_11.8.0-520.69.01_amd64.deb sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub sudo apt-get update sudo apt-get -y install cuda ``` 安装完成后,更新环境变量以包含CUDA路径,编辑`~/.bashrc`文件并添加如下内容: ```bash export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} ``` 应用更改: ```bash source ~/.bashrc ``` 检查CUDA安装情况: ```bash nvcc --version ``` #### 安装TensorFlow 2.14.0 GPU版本 使用pip安装指定版本的TensorFlow之前,请确保已创建虚拟环境。可以利用`venv`模块创建一个新的虚拟环境: ```bash python3.10 -m venv tf_env source tf_env/bin/activate ``` 接着升级pip到最新版,并安装TensorFlow 2.14.0 GPU版本: ```bash pip install --upgrade pip pip install tensorflow-gpu==2.14.0 ``` 确认安装: ```bash python -c "import tensorflow as tf; print(tf.__version__)" ``` #### 安装Sionna 1.0.2 Sionna是一个用于物理层通信研究的开源库。要安装特定版本的Sionna,同样使用pip进行安装: ```bash pip install sionna==1.0.2 ``` 验证安装: ```bash python -c "import sionna; print(sionna.__version__)" ``` 以上步骤应该能够帮助你在Ubuntu 20.04环境中成功配置所需的软件栈[^1]。注意,在整个过程中保持网络连接畅通,以便于下载必要的依赖项。
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值