Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find/print_utility() error on official ubuntu packages #43

Closed
guruofquality opened this issue Aug 15, 2015 · 5 comments
Closed

find/print_utility() error on official ubuntu packages #43

guruofquality opened this issue Aug 15, 2015 · 5 comments

Comments

@guruofquality
Copy link
Contributor

The official ubuntu packages use PKG_LIB_DIR="/usr/lib/uhd" to install the examples and utils.

override_dh_auto_configure:
    dh_auto_configure -- -DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)" -DPKG_LIB_DIR="/usr/lib/uhd"

The problem is that the uhd::find_utility() call uses the UHD_LIB_DIR regardless, so the prints end up being incorrect. This is a small patch to use PKG_LIB_DIR in find_utility:

diff --git a/host/lib/utils/CMakeLists.txt b/host/lib/utils/CMakeLists.txt
index 369920a..7940350 100644
--- a/host/lib/utils/CMakeLists.txt
+++ b/host/lib/utils/CMakeLists.txt
@@ -123,7 +123,7 @@ SET_SOURCE_FILES_PROPERTIES(
     ${CMAKE_CURRENT_SOURCE_DIR}/paths.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/images.cpp
     PROPERTIES COMPILE_DEFINITIONS
-    "UHD_PKG_PATH=\"${UHD_PKG_PATH}\";UHD_LIB_DIR=\"lib${LIB_SUFFIX}\""
+    "UHD_PKG_PATH=\"${UHD_PKG_PATH}\";UHD_LIB_DIR=\"lib${LIB_SUFFIX}\";PKG_LIB_DIR=\"${PKG_LIB_DIR}\""
 )

 ########################################################################
diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp
index f29318d..ac30d9b 100644
--- a/host/lib/utils/paths.cpp
+++ b/host/lib/utils/paths.cpp
@@ -363,7 +363,7 @@ std::string uhd::find_image_path(const std::string &image_name, const std::strin
 }

 std::string uhd::find_utility(std::string name) {
-    return fs::path(fs::path(uhd::get_pkg_path()) / UHD_LIB_DIR / "uhd" / "utils" / name)
+    return fs::path(fs::path(uhd::get_pkg_path()) / PKG_LIB_DIR / "utils" / name)
         .string();
 }

@bhilburn bhilburn closed this as completed Oct 9, 2015
@guruofquality
Copy link
Contributor Author

@bhilburn you closed the bug, but it still seems to be a problem with the official ppa:

its up to date

sudo apt-get install uhd-host
Reading package lists... Done
Building dependency tree       
Reading state information... Done
uhd-host is already the newest version (3.9.4-0ubuntu1~xenial1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

look at the error message

uhd_find_devices 
linux; GNU C++ version 5.3.1 20160413; Boost_105800; UHD_003.009.004-release


UHD Warning:
    EnvironmentError: IOError: Could not find path for image: usrp_b200_fw.hex
    Using images directory: <no images directory located>
    Set the environment variable 'UHD_IMAGES_DIR' appropriately or follow the below instructions to download the images package.
    Please run:
     "/usr/lib/x86_64-linux-gnu/uhd/utils/uhd_images_downloader.py"
No UHD Devices Found

but this file doesnt exist

 ls /usr/lib/x86_64-linux-gnu/uhd/utils/uhd_images_downloader.py
ls: cannot access '/usr/lib/x86_64-linux-gnu/uhd/utils/uhd_images_downloader.py': No such file or directory

because its here

ls /usr/lib/uhd/utils/uhd_images_downloader.py
/usr/lib/uhd/utils/uhd_images_downloader.py

@pascal-gujer
Copy link

pascal-gujer commented Jul 26, 2018

Set the environment variable 'UHD_IMAGES_DIR' appropriately

This is the key... After installing my UHD from source as described here https://kb.ettus.com/Building_and_Installing_the_USRP_Open-Source_Toolchain_(UHD_and_GNU_Radio)_on_Linux I set the 'UHD_IMAGES_DIR' environment variable appropriately in my .bashrc :

export UHD_IMAGES_DIR=/usr/local/share/uhd/images

And now everything is working like a charm. 🥇

PS: Don't forget to restart your terminal before restarting gnuradio-companion

@oladimeji-abdul
Copy link

which command did you run please

@alphafox02
Copy link

alphafox02 commented Jan 30, 2023

Just wanted to drop in and say, that incorrect print statement mentioned above still happens in uhd 4.1.0.5 in 2023, when installed from source using /usr prefix.

@leandroebner
Copy link

same here. Not user friendly at all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants