未能制作'安装gr-mediatools时

时间:2017-04-16 01:22:37

标签: makefile cmake gnuradio

可以从here找到gr-mediatools。结果' cmake':  类似的东西:

Policy CMP0026 is not set: Disallow use of the LOCATION target property
...
get_target_property() called with non-existent target

“制造”失败可能会导致一些问题。我不太了解它。

-- The CXX compiler identification is GNU 5.4.0
-- The C compiler identification is GNU 5.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Build type not specified: defaulting to release.
-- Boost version: 1.58.0
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
Checking for GNU Radio Module: RUNTIME
-- Checking for module 'gnuradio-runtime'
--   Found gnuradio-runtime, version 3.7.9
 * INCLUDES=/usr/include
 * LIBS=/usr/lib/x86_64-linux-gnu/libgnuradio-runtime.so;/usr/lib/x86_64-linux-gnu/libgnuradio-pmt.so
-- Found GNURADIO_RUNTIME: /usr/lib/x86_64-linux-gnu/libgnuradio-runtime.so;/usr/lib/x86_64-linux-gnu/libgnuradio-pmt.so  
GNURADIO_RUNTIME_FOUND = TRUE
Checking for GNU Radio Module: BLOCKS
-- Checking for module 'gnuradio-blocks'
--   Found gnuradio-blocks, version 3.7.9
 * INCLUDES=/usr/include
 * LIBS=/usr/lib/x86_64-linux-gnu/libgnuradio-blocks.so;/usr/lib/x86_64-linux-gnu/libgnuradio-runtime.so;/usr/lib/x86_64-linux-gnu/libgnuradio-pmt.so
-- Found GNURADIO_BLOCKS: /usr/lib/x86_64-linux-gnu/libgnuradio-blocks.so;/usr/lib/x86_64-linux-gnu/libgnuradio-runtime.so;/usr/lib/x86_64-linux-gnu/libgnuradio-pmt.so  
GNURADIO_BLOCKS_FOUND = TRUE
Checking for GNU Radio Module: PMT
-- Checking for module 'gnuradio-runtime'
--   Found gnuradio-runtime, version 3.7.9
 * INCLUDES=/usr/include
 * LIBS=/usr/lib/x86_64-linux-gnu/libgnuradio-runtime.so;/usr/lib/x86_64-linux-gnu/libgnuradio-pmt.so
-- Found GNURADIO_PMT: /usr/lib/x86_64-linux-gnu/libgnuradio-runtime.so;/usr/lib/x86_64-linux-gnu/libgnuradio-pmt.so  
GNURADIO_PMT_FOUND = TRUE
-- 
-- Checking for module SWIG
-- Found SWIG version 3.0.8.
-- Found SWIG: /usr/bin/swig3.0  
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.12", minimum required is "2") 
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.12", minimum required is "2") 
-- Performing Test HAVE_WNO_UNUSED_BUT_SET_VARIABLE
-- Performing Test HAVE_WNO_UNUSED_BUT_SET_VARIABLE - Success
CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/gnuradio/GrTest.cmake:45 (get_target_property):
  Policy CMP0026 is not set: Disallow use of the LOCATION target property.
  Run "cmake --help-policy CMP0026" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  **The LOCATION property should not be read from target "gnuradio-mediatools".
  Use the target name directly with add_custom_command, or use the generator
  expression $<TARGET_FILE>, as appropriate.**

Call Stack (most recent call first):
  python/CMakeLists.txt:44 (GR_ADD_TEST)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/gnuradio/GrTest.cmake:45 (get_target_property):
  Policy CMP0045 is not set: Error on non-existent target in
  get_target_property.  Run "cmake --help-policy CMP0045" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  get_target_property() called with non-existent target "/usr/bin/python2".
Call Stack (most recent call first):
  python/CMakeLists.txt:44 (GR_ADD_TEST)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/gnuradio/GrTest.cmake:45 (get_target_property):
  Policy CMP0045 is not set: Error on non-existent target in
  get_target_property.  Run "cmake --help-policy CMP0045" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  get_target_property() called with non-existent target
  "/home/imatrix/
  RadioML/dataset-master/gr-mediatools-master/python/qa_mediatools_audiosource_s.py".
Call Stack (most recent call first):
  python/CMakeLists.txt:44 (GR_ADD_TEST)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Doxygen: /usr/bin/doxygen (found version "1.8.11") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/build

&#39; make -j4&#39;错误如:'avcodec_alloc_frame'未在此范围内声明,AVStream :: codec'已弃用[-Wdeprecated-declarations]似乎 像那样的&#39; GR-mediatools&#39;它太老了,我应该使用旧的GNUradio吗?我怎么能解决像'AVStream :: codec'被弃用的问题&#39;? 提前谢谢!

