-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc(godel-script): Provide supplementary explanations regarding the c… #101
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -52,24 +52,77 @@ Structure of this project: | |
+-- src godel-frontend source code | ||
``` | ||
|
||
### Environment | ||
|
||
Need C++ standard at least `-std=c++17`. | ||
|
||
You can refer to the following Dockerfile to prepare your development environment. | ||
|
||
```Dockerfile | ||
FROM ubuntu:24.04 | ||
|
||
RUN echo "Types: deb\n\ | ||
URIs: http://mirrors.cloud.tencent.com/ubuntu/\n\ | ||
Suites: noble noble-updates noble-security\n\ | ||
Components: main restricted universe multiverse\n\ | ||
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" > /etc/apt/sources.list.d/ubuntu.sources | ||
|
||
RUN apt update && apt upgrade -y && apt install -y git build-essential m4 cmake ninja-build clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python3-clang libsqlite3-dev sqlite3 zlib1g-dev | ||
``` | ||
|
||
For convenience, we recommend directly using the [Dev Container plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) of VSCode. Here is `devcontainer.json`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. devcontainer 虽然很有用,但是这里还是请去掉吧,对于文档来说信息过多了 |
||
|
||
```json | ||
{ | ||
"name": "godel-script", | ||
"build": { | ||
"context": "..", | ||
"dockerfile": "./Dockerfile" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"xaver.clang-format", | ||
"twxs.cmake", | ||
"ms-vscode.cmake-tools", | ||
"vadimcn.vscode-lldb", | ||
"llvm-vs-code-extensions.vscode-clangd" | ||
], | ||
"settings": { | ||
"[cpp]": { | ||
"editor.defaultFormatter": "xaver.clang-format" | ||
}, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"cmake.generator": "Ninja" | ||
} | ||
} | ||
}, | ||
"remoteUser": "root" | ||
} | ||
``` | ||
|
||
|
||
### Apply Patch On Soufflé Submodule | ||
|
||
GödelScript uses a self-modified soufflé from a much older branch of public soufflé, | ||
now we use patch to make sure it could be built successfully. | ||
GödelScript uses a self-modified soufflé from a much older branch of public soufflé. Use these commands to clone. | ||
|
||
```bash | ||
git submodule init | ||
git submodule update --recursive | ||
``` | ||
|
||
Use this command to apply patch: | ||
Now we use patch to make sure it could be built successfully. Use these commands to apply patch: | ||
|
||
```bash | ||
cd souffle | ||
cd godel-backend/souffle | ||
git am ../0001-init-self-used-souffle-from-public-souffle.patch | ||
``` | ||
|
||
Use these commands to revert: | ||
|
||
```bash | ||
cd souffle | ||
cd godel-backend/souffle | ||
git apply -R ../0001-init-self-used-souffle-from-public-souffle.patch | ||
git reset HEAD~ | ||
``` | ||
|
@@ -79,8 +132,9 @@ git reset HEAD~ | |
Use command below: | ||
|
||
```bash | ||
mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release | ||
make -j6 | ||
mkdir build && cd build | ||
cmake .. -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++ --no-warn-unused-cli -G Ninja | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 为了配合目前项目配置的 CI,建议仍然使用 cmake 与 make,没有特殊需求尽量不要增加其他实体 |
||
cmake --build . --config Release --target all -j 8 | ||
``` | ||
|
||
After building, you'll find `build/godel` in the `build` folder. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里描述还是尽量简洁一些,去除不必要的信息噪音,只保留当时我们讨论的核心问题,也就是将 ubuntu 环境下编译时可能缺少的相关包在这里列出来,在系统方面目前项目支持 macOS / Ubuntu 2204 LTS / Ubuntu 2404 LTS 的本地编译,环境尽量不要限制死。