|
源码编译安装GNU Radio Radar Toolbox
cd /home/jiang/c_c++_works/gr-radar-maint-3.7
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
报错:
GNURADIO_RUNTIME_FOUND = TRUE
Qt QTGUI library not found.
Qt QTCORE library not found.
CMake Error at lib/CMakeLists.txt:27 (QT4_WRAP_CPP):
Unknown CMake command "QT4_WRAP_CPP".
原因:
查看ubuntu下Qt的版本 qmake -v
qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
本机没有安装qt
而项目需要依赖:
Dependencies
Qt 4.8.6
Qwt 6.0.0
那就来安装吧:http://www.ai111.vip/thread-1177-1-1.html
不需要外设的驱动:uhd 屏蔽 # find_package(UHD)终于cmake成功啦:
- jiang@jiang-Ubuntu:~/c_c++_works/gr-radar-maint-3.7/build$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
- CMake Deprecation Warning at CMakeLists.txt:24 (cmake_minimum_required):
- Compatibility with CMake < 2.8.12 will be removed from a future version of
- CMake.
- Update the VERSION argument <min> value or use a ...<max> suffix to tell
- CMake that the project does not need compatibility with older versions.
- -- The CXX compiler identification is GNU 7.5.0
- -- The C compiler identification is GNU 7.5.0
- -- Detecting CXX compiler ABI info
- -- Detecting CXX compiler ABI info - done
- -- Check for working CXX compiler: /usr/bin/c++ - skipped
- -- Detecting CXX compile features
- -- Detecting CXX compile features - done
- -- Detecting C compiler ABI info
- -- Detecting C compiler ABI info - done
- -- Check for working C compiler: /usr/bin/cc - skipped
- -- Detecting C compile features
- -- Detecting C compile features - done
- -- Build type not specified: defaulting to release.
- CMake Deprecation Warning at CMakeLists.txt:47 (cmake_policy):
- The OLD behavior for policy CMP0026 will be removed from a future version
- of CMake.
- The cmake-policies(7) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
- CMake Deprecation Warning at CMakeLists.txt:50 (cmake_policy):
- The OLD behavior for policy CMP0043 will be removed from a future version
- of CMake.
- The cmake-policies(7) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
- CMake Deprecation Warning at CMakeLists.txt:53 (cmake_policy):
- The OLD behavior for policy CMP0045 will be removed from a future version
- of CMake.
- The cmake-policies(7) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
- CMake Deprecation Warning at CMakeLists.txt:56 (cmake_policy):
- The OLD behavior for policy CMP0046 will be removed from a future version
- of CMake.
- The cmake-policies(7) manual explains that the OLD behaviors of all
- policies are deprecated and that a policy should be set to OLD only under
- specific short-term circumstances. Projects should be ported to the NEW
- behavior and not rely on setting a policy to OLD.
- -- Found Boost: /usr/include (found suitable version "1.65.1", minimum required is "1.53") found components: filesystem system
- CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
- The package name passed to `find_package_handle_standard_args` (PkgConfig)
- does not match the name of the calling package (CppUnit). This can lead to
- problems in calling code that expects `find_package` result variables
- (e.g., `_FOUND`) to follow a certain pattern.
- Call Stack (most recent call first):
- /usr/local/share/cmake-3.19/Modules/FindPkgConfig.cmake:67 (find_package_handle_standard_args)
- cmake/Modules/FindCppUnit.cmake:12 (INCLUDE)
- CMakeLists.txt:128 (find_package)
- This warning is for project developers. Use -Wno-dev to suppress it.
- -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
- -- Checking for module 'cppunit'
- -- Found cppunit, version 1.14.0
- CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
- The package name passed to `find_package_handle_standard_args` (CPPUNIT)
- does not match the name of the calling package (CppUnit). This can lead to
- problems in calling code that expects `find_package` result variables
- (e.g., `_FOUND`) to follow a certain pattern.
- Call Stack (most recent call first):
- cmake/Modules/FindCppUnit.cmake:35 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
- CMakeLists.txt:128 (find_package)
- This warning is for project developers. Use -Wno-dev to suppress it.
- -- Found CPPUNIT: /usr/lib/x86_64-linux-gnu/libcppunit.so;dl
- -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
- CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
- The package name passed to `find_package_handle_standard_args` (PkgConfig)
- does not match the name of the calling package (FFTW3F). This can lead to
- problems in calling code that expects `find_package` result variables
- (e.g., `_FOUND`) to follow a certain pattern.
- Call Stack (most recent call first):
- /usr/local/share/cmake-3.19/Modules/FindPkgConfig.cmake:67 (find_package_handle_standard_args)
- cmake/Modules/FindFFTW3F.cmake:6 (INCLUDE)
- CMakeLists.txt:130 (find_package)
- This warning is for project developers. Use -Wno-dev to suppress it.
- -- Checking for module 'fftw3f >= 3.0'
- -- Found fftw3f , version 3.3.7
- -- Found FFTW3F: /usr/lib/x86_64-linux-gnu/libfftw3f.so
- -- Looking for Q_WS_X11
- -- Looking for Q_WS_X11 - found
- -- Looking for Q_WS_WIN
- -- Looking for Q_WS_WIN - not found
- -- Looking for Q_WS_QWS
- -- Looking for Q_WS_QWS - not found
- -- Looking for Q_WS_MAC
- -- Looking for Q_WS_MAC - not found
- -- Found Qt4: /usr/bin/qmake (found suitable version "4.8.7", minimum required is "4.2.0")
- -- QWT Version: 6.1.3
- -- Found Qwt: /usr/lib/libqwt.so (Required is at least version "6.0.0")
- CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
- The package name passed to `find_package_handle_standard_args` (PkgConfig)
- does not match the name of the calling package (Gnuradio). This can lead
- to problems in calling code that expects `find_package` result variables
- (e.g., `_FOUND`) to follow a certain pattern.
- Call Stack (most recent call first):
- /usr/local/share/cmake-3.19/Modules/FindPkgConfig.cmake:67 (find_package_handle_standard_args)
- /usr/lib/x86_64-linux-gnu/cmake/gnuradio/GnuradioConfig.cmake:20 (INCLUDE)
- CMakeLists.txt:140 (find_package)
- This warning is for project developers. Use -Wno-dev to suppress it.
- Checking for GNU Radio Module: RUNTIME
- -- Checking for module 'gnuradio-runtime'
- -- Found gnuradio-runtime, version 3.7.11
- * INCLUDES=/usr/include
- * LIBS=/usr/lib/x86_64-linux-gnu/libgnuradio-runtime.so;/usr/lib/x86_64-linux-gnu/libgnuradio-pmt.so;/usr/lib/x86_64-linux-gnu/liblog4cpp.so
- CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
- The package name passed to `find_package_handle_standard_args`
- (GNURADIO_RUNTIME) does not match the name of the calling package
- (Gnuradio). This can lead to problems in calling code that expects
- `find_package` result variables (e.g., `_FOUND`) to follow a certain
- pattern.
- Call Stack (most recent call first):
- /usr/lib/x86_64-linux-gnu/cmake/gnuradio/GnuradioConfig.cmake:108 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
- /usr/lib/x86_64-linux-gnu/cmake/gnuradio/GnuradioConfig.cmake:121 (GR_MODULE)
- CMakeLists.txt:140 (find_package)
- This warning is for project developers. Use -Wno-dev to suppress it.
- -- Found GNURADIO_RUNTIME: /usr/lib/x86_64-linux-gnu/libgnuradio-runtime.so;/usr/lib/x86_64-linux-gnu/libgnuradio-pmt.so;/usr/lib/x86_64-linux-gnu/liblog4cpp.so
- GNURADIO_RUNTIME_FOUND = TRUE
- --
- -- Checking for module SWIG
- -- Found SWIG version 4.0.2.
- -- Found SWIG: /home/jiang/softwares/my_swig/bin/swig
- -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.17", minimum required is "2")
- -- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2")
- -- Looking for sys/types.h
- -- Looking for sys/types.h - found
- -- Looking for stdint.h
- -- Looking for stdint.h - found
- -- Looking for stddef.h
- -- Looking for stddef.h - found
- -- Check size of size_t
- -- Check size of size_t - done
- -- Check size of unsigned int
- -- Check size of unsigned int - done
- -- Performing Test HAVE_WNO_UNUSED_BUT_SET_VARIABLE
- -- Performing Test HAVE_WNO_UNUSED_BUT_SET_VARIABLE - Success
- -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
- -- Configuring done
- -- Generating done
- -- Build files have been written to: /home/jiang/c_c++_works/gr-radar-maint-3.7/build
- jiang@jiang-Ubuntu:~/c_c++_works/gr-radar-maint-3.7/build$
复制代码
make后又报错:
[ 36%] Building CXX object lib/CMakeFiles/gnuradio-radar.dir/usrp_echotimer_cc_impl.cc.o
In file included from /home/jiang/c_c++_works/gr-radar-maint-3.7/lib/usrp_echotimer_cc_impl.cc:26:0:
/home/jiang/c_c++_works/gr-radar-maint-3.7/lib/usrp_echotimer_cc_impl.h:26:10: fatal error: uhd/utils/thread_priority.hpp: 没有那个文件或目录
#include <uhd/utils/thread_priority.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
lib/CMakeFiles/gnuradio-radar.dir/build.make:317: recipe for target 'lib/CMakeFiles/gnuradio-radar.dir/usrp_echotimer_cc_impl.cc.o' failed
make[2]: *** [lib/CMakeFiles/gnuradio-radar.dir/usrp_echotimer_cc_impl.cc.o] Error 1
CMakeFiles/Makefile2:302: recipe for target 'lib/CMakeFiles/gnuradio-radar.dir/all' failed
make[1]: *** [lib/CMakeFiles/gnuradio-radar.dir/all] Error 2
Makefile:159: recipe for target 'all' failed
make: *** [all] Error 2
由于我没有usrp的外设,所以根本不需要编译:
把文件gr-radar-maint-3.7/lib/usrp_echotimer_cc_impl.cc usrp_echotimer_cc_impl.h 去掉
同时 lib/CMakeLists.txt文件里也得去掉带 usrp的
再重新 cmake -DCMAKE_INSTALL_PREFIX=/usr .. 和 make 即可成功!
运行ctest又报错了,看图
jiang@jiang-Ubuntu:~/c_c++_works/gr-radar-maint-3.7/build$ sudo ./../examples/setup/setup_core
[sudo] jiang 的密码:
net.core.rmem_max = 50000000
net.core.wmem_max = 1048576
kernel.shmmax = 2147483648
All changes will be resetted after reboot
需要重启系统 sudo shutdown -r now
ctest还是报错了,以后再定位问题!
强制先安装:
sudo make install
后在gnu Radio上可以看到雷达工具箱!
但是打开作者提供的grc例子,gnuradio直接退出!真是心累!
分析可能的原因:
1、系统环境与作者不一致,版本(Ubuntu、gnuradio、qt等)必须匹配,另外电脑上尝试
2、是否与没有驱动usrp外设有关,感觉关系不大
3、深入cmake语法,重点关注ctest的报错是什么?来源在哪里?才好定位问题
12: Test timeout computed to be: 10000000
12: Segmentation fault (core dumped)
- when I try following: 'ctest -V -R qa_estimator_fmcw' and 'ctest -V -R qa_tracking_singletarget'
- 这样可以看更详细的失败原因了:
- dfy888@Dfy888-Ubuntu:~/dfy_c_c++/gr-radar-master/build$ ctest -V -R qa_estimator_fmcw
- UpdateCTestConfiguration from :/home/dfy888/dfy_c_c++/gr-radar-master/build/DartConfiguration.tcl
- UpdateCTestConfiguration from :/home/dfy888/dfy_c_c++/gr-radar-master/build/DartConfiguration.tcl
- Test project /home/dfy888/dfy_c_c++/gr-radar-master/build
- Constructing a list of tests
- Done constructing a list of tests
- Updating test list for fixtures
- Added 0 tests to meet fixture requirements
- Checking test dependency graph...
- Checking test dependency graph end
- test 12
- Start 12: qa_estimator_fmcw
- 12: Test command: /bin/sh "/home/dfy888/dfy_c_c++/gr-radar-master/build/python/qa_estimator_fmcw_test.sh"
- 12: Test timeout computed to be: 10000000
- 12: Segmentation fault (core dumped)
- 1/1 Test #12: qa_estimator_fmcw ................***Failed 0.30 sec
- 0% tests passed, 1 tests failed out of 1
- Total Test time (real) = 0.31 sec
- The following tests FAILED:
- 12 - qa_estimator_fmcw (Failed)
- Errors while running CTest
复制代码
|
|