我在Ubuntu 18上安装Octave的Communications软件包时遇到问题,我从安装liboctave 开始
sudo apt-get install liboctave-dev
然后我安装了通信包的depency包:
pkg install control-3.1.0.tar.gz
pkg install signal-1.4.0.tar.gz
pkg install communications-1.2.1.tar.gz
当我到达第三个命令时,它给了我这个错误,这可能是由于使用了不推荐使用的代码:
cyclpoly.cc: In function ‘Array<int> filter_gf2(const Array<int>&, const Array<int>&, const Array<int>&,const int&)’: cyclpoly.cc:41:25: warning: ‘octave_idx_type Array<T>::length() const [with T = int; octave_idx_type = int]’ is deprecated: use 'numel' instead [-Wdeprecated-declarations] int x_len = x.length ();
^ In file included from /usr/include/octave-4.2.2/octave/../octave/Sparse.h:37:0,
from /usr/include/octave-4.2.2/octave/../octave/MSparse.h:31,
from /usr/include/octave-4.2.2/octave/../octave/MatrixType.h:29,
from /usr/include/octave-4.2.2/octave/../octave/mx-base.h:30,
from /usr/include/octave-4.2.2/octave/../octave/Matrix.h:32,
from /usr/include/octave-4.2.2/octave/../octave/oct.h:30,
from cyclpoly.cc:24: /usr/include/octave-4.2.2/octave/../octave/Array.h:354:19: note: declared here octave_idx_type length (void) const { return numel (); }
^~~~~~ cyclpoly.cc: In function ‘octave_value_list Fcyclpoly(const octave_value_list&, int)’: cyclpoly.cc:220:55: warning: ‘octave_idx_type Array<T>::length() const [with T = double; octave_idx_type= int]’ is deprecated: use 'numel' instead [-Wdeprecated-declarations]
cyclic_polys.resize (cyclic_polys.length ()+1);
^ In file included from /usr/include/octave-4.2.2/octave/../octave/Sparse.h:37:0,
from /usr/include/octave-4.2.2/octave/../octave/MSparse.h:31,
from /usr/include/octave-4.2.2/octave/../octave/MatrixType.h:29,
from /usr/include/octave-4.2.2/octave/../octave/mx-base.h:30,
from /usr/include/octave-4.2.2/octave/../octave/Matrix.h:32,
from /usr/include/octave-4.2.2/octave/../octave/oct.h:30,
from cyclpoly.cc:24: /usr/include/octave-4.2.2/octave/../octave/Array.h:354:19: note: declared here octave_idx_type length (void) const { return numel (); }
^~~~~~ cyclpoly.cc:221:47: warning: ‘octave_idx_type Array<T>::length() const [with T = double; octave_idx_type= int]’ is deprecated: use 'numel' instead [-Wdeprecated-declarations]
cyclic_polys(cyclic_polys.length ()-1) = (double)i;
^ In file included from /usr/include/octave-4.2.2/octave/../octave/Sparse.h:37:0,
from /usr/include/octave-4.2.2/octave/../octave/MSparse.h:31,
from /usr/include/octave-4.2.2/octave/../octave/MatrixType.h:29,
from /usr/include/octave-4.2.2/octave/../octave/mx-base.h:30,
from /usr/include/octave-4.2.2/octave/../octave/Matrix.h:32,
from /usr/include/octave-4.2.2/octave/../octave/oct.h:30,
from cyclpoly.cc:24: /usr/include/octave-4.2.2/octave/../octave/Array.h:354:19: note: declared here octave_idx_type length (void) const { return numel (); }
^~~~~~ cyclpoly.cc:236:61: warning: ‘octave_idx_type Array<T>::length() const [with T = double; octave_idx_type= int]’ is deprecated: use 'numel' instead [-Wdeprecated-declarations]
cyclic_polys.resize (cyclic_polys.length ()+1);
^ In file included from /usr/include/octave-4.2.2/octave/../octave/Sparse.h:37:0,
from /usr/include/octave-4.2.2/octave/../octave/MSparse.h:31,
from /usr/include/octave-4.2.2/octave/../octave/MatrixType.h:29,
from /usr/include/octave-4.2.2/octave/../octave/mx-base.h:30,
from /usr/include/octave-4.2.2/octave/../octave/Matrix.h:32,
from /usr/include/octave-4.2.2/octave/../octave/oct.h:30,
from cyclpoly.cc:24: /usr/include/octave-4.2.2/octave/../octave/Array.h:354:19: note: declared here octave_idx_type length (void) const { return numel (); }
^~~~~~ cyclpoly.cc:237:53: warning: ‘octave_idx_type Array<T>::length() const [with T = double; octave_idx_type= int]’ is deprecated: use 'numel' instead [-Wdeprecated-declarations]
cyclic_polys(cyclic_polys.length ()-1) = (double)i;
^ In file included from /usr/include/octave-4.2.2/octave/../octave/Sparse.h:37:0,
from /usr/include/octave-4.2.2/octave/../octave/MSparse.h:31,
from /usr/include/octave-4.2.2/octave/../octave/MatrixType.h:29,
from /usr/include/octave-4.2.2/octave/../octave/mx-base.h:30,
from /usr/include/octave-4.2.2/octave/../octave/Matrix.h:32,
from /usr/include/octave-4.2.2/octave/../octave/oct.h:30,
from cyclpoly.cc:24: /usr/include/octave-4.2.2/octave/../octave/Array.h:354:19: note: declared here octave_idx_type length (void) const { return numel (); }
^~~~~~ cyclpoly.cc:247:28: warning: ‘octave_idx_type Array<T>::length() const [with T = double; octave_idx_type= int]’ is deprecated: use 'numel' instead [-Wdeprecated-declarations] if (cyclic_polys.length () == 0)
^ In file included from /usr/include/octave-4.2.2/octave/../octave/Sparse.h:37:0,
from /usr/include/octave-4.2.2/octave/../octave/MSparse.h:31,
from /usr/include/octave-4.2.2/octave/../octave/MatrixType.h:29,
from /usr/include/octave-4.2.2/octave/../octave/mx-base.h:30,
from /usr/include/octave-4.2.2/octave/../octave/Matrix.h:32,
from /usr/include/octave-4.2.2/octave/../octave/oct.h:30,
from cyclpoly.cc:24: /usr/include/octave-4.2.2/octave/../octave/Array.h:354:19: note: declared here octave_idx_type length (void) const { return numel (); }
^~~~~~ cyclpoly.cc:257:46: warning: ‘octave_idx_type Array<T>::length() const [with T = double; octave_idx_type= int]’ is deprecated: use 'numel' instead [-Wdeprecated-declarations]
Matrix polys (cyclic_polys.length (), m+1, 0);
^ In file included from /usr/include/octave-4.2.2/octave/../octave/Sparse.h:37:0,
from /usr/include/octave-4.2.2/octave/../octave/MSparse.h:31,
from /usr/include/octave-4.2.2/octave/../octave/MatrixType.h:29,
from /usr/include/octave-4.2.2/octave/../octave/mx-base.h:30,
from /usr/include/octave-4.2.2/octave/../octave/Matrix.h:32,
from /usr/include/octave-4.2.2/octave/../octave/oct.h:30,
from cyclpoly.cc:24: /usr/include/octave-4.2.2/octave/../octave/Array.h:354:19: note: declared here octave_idx_type length (void) const { return numel (); }
^~~~~~ cyclpoly.cc:258:53: warning: ‘octave_idx_type Array<T>::length() const [with T = double; octave_idx_type= int]’ is deprecated: use 'numel' instead [-Wdeprecated-declarations]
for (int i = 0 ; i < cyclic_polys.length (); i++)
^ In file included from /usr/include/octave-4.2.2/octave/../octave/Sparse.h:37:0,
from /usr/include/octave-4.2.2/octave/../octave/MSparse.h:31,
from /usr/include/octave-4.2.2/octave/../octave/MatrixType.h:29,
from /usr/include/octave-4.2.2/octave/../octave/mx-base.h:30,
from /usr/include/octave-4.2.2/octave/../octave/Matrix.h:32,
from /usr/include/octave-4.2.2/octave/../octave/oct.h:30,
from cyclpoly.cc:24: /usr/include/octave-4.2.2/octave/../octave/Array.h:354:19: note: declared here octave_idx_type length (void) const { return numel (); }
^~~~~~ cyclgen.cc: In function ‘Array<int> filter_gf2(const Array<int>&, const Array<int>&, const Array<int>&, const int&)’: cyclgen.cc:32:25: warning: ‘octave_idx_type Array<T>::length() const [with T = int; octave_idx_type = int]’ is deprecated: use 'numel' instead [-Wdeprecated-declarations] int x_len = x.length ();
^ In file included from /usr/include/octave-4.2.2/octave/../octave/Sparse.h:37:0,
from /usr/include/octave-4.2.2/octave/../octave/MSparse.h:31,
from /usr/include/octave-4.2.2/octave/../octave/MatrixType.h:29,
from /usr/include/octave-4.2.2/octave/../octave/mx-base.h:30,
from /usr/include/octave-4.2.2/octave/../octave/Matrix.h:32,
from /usr/include/octave-4.2.2/octave/../octave/oct.h:30,
from cyclgen.cc:23: /usr/include/octave-4.2.2/octave/../octave/Array.h:354:19: note: declared here octave_idx_type length (void) const { return numel (); }
^~~~~~ In file included from galois.h:24:0,
from galois-def.cc:21: /usr/include/octave-4.2.2/octave/../octave/config.h:28:2: warning:
#warning "config.h has been deprecated; there is no need to include it directly" [-Wcpp] #warning "config.h has been deprecated; there is no need to include it directly" ^~~~~~~ In file included from galois-def.cc:21:0: galois.h:25:10: fatal error: octave/base-lu.h: No such file or directory #include <octave/base-lu.h>
^~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [galois-def.o] Error 1 make: *** Waiting for unfinished jobs.... genqamdemod.cc: In function ‘octave_value_list Fgenqamdemod(const octave_value_list&, int)’: genqamdemod.cc:39:57: warning: ‘int empty_arg(const char*, octave_idx_type, octave_idx_type)’ is deprecated: use 'octave_value::is_empty' instead [-Wdeprecated-declarations] int arg_is_empty1 = empty_arg ("genqamdemod", nr1, nc1);
^ In file included from /usr/include/octave-4.2.2/octave/../octave/oct.h:40:0,
from genqamdemod.cc:17: /usr/include/octave-4.2.2/octave/../octave/utils.h:58:26: note: declared here extern OCTINTERP_API int empty_arg (const char *name, octave_idx_type nr,
^~~~~~~~~ make: Entering directory '/tmp/oct-OcFw19/communications-1.2.1/src' /usr/bin/mkoctfile
-DGALOIS_DISP_PRIVATES -DHAVE_OCTAVE_HDF5_ID_TYPE=1 __errcore__.cc -o __errcore__.oct /usr/bin/mkoctfile -DGALOIS_DISP_PRIVATES -DHAVE_OCTAVE_HDF5_ID_TYPE=1 __gfweight__.cc -o __gfweight__.oct /usr/bin/mkoctfile -DGALOIS_DISP_PRIVATES -DHAVE_OCTAVE_HDF5_ID_TYPE=1 cyclgen.cc -o cyclgen.oct /usr/bin/mkoctfile -DGALOIS_DISP_PRIVATES
-DHAVE_OCTAVE_HDF5_ID_TYPE=1 cyclpoly.cc -o cyclpoly.oct /usr/bin/mkoctfile -DGALOIS_DISP_PRIVATES -DHAVE_OCTAVE_HDF5_ID_TYPE=1 genqamdemod.cc -o genqamdemod.oct /usr/bin/mkoctfile
-DGALOIS_DISP_PRIVATES -DHAVE_OCTAVE_HDF5_ID_TYPE=1 -c galois-def.cc -o galois-def.o Makefile:45: recipe for target 'galois-def.o' failed make: Leaving directory '/tmp/oct-OcFw19/communications-1.2.1/src'
pkg: error running `make' for the communications package. error: called from
configure_make at line 95 column 9
install at line 194 column 7
pkg at line 394 column 9
有人能帮忙吗?
也许您可以尝试使用以下命令从ubuntu的终端安装communications package
。
sudo apt-get update
sudo apt-get install octave-communications
检查一下:
>> pkg list
Package Name | Version | Installation directory
----------------+---------+-----------------------
communications *| 1.2.1 | /usr/share/octave/packages/communications-1.2.1
control *| 3.2.0 | /home/hugo/octave/control-3.2.0
signal | 1.4.1 | /home/hugo/octave/signal-1.4.1
然后尝试使用它,它就会工作:>> pkg load communications
似乎已经进行了一些重构,需要更新通信包。理论上,这似乎是一个简单的解决方案。您可以联系Mike Miller(软件包页面中指定的维护人员:https://octave.sourceforge.io/communications/index.html(并告知他们,或者您可以尝试自己重命名上述函数。