不再维护 SR 编程语言,因此我意识到在这个问题上寻求帮助的机会可能很小。但是,我需要为类目的安装语言,并且想不出如何继续。
这是网络上关于该语言的看似唯一的信息来源 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
最佳答案
“SR”:旧文件 → → 2001 年!
“SR”在 gcc 3.2.3 版或 gcc 3.4.6 版中编译正常( 编辑文件“配置”。 ( Ubuntu 14.04 没有 gcc32)。)
# make install
: 提供/usr/local/bin/sr
附言: gcc34 可用于 Ubuntu 14.04 : compat-gcc34-3.4.6-ubuntu1204-1_amd64.deb,或compat-gcc34_3.4.6-ubuntu15_i386.deb
关于c++ - Sr 编程语言安装在 Ubuntu 14.04 编译器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34045347/