# taihe_wiki **Repository Path**: hhermanwang/taihe_wiki ## Basic Information - **Project Name**: taihe_wiki - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 2 - **Created**: 2025-04-16 - **Last Updated**: 2025-04-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 1. 配置蓝区基本环境:安装WSL2 可参考: https://blog.csdn.net/weixin_54954007/article/details/143646560 或 https://blog.csdn.net/nanzhanfei/article/details/121951919 建议安装Ubuntu 22.04 ![输入图片说明](pic/ubuntuimage.png) ### 2. Taihe taihe gitee地址: https://gitee.com/asanrocks/taihe README: https://gitee.com/asanrocks/taihe/blob/main/README.md #### Taihe环境配置: 1. 在WSL上下载代码仓: `git clone -b main https://gitee.com/asanrocks/taihe.git taihe` > 如果代码之前已经存在,请先用git pull更新。后续如要向这个仓贡献代码时,就fork这个仓,然后提交Pull Request。 2. 在taihe代码仓根目录执行: **安装环境** :`sudo ./scripts/install-ubuntu-deps` > install-ubuntu-deps脚本中会配置apt镜像源、pip镜像源,安装python、pip、virtualenv、antlr4、poetry等必备工具,并通过generate-grammar生成Taihe核心组件。接下来就可以激活环境并执行相应的用例了。 如果遇到Java/JNI相关报错,请先删除当前环境中的Java,再重新执行此脚本。 **激活环境** :`source ./compiler/.venv/bin/activate` **执行用例** :`./compiler/run-test cookbook/hello_ani/ -ani` 最后输出: ``` hello hello_ani main 3 ``` 并且代码仓中生成了: ![输入图片说明](pic/cookimage.png) 说明执行OK。 --- 执行其他用例:`./compiler/run-test test/string` (此测试结果暂时有问题,请忽略此测试) 执行结果简单示意: ``` (.venv) whqwe@whqwe:~/th_0312/taihe$ ./compiler/run-test test/string Generating author codes... Done. Generating user codes... Done. Compiling to dynamic link library... ...(省略) Done. Compiling to executable file... ...(省略) Done. Done. Running... + test/string/build/test Please input string a: abc Please input string b: qwe a + b = abcqwe Please input a number n: 1 n = 1 a[:n] = a a[n:] = bc b[:n] = q b[n:] = we ``` ### 3. 下载和编译运行ArkTS演进版代码 蓝区本地编译,请参考:[gitee Wiki链接](https://gitee.com/JianfeiLee/arkcompiler_runtime_core/wikis/%E4%B8%8B%E8%BD%BD%E5%92%8C%E7%BC%96%E8%AF%91%E8%BF%90%E8%A1%8CArkTS%E6%BC%94%E8%BF%9B%E7%89%88%E4%BB%A3%E7%A0%81) ps. 暂时不用本地自己编译。