Ubuntu 20.04 在 gr-iio cmake 期间找不到 MPIR

时间:2021-02-27 19:37:36

标签: git ubuntu cmake gnuradio-companion

我第三次在运行 VMWare 的 Windows 10 机器上重新安装 Ubuntu 20.04,同时尝试使用 PlutoSDR gr_iio 块安装 GNU Radio Companion 3.8。每次都因不同的错误而失败。

我在下面绘制了我最近的尝试。非常感谢任何帮助。

  1. 在 VMWare 上安装了 Ubuntu 20.04
  2. 更新了 Ubuntu
  3. cp ./53-adi-plutosdr-usb.rules /etc/udev/rules.d/
  4. sudo service udev restart
  5. 检查了 dmesg 的输出
  6. 因为我没有 ~/.ssh/config 文件,所以我运行了 wget https://raw.githubusercontent.com/analogdevicesinc/plutosdr_scripts/master/ssh_config -O ~/.ssh/config
  7. ssh plutosdr 添加到已知主机列表。我验证了 IP 和固件版本。
  8. sudo apt-get install libiio-utils 并验证我可以通过 iio_info -n 192.168.2.1 | grep device 与设备通话 产生了以下输出:
IIO context has 5 devices:
    iio:device0: adm1177
    iio:device1: ad9361-phy
        18 device-specific attributes found:
                attr  2: dcxo_tune_coarse ERROR: No such device (-19)
                attr  4: dcxo_tune_fine ERROR: No such device (-19)
    iio:device2: xadc
        1 device-specific attributes found:
    iio:device3: cf-ad9361-dds-core-lpc (buffer capable)
    iio:device4: cf-ad9361-lpc (buffer capable)
                attr  3: samples_pps ERROR: No such device (-19)
                attr  3: samples_pps ERROR: No such device (-19)

我在 ADIEngineerZone 上检查了上面显示的错误,前 1% 的人说“您可以忽略这些错误。” https://ez.analog.com/adieducation/university-program/f/q-a/111133/missing-device-attributes-after-update-of-pluto/331921#331921

所以我就这样做了(因为我找不到解决它的方法)并继续对第三到第八项的最后检查。

  1. iio_readdev -n 192.168.2.1 -s 64 cf-ad9361-lpc | hexdump -x 返回的值很好

现在安装了 Linux 驱动程序,我继续检查 iio_info -siio_info -u ip:192.168.2.1 的输出。第一个返回了预期的结果。第二个输出非常长,但在 /gaintable 标记之后显示了明显的错误

                .
                .
                .
                attr 10: multichip_sync ERROR: Permission denied (-13)
                attr 11: rssi_gain_step_error value: lna_error: 0 0 0 0
mixer_error: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
gain_step_calib_reg_val: 0 0 0 0 0
                .
                .
                .

我不确定这是否是一个问题,但考虑到之前的可原谅错误,我继续进行了如下所述的安装。

我首先为 GNU Radio 安装依赖项。

cd
sudo apt-get -y install libxml2 libxml2-dev bison flex cmake git libaio-dev libboost-all-dev swig libgmp-dev liborc-0.4-dev libusb-1.0-0-dev libserialport-dev graphviz doxygen

未发现任何错误。

接下来,对于 git clone,我使用以下前缀 /usr/local 进行安装,我会在设置和检查 PATH 时注意这一点。

git clone https://github.com/analogdevicesinc/libiio.git
cd ~/libiio
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../
make
sudo make install
cd

git clone https://github.com/analogdevicesinc/libad9361-iio.git
cd ~/libad9361-iio
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../
make
sudo make install
cd

git clone https://github.com/analogdevicesinc/gr-iio.git
cd ~/gr-iio
git checkout upgrade-3.8
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../
make
sudo make install
sudo ldconfig

因为我遇到了 gr-iio cmake 的问题,说明:

-- The CXX compiler identification is unknown
-- The C compiler identification is GNU 9.3.0
CMake Error at CMakeLists.txt:25 (project):
  No CMAKE_CXX_COMPILER could be found.

我在网上阅读我应该更新 apt-get,这是我从一开始就应该做的事情,但从未在任何演练中说明过。

sudo apt-get update && sudo apt-get install build-essential

我在上述更新后删除了 build 文件夹并重新运行了 gr-iio 部分。

更新后发现CXX编译器。但是,我确实收到了找不到包配置文件的错误:

CMake Warning at CMakeLists.txt:90 (find_package):
  By not providing "FindGnuradio.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Gnuradio",
  but CMake did not find one.

  Could not find a package configuration file provided by "Gnuradio"
  (requested version 3.9) with any of the following names:

    GnuradioConfig.cmake
    gnuradio-config.cmake

所以我查找了两个声明的文件,以便我可以添加到 CMAKE_MODULE_PATH 但使用: find /usr/ -iname GnuradioConfig.cmakefind /usr/ -iname gnuradio-config.cmake

什么也没返回...在线搜索显示我需要sudo apt install gnuradio-dev,所以我这样做并重新运行cmake

这次它导致了一个错误说明:

--   No package 'mpir' found
-- Could NOT find MPIR (missing: MPIRXX_LIBRARY MPIR_LIBRARY MPIR_INCLUDE_DIR) 

关于安装 mpir:

sudo apt-get install libgmp3-dev 并返回另一个去删除构建目录并重新运行 cmake。但是,仍然是同样的问题:

-- Could NOT find MPIR (missing: MPIRXX_LIBRARY MPIR_LIBRARY MPIR_INCLUDE_DIR)

所有在线文档都指向安装 libgmp3-devlibgmp-dev,但均未解决此问题。

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

根据documentationgr-iio 项目不包括GNU Radio 项目,但希望您提前构建它。

但是,您只构建了 libiiolibad9361,而不是来自 https://github.com/gnuradio/gnuradioGNU Radio 库。配置文件 gr-iio 抱怨应该在安装 GNU Radio 时安装。

关于 MPIR:虽然 MPIR 是作为 gmp 的一个分支开始的,但您不能安装 gmp 作为 MPIR 的替代品,因为它们的标头和库使用不同的名称。这就是为什么在您安装 gmp 的开发包后仍然找不到 MPIR 的原因。如果 ubuntu 没有为 MPIR 提供包,你必须从源代码编译它。

相关问题