-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from yuyan-lang/continue_to_compilation
新的运行时环境
- Loading branch information
Showing
93 changed files
with
1,446 additions
and
1,663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# .github/actions/install-mac-dependencies/action.yml | ||
|
||
name: 'Install Linux Software' | ||
description: 'Installs Linux Yuyan Dependencies' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install the libraries | ||
run: | | ||
sudo apt install make llvm clang libgmp-dev | ||
sudo apt install libgc-dev libuv1-dev llvm libbsd-dev | ||
shell: bash | ||
- name: Download yy_bs from | ||
run: | | ||
curl -o yy_bs -L https://github.com/yuyan-lang/yuyan/releases/download/v0.1.0rc1.4/yy_bs_bs | ||
curl -o ./运行时支持库/libyyrtoptv0.1.0rc2+0016.so -L https://github.com/yuyan-lang/yuyan/releases/download/v0.1.0rc1.4/libyyrtoptv0.1.0rc2+0016.so | ||
curl -o ./运行时支持库/libyyrtdebugv0.1.0rc2+0016.so -L https://github.com/yuyan-lang/yuyan/releases/download/v0.1.0rc1.4/libyyrtdebugv0.1.0rc2+0016.so | ||
chmod u+x yy_bs | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,4 +187,5 @@ dist | |
*.bc | ||
*.dylib | ||
callgrind.out.* | ||
cachegrind.out.* | ||
cachegrind.out.* | ||
.yybuild.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,47 @@ | ||
|
||
# 从源代码编译 | ||
# 编译豫言编译器 | ||
|
||
## Mac | ||
(目前仅支持`Ubuntu/Linux`,Mac的支持会在后续版本中添加) | ||
|
||
1. 克隆本仓库 | ||
2. 安装依赖库 | ||
1. 安装标准构建工具依赖 | ||
``` | ||
brew install bdw-gc libuv mlton matplotplusplus llvm | ||
sudo apt install make clang llvm python3-dev libuv1-dev | ||
``` | ||
3. 安装 | ||
|
||
2. 从`Releases`界面下载可运行程序,目前可以运行在`22.04 LTS`版本的系统上 | ||
|
||
可执行文件为: | ||
``` | ||
make | ||
make install | ||
chmod u+x yy_bs_bs | ||
``` | ||
|
||
依赖库文件`libyyrt<debug/opt>+XXXX.a`或者`libyyrt<debug/opt>+XXXX.so`需要放在`./运行时支持库`里 | ||
|
||
若要使用标准库,可以将源码文件中的`./yylib`文件夹拷贝到当前工作目录下。 | ||
|
||
在当前工作目录下创建一个豫言文件,拓展名为`.yuyan`或`。豫`。 | ||
|
||
## Linux (Ubuntu) | ||
3. 编写并运行文件 | ||
|
||
1. 克隆本仓库 | ||
2. 安装依赖库 | ||
|
||
可以使用一下命令编译 | ||
``` | ||
sudo apt install libgc-dev libuv1-dev libbsd-dev llvm | ||
./yy_bs_bs <文件名> -c -o a.out | ||
``` | ||
3. 安装MLton | ||
http://mlton.org | ||
|
||
4. 安装其他依赖(现阶段安装无法运行,之后会改) | ||
+ MatPlot++ | ||
https://alandefreitas.github.io/matplotplusplus/ | ||
|
||
5. 安装 | ||
然后编译文件可以运行 | ||
``` | ||
make | ||
make install | ||
./a.out | ||
``` | ||
|
||
## Windows | ||
一些常用的命令行参数 | ||
+ `-o <path>` 生成可执行文件路径 | ||
+ `-c` 仅编译而不执行 | ||
+ `--parallel` 使用并行编译,需要拷贝`parallel_compile.py`到项目根目录下 | ||
+ `--static-linking` 使用静态链接 | ||
+ `--optimize`使用LLVM的全局优化和链接时优化 | ||
|
||
4. 关于语法高亮 | ||
|
||
请暂时用Cygwin或者Windows Subsystem for Linux运行。 | ||
目前`yy_bs_bs`还不支持VSCode插件的语法高亮,需要从SML源代码编译出`./yy`的可执行文件才行。需要安装`mlton`(http://mlton.org)之后`make yy`来编译文件。 | ||
|
Oops, something went wrong.