Stanford Compiler 实验环境配置
课程主页:
https://www.edx.org/course/compilers
课程视频:
https://www.bilibili.com/video/BV1NE411376V?p=20&t=6
参考资料:
https://www.jianshu.com/p/12fbfa8c7489
这次介绍如何在ubuntu下配置Stanford Compiler的实验环境。
实验环境配置
将课程资料下载到ubuntu内:
然后保存在一个英文目录下,其中bin文件夹内包含coolc以及spim的解释器,比如我的位置是
/usr/class/bin
然后修改环境变量:
sudo gedit ~/.bashrc
在最后一行添加如下命令:
export PATH=/usr/class/bin:$PATH
试运行:
qz@qz-virtual-machine:/usr/class/bin$ coolc
Class Main is not defined.
Compilation halted due to static semantic errors.
qz@qz-virtual-machine:/usr/class/bin$ spim
/usr/class/bin/spim: 第 55 行: [: !=:需要一元表达式
SPIM Version 6.5 of January 4, 2003
Copyright 1990-2003 by James R. Larus (larus@cs.wisc.edu).
All Rights Reserved.
See the file README for a full copyright notice.
Loaded: ../lib/trap.handler
(spim)
运行成功。
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Doraemonzzz!
评论
ValineLivere