Skip to content

Commit 37a97cc

Browse files
committed
doc(godel-script): Provide supplementary explanations regarding the compilation environment and steps in README.
1 parent aa79262 commit 37a97cc

File tree

1 file changed

+61
-7
lines changed

1 file changed

+61
-7
lines changed

godel-script/README.md

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,77 @@ Structure of this project:
5252
+-- src godel-frontend source code
5353
```
5454

55+
### Environment
56+
5557
Need C++ standard at least `-std=c++17`.
5658

59+
You can refer to the following Dockerfile to prepare your development environment.
60+
61+
```Dockerfile
62+
FROM ubuntu:24.04
63+
64+
RUN echo "Types: deb\n\
65+
URIs: http://mirrors.cloud.tencent.com/ubuntu/\n\
66+
Suites: noble noble-updates noble-security\n\
67+
Components: main restricted universe multiverse\n\
68+
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg" > /etc/apt/sources.list.d/ubuntu.sources
69+
70+
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
71+
```
72+
73+
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`.
74+
75+
```json
76+
{
77+
"name": "godel-script",
78+
"build": {
79+
"context": "..",
80+
"dockerfile": "./Dockerfile"
81+
},
82+
"customizations": {
83+
"vscode": {
84+
"extensions": [
85+
"xaver.clang-format",
86+
"twxs.cmake",
87+
"ms-vscode.cmake-tools",
88+
"vadimcn.vscode-lldb",
89+
"llvm-vs-code-extensions.vscode-clangd"
90+
],
91+
"settings": {
92+
"[cpp]": {
93+
"editor.defaultFormatter": "xaver.clang-format"
94+
},
95+
"editor.formatOnSave": true,
96+
"editor.formatOnPaste": true,
97+
"cmake.generator": "Ninja"
98+
}
99+
}
100+
},
101+
"remoteUser": "root"
102+
}
103+
```
104+
105+
57106
### Apply Patch On Soufflé Submodule
58107

59-
GödelScript uses a self-modified soufflé from a much older branch of public soufflé,
60-
now we use patch to make sure it could be built successfully.
108+
GödelScript uses a self-modified soufflé from a much older branch of public soufflé. Use these commands to clone.
109+
110+
```bash
111+
git submodule init
112+
git submodule update --recursive
113+
```
61114

62-
Use this command to apply patch:
115+
Now we use patch to make sure it could be built successfully. Use these commands to apply patch:
63116

64117
```bash
65-
cd souffle
118+
cd godel-backend/souffle
66119
git am ../0001-init-self-used-souffle-from-public-souffle.patch
67120
```
68121

69122
Use these commands to revert:
70123

71124
```bash
72-
cd souffle
125+
cd godel-backend/souffle
73126
git apply -R ../0001-init-self-used-souffle-from-public-souffle.patch
74127
git reset HEAD~
75128
```
@@ -79,8 +132,9 @@ git reset HEAD~
79132
Use command below:
80133

81134
```bash
82-
mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release
83-
make -j6
135+
mkdir build && cd build
136+
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
137+
cmake --build . --config Release --target all -j 8
84138
```
85139

86140
After building, you'll find `build/godel` in the `build` folder.

0 commit comments

Comments
 (0)