简体   繁体   中英

Ubuntu 20.04 Could NOT find MPIR during gr-iio cmake

For the third time I reinstalled Ubuntu 20.04 on a Windows 10 machine running VMWare whilst attempting to install GNU Radio Companion 3.8 with the PlutoSDR gr_iio blocks. Each time failed with a different error.

I am charting my most recent attempt below. Any help is greatly appreciated.

  1. Installed Ubuntu 20.04 on VMWare
  2. Updated Ubuntu
  3. cp./53-adi-plutosdr-usb.rules /etc/udev/rules.d/
  4. sudo service udev restart
  5. checked the output of dmesg
  6. Since I had no ~/.ssh/config file I ran wget https://raw.githubusercontent.com/analogdevicesinc/plutosdr_scripts/master/ssh_config -O ~/.ssh/config
  7. ssh plutosdr to add to list of known hosts. I verified the IP and firmware version.
  8. sudo apt-get install libiio-utils and verified I can talk to the device via iio_info -n 192.168.2.1 | grep device iio_info -n 192.168.2.1 | grep device The following output was produced:
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)

I checked the errors shown above on the ADIEngineerZone and a top 1%er said "You can ignore these errors." https://ez.analog.com/adieducation/university-program/f/qa/111133/missing-device-attributes-after-update-of-pluto/331921#331921

So I did just that (since I couldn't find a solution to resolve it) and moved on to the final check for lined items three through eight.

  1. iio_readdev -n 192.168.2.1 -s 64 cf-ad9361-lpc | hexdump -x iio_readdev -n 192.168.2.1 -s 64 cf-ad9361-lpc | hexdump -x returned values just fine

Now that the Linux drivers are installed I proceeded to check the output of iio_info -s and iio_info -u ip:192.168.2.1 . The first returned expected results. The second output was terribly long but notable errors showed after the /gaintable tag

                .
                .
                .
                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
                .
                .
                .

I am not sure if this is an issue, but considering the prior excusable error, I moved forward with the installation as outlined below.

I begin by installing dependencies for 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

No errors were seen.

Next, for git clone I installed using the following prefix /usr/local , which I'll take note when setting and checking the 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

Because I ran into a problem with the gr-iio cmake stating:

-- 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.

I read online I should update apt-get , soemthing I should of done from the beginning but never stated in any walk-through.

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

I deleted the build folder after the above update and reran the gr-iio portion.

After the update, the CXX compiler was found. However, I did get an error not finding a package configuration file:

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

So I looked for the two stated files so I can add to the CMAKE_MODULE_PATH but using: find /usr/ -iname GnuradioConfig.cmake or find /usr/ -iname gnuradio-config.cmake

returned nothing... Online searching showed me I would need to sudo apt install gnuradio-dev so I did that and reran cmake

This time it resulted in an error stating:

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

On to installing mpir:

sudo apt-get install libgmp3-dev and back to another go at removing the build directory and rerunning cmake. But, still same issue:

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

All online documentation points to installing libgmp3-dev or libgmp-dev but neither resolve this issue.

Any thoughts?

Accoding to the documentation , the gr-iio project doesn't include the GNU Radio project but expects you to build it in advance.

However, you only built libiio and libad9361 , but not the GNU Radio library from https://github.com/gnuradio/gnuradio . The config file gr-iio is complaining about should be installed when installing GNU Radio .

Regarding MPIR: While MPIR started as a fork of gmp you can't install gmp as a replacement for MPIR, as they use different names for their headers and libraries. Which is why MPIR is still not being found after you've installed the development packages for gmp. If ubuntu doesn't provide packages for MPIR you'll have to compile it from source.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM