本文介绍了在ubuntu16.04(x86_64)上安装SPro的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SPro 可以在此处下载,并通过./configure、make,进行安装.但是,./configure并引起两个错误.

SPro can be downloaded here,and it's installed by ./configure, make, make install. However, ./configure and make both arouse errors.

首先,运行./configure,得到以下警告:

First, run ./configure, get the following warnings:

总输出如下:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/large_dsk/share/upload/spro-5.0/spro-5.0/auxdir/missing: Unknown `--run' option
Try `/large_dsk/share/upload/spro-5.0/spro-5.0/auxdir/missing --help' for more information
configure: WARNING: `missing' script is too old or missing
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for AIX... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking for library containing strerror... none required
checking for function prototypes... yes
checking for string.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking for size_t... yes
checking for char... yes
checking size of char... 1
checking for short... yes
checking size of short... 2
checking for long... yes
checking size of long... 8
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking for stdlib.h... (cached) yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking for string.h... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for vprintf... yes
checking for _doprnt... no
configure: checking for gcc warning options...
... -Wbad-function-cast
... -Wcast-align
... -Wmissing-declarations
... -Wmissing-prototypes
... -Wnested-externs
... -Wpointer-arith
... -Wshadow
... -Wstrict-prototypes
... -Wwrite-strings
checking if malloc debugging is wanted... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating auxdir/Makefile
config.status: creating test/Makefile
config.status: creating test/ref/Makefile
config.status: creating test/dat/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

第二,运行make时,出现以下错误:我搜索了此错误,并获得了在gcc命令中添加-lm的方法,但似乎不起作用.总输出如下:

Second, when run the make, get the following errors:I searched this error, and get the method that add -lm in gcc command, but seemly it doesn't work.And the total ouput is as following:

那么我应该先安装一些库还是gcc版本不正确?我的gcc版本是gcc 5.4.0.

So should I install some libs first or the gcc version is not right? my gcc version is gcc 5.4.0.

make  all-recursive
make[1]: Entering directory '/large_dsk/share/upload/spro-5.0/spro-5.0'
Making all in doc
make[2]: Entering directory '/large_dsk/share/upload/spro-5.0/spro-5.0/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/large_dsk/share/upload/spro-5.0/spro-5.0/doc'
Making all in auxdir
make[2]: Entering directory '/large_dsk/share/upload/spro-5.0/spro-5.0/auxdir'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/large_dsk/share/upload/spro-5.0/spro-5.0/auxdir'
Making all in test
make[2]: Entering directory '/large_dsk/share/upload/spro-5.0/spro-5.0/test'
Making all in ref
make[3]: Entering directory '/large_dsk/share/upload/spro-5.0/spro-5.0/test/ref'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/large_dsk/share/upload/spro-5.0/spro-5.0/test/ref'
Making all in dat
make[3]: Entering directory '/large_dsk/share/upload/spro-5.0/spro-5.0/test/dat'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/large_dsk/share/upload/spro-5.0/spro-5.0/test/dat'
make[3]: Entering directory '/large_dsk/share/upload/spro-5.0/spro-5.0/test'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/large_dsk/share/upload/spro-5.0/spro-5.0/test'
make[2]: Leaving directory '/large_dsk/share/upload/spro-5.0/spro-5.0/test'
make[2]: Entering directory '/large_dsk/share/upload/spro-5.0/spro-5.0'
if gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -MT sig.o -MD -MP -MF ".deps/sig.Tpo" -c -o sig.o sig.c; \
then mv -f ".deps/sig.Tpo" ".deps/sig.Po"; else rm -f ".deps/sig.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -MT spf.o -MD -MP -MF ".deps/spf.Tpo" -c -o spf.o spf.c; \
then mv -f ".deps/spf.Tpo" ".deps/spf.Po"; else rm -f ".deps/spf.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -MT header.o -MD -MP -MF ".deps/header.Tpo" -c -o header.o header.c; \
then mv -f ".deps/header.Tpo" ".deps/header.Po"; else rm -f ".deps/header.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -MT misc.o -MD -MP -MF ".deps/misc.Tpo" -c -o misc.o misc.c; \
then mv -f ".deps/misc.Tpo" ".deps/misc.Po"; else rm -f ".deps/misc.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -MT lpc.o -MD -MP -MF ".deps/lpc.Tpo" -c -o lpc.o lpc.c; \
then mv -f ".deps/lpc.Tpo" ".deps/lpc.Po"; else rm -f ".deps/lpc.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -MT convert.o -MD -MP -MF ".deps/convert.Tpo" -c -o convert.o convert.c; \
then mv -f ".deps/convert.Tpo" ".deps/convert.Po"; else rm -f ".deps/convert.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -MT fft.o -MD -MP -MF ".deps/fft.Tpo" -c -o fft.o fft.c; \
then mv -f ".deps/fft.Tpo" ".deps/fft.Po"; else rm -f ".deps/fft.Tpo"; exit 1; fi
rm -f libspro.a
ar cru libspro.a sig.o spf.o header.o misc.o lpc.o convert.o fft.o
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib libspro.a
if gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -MT scopy.o -MD -MP -MF ".deps/scopy.Tpo" -c -o scopy.o scopy.c; \
then mv -f ".deps/scopy.Tpo" ".deps/scopy.Po"; else rm -f ".deps/scopy.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -MT gggetopt.o -MD -MP -MF ".deps/gggetopt.Tpo" -c -o gggetopt.o gggetopt.c; \
then mv -f ".deps/gggetopt.Tpo" ".deps/gggetopt.Po"; else rm -f ".deps/gggetopt.Tpo"; exit 1; fi
gggetopt.c: In function \u2018_getopt_long\u2019:
gggetopt.c:442:12: warning: implicit declaration of function \u2018strcmp\u2019 [-Wimplicit-function-declaration]
       if ( strcmp(optarg, "--") == 0 ) {
            ^
gcc  -g -O2   -o scopy  scopy.o gggetopt.o -lm -L. -lspro
./libspro.a(misc.o): In function `spf_buf_normalize':
/large_dsk/share/upload/spro-5.0/spro-5.0/misc.c:278: undefined reference to `sqrt'
/large_dsk/share/upload/spro-5.0/spro-5.0/misc.c:187: undefined reference to `sqrt'
./libspro.a(misc.o): In function `set_lifter':
/large_dsk/share/upload/spro-5.0/spro-5.0/misc.c:408: undefined reference to `sin'
./libspro.a(misc.o): In function `sig_normalize':
/large_dsk/share/upload/spro-5.0/spro-5.0/misc.c:431: undefined reference to `sqrt'
./libspro.a(misc.o): In function `set_sig_win':
/large_dsk/share/upload/spro-5.0/spro-5.0/misc.c:464: undefined reference to `cos'
/large_dsk/share/upload/spro-5.0/spro-5.0/misc.c:479: undefined reference to `cos'
/large_dsk/share/upload/spro-5.0/spro-5.0/misc.c:479: undefined reference to `cos'
/large_dsk/share/upload/spro-5.0/spro-5.0/misc.c:471: undefined reference to `cos'
collect2: error: ld returned 1 exit status
Makefile:353: recipe for target 'scopy' failed
make[2]: *** [scopy] Error 1
make[2]: Leaving directory '/large_dsk/share/upload/spro-5.0/spro-5.0'
Makefile:432: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/large_dsk/share/upload/spro-5.0/spro-5.0'
Makefile:236: recipe for target 'all' failed
make: *** [all] Error 2

推荐答案

我认为构建脚本是错误的:

I think the build script is just wrong:

gcc  -g -O2   -o scopy  scopy.o gggetopt.o -lm -L. -lspro

由于-lspro使用-lm中的功能,因此它必须排在第一位. 请参阅此答案以了解某些背景.

Since -lspro uses functions from -lm, it has to come first. See this answer for some background.

这篇关于在ubuntu16.04(x86_64)上安装SPro的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 17:35