2015-12-02 39 views
0

SR编程语言不再被维护,所以我意识到我在这个问题上寻找帮助的机会可能很渺茫。但是,我需要为教室安装语言,并且无法考虑如何继续。高级编程语言在Ubuntu 14.04上安装编译器错误

下面是在网络上关于语言 http://www.cs.arizona.edu/sr/

的安装包提供了一个Makefile安装的信息看似唯一来源。然而,运行以下:

mkdir /usr/local/src/sr 
cd /usr/local/src/sr 
wget ftp://ftp.cs.arizona.edu/sr/sr.tar.Z 
tar xzf sr.tar.Z 
make 

导致这些错误

echo "#"    >paths.sh 
echo "# Created mechanically; DO NOT EDIT THIS FILE." >>paths.sh 
echo "#"    >>paths.sh 
sed -n >>paths.sh <Configuration \ 
    -e 's/#.*//' -e 's/[ ]*$//' -e 's/ *= */=/' \ 
    -e 's/="*\(.* [^"]*\)"*$/="\1"/' -e '/^[A-Z0-9_]* *=/p' 
echo ""    >>paths.sh 
echo >paths.tmp '/*' 
echo >>paths.tmp ' * Created mechanically; DO NOT EDIT THIS FILE.' 
echo >>paths.tmp ' */' 
sed >>paths.tmp <paths.sh \ 
     -n -e 's/"//g' -e 's/.*/#define &"/' -e 's/= */ "/p' 
if cmp -s paths.tmp paths.h; then :; else cp paths.tmp paths.h; fi 
cc -g  -c -o util.o util.c 
util.c: In function ‘salloc’: 
util.c:79:27: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default] 
    return strcpy (alloc (strlen (s) + 1), s); 
         ^
util.c: In function ‘strtail’: 
util.c:94:14: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default] 
    int ls = strlen (s); 
      ^
util.c: In function ‘setpath’: 
util.c:221:25: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default] 
    searchpath = alloc (strlen (evpath) + strlen (ifdir) + 100); 
         ^
cmp -s multi/uni.h srmulti.h || cp multi/uni.h srmulti.h 
cmp -s multi/uni.c srmulti.c || cp multi/uni.c srmulti.c 
cd sr; make CC="cc" CFLAGS="-g " 
make[1]: Entering directory `/usr/local/src/sr/sr' 
cc -g  -c -o main.o main.c 
In file included from main.c:7:0: 
../arch.h:147:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘--’ token 
    ERROR -- no architecture selected 
     ^
main.c:114:1: warning: conflicting types for ‘options’ [enabled by default] 
options (argc, argv) 
^ 
main.c:114:1: error: static declaration of ‘options’ follows non-static declaration 
main.c:53:5: note: previous implicit declaration of ‘options’ was here 
    options (argc, argv); /* process options */ 
    ^
make[1]: *** [main.o] Error 1 
make[1]: Leaving directory `/usr/local/src/sr/sr' 
make: *** [all] Error 2 

我想,这可能是与我所用的编译版中的问题。 gcc -v返回gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04),并且安装文件似乎是在早期版本上编译的。我尝试安装早期版本的gcc,使gcc -v产生gcc version 3.4.6 (Debian 3.4.6-5),但遇到了类似但不同的编译器错误。也许我做了降级安装的问题,因为它看起来很奇怪,它说Debian 3.4.6-5

该软件包还提供了一个install.sh文件。试图

chmod +x /usr/local/src/sr/install.sh 
/usr/local/src/sr/install.sh 

返回如下:

