Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions devel/Develop_on_Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@
On Debian or Debian derivatives:

Since the project uses xmake to manage Qt, you need to remove the local Qt installation:
``` bash
```bash
sudo apt remove qt6-base-dev qt6-base-dev-tools qmake6
```

If you encounter Qt dependency issues, you can use this command to delete xmake's Qt global cache:
``` bash
```bash
rm -rf ~/.xmake/cache ~/.xmake/packages/qt
```

Install xmake and related dependencies:
``` bash
```bash
sudo apt install xmake

sudo apt update
sudo apt install -y gcc git 7zip unzip curl build-essential fonts-noto-cjk libcurl4-openssl-dev libfreetype-dev libfontconfig-dev libmimalloc-dev libgit2-dev zlib1g-dev libssl-dev libjpeg62-turbo-dev cmake pandoc xmake python3.13 ninja-build libdbus-1-3 libglib2.0-0t64 libegl1 libgl-dev libxkbcommon0
```

Keep xrepo updated:
``` bash
```bash
xrepo update-repo
```

### Step 2: Compile
-vD shows detailed debug logs. Qt installation cache is located at: /home/username/.xmake/packages
For example: /home/jiadong/.xmake/packages/q/qt6base/6.8.3/7c1ea54729db483fa6eee7744bd4a333
``` bash
```bash
xmake config --yes -vD
xmake build stem
```
Expand All @@ -39,27 +39,27 @@ xmake build stem
Refer to [How to Test](Test_EN.md)

### Step 4: Launch Mogan STEM
``` bash
```bash
xmake run stem
```

### In some case, clearing the cache may be necessary (eg., when manu bar disappears, etc.)
Cache directory:
``` bash
```bash
rm -rf ~/.cache/MoganLab
```
Runtime cache:
``` bash
```bash
rm -rf ~/.local/share/moganlab
```

### Using VSCode for code completion assistance
Install VSCode, Clangd, and the Clangd extension for VSCode.
Then execute the following command in the mogan folder:
``` bash
```bash
xmake project -k compile_commands
```
This command will generate a compile_commands.json file in the mogan folder. Clangd reads this file to understand the project's structure, thereby avoiding errors related to missing header files.

## Please format code before committing
[Formatting Guide](Format_EN.md)
[Formatting Guide](Format_EN.md)
4 changes: 2 additions & 2 deletions devel/Develop_on_Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
- **chocolatey**

```powershell
choco install xmake
choco install xmake
```
- Verify:
```powershell
xmake --version
```
## Step 2: Get Source Code, Compile and Run
### Chose your working directory, for example E:\TestFile:
### Choose your working directory, for example E:\TestFile:

```powershell
cd E:\TestFile
Expand Down
16 changes: 8 additions & 8 deletions devel/Develop_on_macOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,44 @@ This development guide is written for Mogan Research. Other components can also

## Step 1: Install xmake and xrepo
For Homebrew users:
``` bash
```bash
brew install xmake qt
brew install pkg-config
```

Keep xrepo updated:
``` bash
```bash
xrepo update-repo
```

## Step 2: Configuration
``` bash
```bash
xmake config -vD --yes
```

If you encounter Qt dependency issues, you can use this command to delete xmake's Qt global cache:
``` bash
```bash
rm -rf ~/.xmake/cache ~/.xmake/packages/qt
```

If Qt cannot be found, you can manually specify the Qt path, for example:
``` bash
```bash
xmake config --qt=/opt/homebrew/share/qt
```
Please adjust the Qt-related directory as needed; it may not necessarily be `/opt/homebrew/share/qt`.

## Step 3: Build
``` bash
```bash
xmake build stem
```

## Step 4: Testing
Refer to [How to Test](Test_EN.md)

## Step 5: Launch Mogan STEM
``` bash
```bash
xmake run stem
```

## Please format code before committing
[Formatting Guide](Format_EN.md)
[Formatting Guide](Format_EN.md)
28 changes: 19 additions & 9 deletions devel/Format_EN.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,56 @@
# Code Formatting Guide

## Environment Setup

Requires clang-format version 19.1.x.

### Linux

Install via apt:
```
```bash
sudo apt install clang-format-19
```

After restarting the terminal, verify:
```
```bash
clang-format-19 --version
```

### macOS

Note: should match LLVM 19.

Install via Homebrew:
```
```bash
brew install llvm@19
```

Add to your ~/.zshrc:
```
```bash
# set clang-format to version 19
export PATH="$(brew --prefix llvm@19)/bin:$PATH"
```

Restart the terminal and verify:
```
```bash
clang-format --version
```

### Windows

Install via scoop:
```
```bash
scoop install llvm@19.1.0
```

Restart the terminal and verify:
```
```bash
clang-format --version
```

## Using the script

From the repository root, run:
```
```shell
elvish bin/format
```
```