aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/utils/paths.cpp
Commit message (Collapse)AuthorAgeFilesLines
* utils: Fix prefix determination in get_lib_path()Ryan Volz2020-07-131-1/+3
| | | | | | | | | | | | | | | | | | | | get_lib_path() uses the libuhd location on disk to dynamically determine the installation prefix at runtime. This fix normalizes the libuhd path before any path operations are done to extract the library directory and then prefix directory. Previously, using a non-normalized library path, the returned prefix directory would be incorrect in some cases (e.g. when loaded through GNU Radio). In these error cases, the libuhd path would be $PREFIX/lib/./libuhd.so (with a no-op /. inserted) which would result in a technically correct library directory of `$PREFIX/lib/.` but an incorrect prefix directory of `$PREFIX/lib`. With the normalization fix, the libuhd path is corrected to $PREFIX/lib/libuhd.so and the subsequent path manipulation to get the library and prefix directories will work as intended.
* uhd: paths: Harmonize around XDG Base Directory specificationMartin Braun2020-04-021-28/+89
| | | | | | | | | | | | | | | | | | | | | | Up until now, we completely ignore the XDG specification. This commit does the following to change that: - It uses XDG_DATA_HOME and XDG_CONFIG_HOME for cal and config data, respectively. - If config data is in ~/.uhd/uhd.conf, that is still accepted, but if it conflicts with $XDG_CONFIG_HOME/uhd.conf, it is ignored and a warning is displayed - The default location for cal data is thus ${HOME}/.local/share/uhd/cal on Unix, and %LOCALAPPDATA%\uhd\cal on Windows. This is a change in location! - The UHD_CONFIG_DIR environment variable was confusingly named and is now removed. It provided an alternative location than the home directory. The same purpose is now much better served by XDG_DATA_HOME and XDG_CONFIG_HOME. The specification can be found here: specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
* uhd: cal: Use usrp::cal::database instead of CSV filesMartin Braun2020-04-021-0/+26
| | | | | | | | | Now that we have cal::iq_cal and cal::database, there's no need to manually wrangle CSV files for calibration data. This commit replaces all CSV operations with cal::database calls and uses cal::iq_cal as a container. CSV files can still be read, but are considered deprecated.
* uhd: paths: Add get_cal_data_path() API callMartin Braun2020-03-261-0/+19
| | | | This points to the location where cal data is stored.
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-031-108/+151
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* lib: utils: Don't use hard-coded path constantsRyan Volz2020-02-071-2/+24
| | | | | | | | | | | | | This replaces the package path constant with a runtime library path lookup. The package path is taken to be the parent directory of the library directory. When boost >= 1.61 is not available, this maintains the current behavior of using CMake to set path contants. Runtime path determination is preferable for making a relocatable library so that it is not necessary to do string substitution on relocated binaries (as with, for example, building a conda package).
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | Note: Replacing everything with a lambda would be even better, but that can't be easily scripted so we'll do this as a first step to reduce the Boost footprint. This also removes occurences of #include <boost/bind.hpp>, and makes sure all usages of std::bind have an #include <functional>. clang-format wasn't always applied to minimize the changeset in this commit, however, it was applied to the blocks of #includes. Due to conflicts with other Boost libraries, the placeholders _1, _2, etc. could not be directly used, but had to be explicitly called out (as std::placeholders::_1, etc.). This makes the use of std::bind even uglier, which serves as another reminder that using std::bind (and even more so, boost::bind) should be avoided. nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It was not possible to remove it by simply doing a search and replace, so it will be removed in a separate commit.
* uhd: Replace boost::regex with std::regexMartin Braun2019-11-261-5/+5
| | | | | | | | boost::regex was a requirement until the minimum version of gcc was increased. Since it is at version 5.3 now, using Boost.Regex is no longer necessary. This change is a pure search-and-replace; Boost and std versions of regex are compatible and use the same syntax.
* lib: Add path_expandvars() internal API callMartin Braun2018-02-201-0/+2
|
* uhd: Update license headersMartin Braun2018-02-191-1/+2
| | | | | | | All copyright is now attributed to "Ettus Research, a National Instruments company". SPDX headers were also updated to latest version 3.0.
* Move all license headers to SPDX format.Martin Braun2017-12-221-12/+1
|
* uhd: replace BOOST_FOREACH with C++11 range-based for loopAndrej Rode2017-02-101-5/+4
| | | | | Note: This is the first commit that uses for-range, and range-based for-loops are now usable for UHD development.
* Merge branch 'maint'Ashish Chaudhari2016-02-181-1/+1
|\ | | | | | | | | | | Conflicts: host/lib/usrp/cores/gpio_core_200.cpp host/lib/usrp/dboard/db_ubx.cpp
| * Rectified the usage of UHD_IMAGES_DIR_WINREG_KEY in search paths.vkakade2016-02-111-1/+1
| |
* | Merge branch 'maint'Martin Braun2016-01-211-6/+2
|\|
| * uhd: add CMake flag for the Windows registry key to specify UHD images directoryBrooks Prumo2016-01-211-6/+2
| |
* | cmake: Proper selection of files for ENABLE_X300Martin Braun2015-10-261-1/+0
|/
* paths: consistency in usage of string parametersNicholas Corgan2015-08-121-3/+3
|
* Fixed minor warningsNicholas Corgan2015-07-241-2/+4
|
* uhd: Added args arg to print_utility_warningMartin Braun2015-04-301-3/+3
|
* Merge branch 'bhilburn/uhdcalibpath' into maintAshish Chaudhari2015-02-111-4/+7
|\
| * Creating the $UHD_CONFIG_DIR env var, here used for custom cal data storage.Ben Hilburn2015-02-111-1/+1
| | | | | | | | This is a renaming of the previously created $UHDCALIBPATH.
| * uhd::paths - fixing `get_app_path` to use correct `get_env_var` functionBen Hilburn2015-02-101-4/+7
| | | | | | | | | | Also added new enviornment variable, "UHDCALIBPATH", so that users can use something other than system-required environment paths.
* | uhd::paths: Fixed empty string in error messageBen Hilburn2015-02-101-0/+1
|/
* Merging new UHD_IMAGES_DIR utilities and bug fixes.Ben Hilburn2015-01-271-36/+270
| | | | Also includes NI-USRP Windows Registry Key fixes.
* Squashed merge of Coverity fixes.Ben Hilburn2013-11-271-2/+3
|
* paths: get_module_paths adds share/uhd/modules to the list of applicable pathsNicholas Corgan2013-10-301-0/+1
|
* utils: fix declaration of "env_path_sep" such that it is always initialized ↵Michael Dickens2013-10-281-10/+11
| | | | before it is used in the "get_env_paths" function, by moving it from the global scope to inside that function. This change allows UHD_STATIC_BLOCK(load_modules) to work correctly.
* uhd: work on moving binaries to lib/uhdJosh Blum2012-11-081-4/+4
|
* uhd: added uhd::get_pkg_data_pathJosh Blum2012-06-051-4/+5
|
* uhd: used shared get_tmp_path for logging as wellJosh Blum2012-05-161-2/+28
| | | | Moved some of the log.cpp tmp paths smarts into paths as well
* usrp: basically working iq cal on txJosh Blum2011-11-101-0/+27
|
* uhd: removed constants.hpp.in, replaced w/ per source compile definesJosh Blum2011-04-191-1/+0
|
* uhd: use UHD_PKG_DATA_PATH environment variable to override the one in constantsJosh Blum2011-04-191-16/+11
| | | | The installer sets UHD_PKG_DATA_PATH, we can can handle transplanted builds.
* uhd: specify the UHD_PKG_DATA_PATH once (since images shipped w/ drivers)Josh Blum2011-04-141-6/+2
|
* uhd: replaced instanced of std::exception with the uhd exceptionsJosh Blum2011-02-241-1/+0
|
* uhd: fixed maxosx bug, was resizing the transport bufferJosh Blum2011-01-261-0/+1
| | | | | | but it cant be resized on macos and I messed up the code that blocked that behavior reimplemented block in usrp2_impl, seems more correct here
* uhd: update copyright dates on host codeJosh Blum2011-01-131-1/+1
|
* uhd: integrated boost split or tokenizer into source files, remove string ↵Josh Blum2011-01-061-2/+6
| | | | split from algorithms header
* uhd: added image utils code to search the images paths for image filesJosh Blum2010-08-191-14/+0
|
* uhd: added the concept of installer path (along with local path) for package ↵Josh Blum2010-08-161-2/+6
| | | | data
* uhd: use cmake to convert the pkg data dir to native system formatJosh Blum2010-08-151-2/+2
|
* uhd: made split string utility functionJosh Blum2010-08-121-8/+2
|
* uhd: avoid segfaults - use CPP macros for paths and dont split empty stringJosh Blum2010-08-111-6/+6
|
* uhd: created library code to handle paths for images and modulesJosh Blum2010-08-091-0/+103
- read from environment variable paths - utility functions to get paths and search for images - modified load modules to call the utility functions - added private header constants.hpp to contain cmake variables of interest - modified version.cpp to use this constants file