+ cp sr/sr /usr/local/bin 
cp: cannot stat ‘sr/sr’: No such file or directory 
+ strip /usr/local/bin/sr 
strip: Warning: '/usr/local/bin/sr' is not an ordinary file 
+ cp srl/srl /usr/local/bin 
cp: cannot stat ‘srl/srl’: No such file or directory 
+ strip /usr/local/bin/srl 
strip: Warning: '/usr/local/bin/srl' is not an ordinary file 
+ cp srm/srm /usr/local/bin 
cp: cannot stat ‘srm/srm’: No such file or directory 
+ strip /usr/local/bin/srm 
strip: Warning: '/usr/local/bin/srm' is not an ordinary file 
+ cp srprof/srprof /usr/local/bin 
cp: cannot stat ‘srprof/srprof’: No such file or directory 
+ strip /usr/local/bin/srprof 
strip: Warning: '/usr/local/bin/srprof' is not an ordinary file 
+ cp srtex/srtex /usr/local/bin 
cp: cannot stat ‘srtex/srtex’: No such file or directory 
+ strip /usr/local/bin/srtex 
strip: Warning: '/usr/local/bin/srtex' is not an ordinary file 
+ cp srlatex/srlatex /usr/local/bin 
cp: cannot stat ‘srlatex/srlatex’: No such file or directory 
+ strip /usr/local/bin/srlatex 
strip: Warning: '/usr/local/bin/srlatex' is not an ordinary file 
+ cp srgrind/srgrind /usr/local/bin 
cp: cannot stat ‘srgrind/srgrind’: No such file or directory 
+ cp preproc/*2sr /usr/local/bin 
cp: cannot stat ‘preproc/*2sr’: No such file or directory 
+ cp sr.h /usr/local/lib/sr 
+ cp srmulti.h /usr/local/lib/sr 
+ cp rts/srlib.a /usr/local/lib/sr 
cp: cannot stat ‘rts/srlib.a’: No such file or directory 
+ [ -f /bin/ranlib -o -f /usr/bin/ranlib ] 
+ ranlib /usr/local/lib/sr/srlib.a 
ranlib: '/usr/local/lib/sr/srlib.a': No such file 
+ cp library/*.o /usr/local/lib/sr 
cp: cannot stat ‘library/*.o’: No such file or directory 
+ cp library/*.spec /usr/local/lib/sr 
cp: cannot stat ‘library/*.spec’: No such file or directory 
+ cp library/*.impl /usr/local/lib/sr 
cp: cannot stat ‘library/*.impl’: No such file or directory 
+ cp srmap /usr/local/lib/sr 
+ cp rts/srx /usr/local/lib/sr 
cp: cannot stat ‘rts/srx’: No such file or directory 
+ strip /usr/local/lib/sr/srx 
strip: '/usr/local/lib/sr/srx': No such file 
+ cp srlatex/srlatex.sty /usr/local/lib/sr 
+ cp preproc/ccr2sr.h preproc/csp2sr.h preproc/m2sr.h /usr/local/lib/sr 
+ cp sr-mode.el /usr/local/lib/sr 
+ [ ! -z /usr/man/manl -a -d /usr/man/manl -a ! -z l ] 
+ echo not installing man pages for commands 
not installing man pages for commands 
+ [ ! -z /usr/man/manl -a -d /usr/man/manl -a ! -z l ] 
+ echo not installing sranimator/srgetopt/srwin man pages 
not installing sranimator/srgetopt/srwin man pages 
+ [ ! -z /usr/man/manl -a -d /usr/man/manl -a ! -z l ] 
+ echo not installing srmap/srtrace man pages 
not installing srmap/srtrace man pages 
+ exit 0 

并没有任何反应。

任何人都可以理解这些错误,或者至少提供关于如何进行的建议吗?这可能看起来很无用,因为这种语言在十年内还没有被保留下来,但任何建议都会帮助我大大超出。

谢谢

更新: 我的同事提供这些更改./Configuration文件:

sed -i -e "s:/usr/local:/usr:" -e "s:/usr/X11/lib:/usr/lib:" \ 
    -e "s:CCPATH = /bin/cc:CCPATH = /usr/bin/gcc" \ 
    -e "s:RSHPATH = /usr/ucb/rsh:RSHPATH = /usr/bin/ssh:" \ 
    -e "s:VFPATH = /usr/lib/vfontedpr:VFPATH = :" Configuration 

在此之后对GCC 4.8.4运行make

cmp -s multi/uni.h srmulti.h || cp multi/uni.h srmulti.h 
cmp -s multi/uni.c srmulti.c || cp multi/uni.c srmulti.c 
cd sr;  make CC="cc" CFLAGS="-g " 
make[1]: Entering directory `/usr/local/src/sr/sr' 
cc -g  -c -o main.o main.c 
In file included from main.c:7:0: 
../arch.h:147:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘--’ token 
    ERROR -- no architecture selected 
     ^
main.c:114:1: warning: conflicting types for ‘options’ [enabled by default] 
options (argc, argv) 
^ 
main.c:114:1: error: static declaration of ‘options’ follows non-static declaration 
main.c:53:5: note: previous implicit declaration of ‘options’ was here 
    options (argc, argv); /* process options */ 
    ^
make[1]: *** [main.o] Error 1 
make[1]: Leaving directory `/usr/local/src/sr/sr' 
make: *** [all] Error 2 

它摆脱了最初的路径问题,但编译器问题仍然在那里。

用gcc 3.4它给

cmp -s multi/uni.h srmulti.h || cp multi/uni.h srmulti.h 
cmp -s multi/uni.c srmulti.c || cp multi/uni.c srmulti.c 
cd sr;  make CC="cc" CFLAGS="-g " 
make[1]: Entering directory `/usr/local/src/sr/sr' 
cc -g  -c -o main.o main.c 
In file included from main.c:7: 
../arch.h:147: error: syntax error before '--' token 
main.c:115: error: conflicting types for 'options' 
main.c:53: error: previous implicit declaration of 'options' was here 
make[1]: *** [main.o] Error 1 
make[1]: Leaving directory `/usr/local/src/sr/sr' 
make: *** [all] Error 2 
+1

粗略的估计:'。/configure'先? – Olaf

+0

@Olaf是的,谢谢,我忘了提及。有一个./Configuration文件是我的同事提供的替代文件。我将编辑第一篇文章以包含此内容。 – Beyayfivay

+0

您是否熟悉C和Linux?如果没有,请尝试从熟悉这两者的人那里获得帮助。我想这对他来说会很简单。很可能,他将能够使用*最近的* GCC编译器安装SR(通常在你的发行版中) –

回答

1

“SR”:旧文件→→2001年度!

“SR” 编译使用gcc 3.2.3版或gcc版本3.4.6( 编辑文件 '配置'( 没有gcc32为Ubuntu 14.04)。)

# make install OK:提供在/ usr/local/bin/sr

PS:gcc34表示可对Ubuntu 14.04: COMPAT-gcc34-3.4.6-ubuntu1204-1_ AMD64 .deb文件,或COMPAT-gcc34_3.4.6-ubuntu15_ I386 .deb文件