Scanning dependencies of target pygen_python_86ad7
Scanning dependencies of target pygen_apps_9a6dd
Scanning dependencies of target mediatools_swig_swig_doc
Scanning dependencies of target gnuradio-mediatools
[  0%] Built target pygen_apps_9a6dd
[  0%] Built target mediatools_swig_swig_doc
[  5%] Generating __init__.pyc
[ 11%] Generating __init__.pyo
Scanning dependencies of target _mediatools_swig_swig_tag
[ 17%] Building CXX object swig/CMakeFiles/_mediatools_swig_swig_tag.dir/_mediatools_swig_swig_tag.cpp.o
[ 23%] Building CXX object lib/CMakeFiles/gnuradio-mediatools.dir/mediatools_audiosource_s.cc.o
[ 29%] Building CXX object lib/CMakeFiles/gnuradio-mediatools.dir/mediatools_audiosource_impl.cc.o
[ 35%] Linking CXX executable _mediatools_swig_swig_tag
[ 35%] Built target pygen_python_86ad7
[ 35%] Built target _mediatools_swig_swig_tag
[ 41%] Generating mediatools_swig.tag
Scanning dependencies of target mediatools_swig_swig_2d0df
[ 47%] Building CXX object swig/CMakeFiles/mediatools_swig_swig_2d0df.dir/mediatools_swig_swig_2d0df.cpp.o
[ 52%] Linking CXX executable mediatools_swig_swig_2d0df
Swig source
[ 52%] Built target mediatools_swig_swig_2d0df
Scanning dependencies of target pygen_swig_52046
[ 58%] Generating mediatools_swig.pyo
[ 64%] Generating mediatools_swig.pyc
[ 70%] Built target pygen_swig_52046
/home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc: In member function ‘bool mediatools_audiosource_impl::open(std::__cxx11::string)’:
/home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:42:58: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
         d_codec_ctx = d_format_ctx->streams[stream_idx]->codec;
                                                          ^
In file included from /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/include/mediatools_audiosource_impl.h:11:0,
                 from /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:1:
/usr/local/include/libavformat/avformat.h:893:21: note: declared here
     AVCodecContext *codec;
                     ^
/home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:42:58: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
         d_codec_ctx = d_format_ctx->streams[stream_idx]->codec;
                                                          ^
In file included from /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/include/mediatools_audiosource_impl.h:11:0,
                 from /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:1:
/usr/local/include/libavformat/avformat.h:893:21: note: declared here
     AVCodecContext *codec;
                     ^
/home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:42:58: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations]
         d_codec_ctx = d_format_ctx->streams[stream_idx]->codec;
                                                          ^
In file included from /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/include/mediatools_audiosource_impl.h:11:0,
                 from /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:1:
/usr/local/include/libavformat/avformat.h:893:21: note: declared here
     AVCodecContext *codec;
                     ^
/home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc: In member function ‘void mediatools_audiosource_impl::readData(std::vector<short int>&)’:
/home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:91:39: error: ‘avcodec_alloc_frame’ was not declared in this scope
         d_frame = avcodec_alloc_frame();
                                       ^
/home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:95:14: warning: ‘int avcodec_decode_audio4(AVCodecContext*, AVFrame*, int*, const AVPacket*)’ is deprecated [-Wdeprecated-declarations]
     int rc = avcodec_decode_audio4(d_codec_ctx, d_frame, &got_frame, &d_packet);   
              ^
In file included from /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/include/mediatools_audiosource_impl.h:10:0,
                 from /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:1:
/usr/local/include/libavcodec/avcodec.h:4817:5: note: declared here
 int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
     ^
/home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:95:14: warning: ‘int avcodec_decode_audio4(AVCodecContext*, AVFrame*, int*, const AVPacket*)’ is deprecated [-Wdeprecated-declarations]
     int rc = avcodec_decode_audio4(d_codec_ctx, d_frame, &got_frame, &d_packet);   
              ^
In file included from /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/include/mediatools_audiosource_impl.h:10:0,
                 from /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:1:
/usr/local/include/libavcodec/avcodec.h:4817:5: note: declared here
 int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
     ^
/home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:95:79: warning: ‘int avcodec_decode_audio4(AVCodecContext*, AVFrame*, int*, const AVPacket*)’ is deprecated [-Wdeprecated-declarations]
     int rc = avcodec_decode_audio4(d_codec_ctx, d_frame, &got_frame, &d_packet);   
                                                                               ^
In file included from /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/include/mediatools_audiosource_impl.h:10:0,
                 from /home/imatrix/ RadioML/dataset-master/gr-mediatools-master/lib/mediatools_audiosource_impl.cc:1:
/usr/local/include/libavcodec/avcodec.h:4817:5: note: declared here
 int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
     ^
lib/CMakeFiles/gnuradio-mediatools.dir/build.make:86: recipe for target 'lib/CMakeFiles/gnuradio-mediatools.dir/mediatools_audiosource_impl.cc.o' failed
make[2]: *** [lib/CMakeFiles/gnuradio-mediatools.dir/mediatools_audiosource_impl.cc.o] Error 1
make[2]: *** Waiting for .. undone....
CMakeFiles/Makefile2:135: recipe for target 'lib/CMakeFiles/gnuradio-mediatools.dir/all' failed
make[1]: *** [lib/CMakeFiles/gnuradio-mediatools.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

1 个答案:

答案 0 :(得分:0)

我需要更改违规行

d_frame = avcodec_alloc_frame();

在mediatools_audiosource_impl.cc中:

d_frame = av_frame_alloc();

我可以在更改后成功安装gr-mediatools。

由于