gpt4 book ai didi

linux - cmake 找不到/usr/include/gnuradio/swig/gnuradio.i

转载 作者:行者123 更新时间:2023-12-03 09:58:26 26 4
gpt4 key购买 nike

我有这样一个文件( ~/Pobrane/multi-rtl/swig/multi_rtl_swig.i ):

/* -*- c++ -*- */

#define MULTI_RTL_API

%include "gnuradio.i" // the common stuff
%include "feval.i"

//load generated python docstrings
%include "multi_rtl_swig_doc.i"

%{
#include "multi_rtl/vector_sink_cn.h"
%}

%include "multi_rtl/vector_sink_cn.h"
GR_SWIG_BLOCK_MAGIC2(multi_rtl, vector_sink_cn);

我在制作过程中收到以下错误:
[ 26%] Swig source multi_rtl_swig.i
Deprecated command line option: -modern. This option is now always on.
~/Pobrane/multi-rtl/swig/multi_rtl_swig.i:5: Error: Unable to find 'gnuradio.i'
~/Pobrane/multi-rtl/swig/multi_rtl_swig.i:6: Error: Unable to find 'feval.i'
make[2]: *** [swig/CMakeFiles/multi_rtl_swig_swig_compilation.dir/build.make:81: swig/CMakeFiles/multi_rtl_swig.dir/multi_rtl_swigPYTHON.stamp] Error 1
make[2]: *** Delete file 'swig/CMakeFiles/multi_rtl_swig.dir/multi_rtl_swigPYTHON.stamp'
make[2]: Opuszczenie katalogu '~/Pobrane/multi-rtl/build'
make[1]: *** [CMakeFiles/Makefile2:407: swig/CMakeFiles/multi_rtl_swig_swig_compilation.dir/all] Błąd 2
make[1]: Opuszczenie katalogu '~/Pobrane/multi-rtl/build'
make: *** [Makefile:158: all] Błąd 2

当然,我在这样的目录中有这些文件:
gnuradio.i - /usr/include/gnuradio/swig/gnuradio.i
feval.i - /usr/include/gnuradio/swig/feval.i

在以下命令期间发生此错误(我从 make VERBOSE=1 命令知道):
cd ~/Pobrane/multi-rtl/build/swig && /usr/bin/cmake -E env SWIG_LIB=/usr/share/swig/4.0.1 /usr/bin/swig -python -fvirtual -modern -keyword -w511 -w314 -relativeimport -module multi_rtl_swig -I~/Pobrane/multi-rtl/lib -I~/Pobrane/multi-rtl/include -I~/Pobrane/multi-rtl/build/lib -I~/Pobrane/multi-rtl/build/include -I/usr/include -I/usr/include -I~/Pobrane/multi-rtl/build/swig -I~/Pobrane/multi-rtl/swig -I/usr/include/python2.7 -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I~/Pobrane/multi-rtl/lib -I~/Pobrane/multi-rtl/include -I~/Pobrane/multi-rtl/build/lib -I~/Pobrane/multi-rtl/build/include -I/usr/include -I/usr/include -I~/Pobrane/multi-rtl/build/swig -I~/Pobrane/multi-rtl/swig -I/usr/include/python2.7 -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -outdir ~/Pobrane/multi-rtl/build/swig -c++ -I~/Pobrane/multi-rtl/lib -I~/Pobrane/multi-rtl/include -I~/Pobrane/multi-rtl/build/lib -I~/Pobrane/multi-rtl/build/include -I/usr/include -o ~/Pobrane/multi-rtl/build/swig/CMakeFiles/multi_rtl_swig.dir/multi_rtl_swigPYTHON_wrap.cxx ~/Pobrane/multi-rtl/swig/multi_rtl_swig.i

我想知道这个错误是从哪里来的,是什么引起的,我该如何解决。

编辑

我知道是什么导致了问题。我使用已弃用的 ${GNURADIO_RUNTIME_INCLUDE_DIRS} 宏。更换后
foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS})
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig)
endforeach(incdir)


list(APPEND GR_SWIG_INCLUDE_DIRS "/usr/local/include/gnuradio/swig")
list(APPEND GR_SWIG_INCLUDE_DIRS "/usr/include/gnuradio/swig")

一切正常。然而,这是一个临时解决方案。如何在 gnuradio 3.8 中实现类似的功能?

最佳答案

正如您发现的,您需要编辑 swig/CMakeLists.txt并替换 foreach将路径添加到 GR_SWIG_INCLUDE_DIRS 的循环变量与

set(GR_SWIG_INCLUDE_DIRS $<TARGET_PROPERTY:gnuradio::runtime_swig,INTERFACE_INCLUDE_DIRECTORIES>)
set(GR_SWIG_TARGET_DEPS gnuradio::runtime_swig)

关于linux - cmake 找不到/usr/include/gnuradio/swig/gnuradio.i,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61018097/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com