Skip to content

Commit f094f39

Browse files
committed
fix doc claim
1 parent d6e67e7 commit f094f39

4 files changed

Lines changed: 31 additions & 5 deletions

File tree

‎docs/src/en/developer.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,15 @@ pip install -e ".[dev]"
4545

4646
The `dev` extra brings in `pytest`, `ruff`, `mypy`, and `pre-commit`.
4747

48-
`scripts/install.sh` does all of the above and then runs the tests. Pass `--all` to enable the
49-
optional learned algorithms:
48+
`scripts/install.sh` automates most of this: it updates the submodule, installs the package
49+
editable, verifies the import, and runs the tests. Note that it installs plain `-e .` plus
50+
`pytest`, **not** the full `dev` extra — so `ruff`, `mypy` and `pre-commit` still need the
51+
command above if you want them. Pass `--all` to enable the optional learned algorithms:
5052

5153
```bash
54+
# --all only flips the CMake options on; install LightGBM/XGBoost first or
55+
# configuration fails with LIGHTGBM_PATH not found
56+
bash scripts/install_deps.sh # or install_deps_user.sh without sudo
5257
bash scripts/install.sh --all
5358
```
5459

‎docs/src/en/getting_started/installation.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pip install .
102102
```
103103

104104
`scripts/install.sh` wraps the whole flow — it updates the submodule, installs the package in
105-
editable mode, checks that the import works, and runs the test suite:
105+
editable mode (`pip install -e .`), checks that the import works, and runs the test suite:
106106

107107
```bash
108108
bash scripts/install.sh
@@ -111,6 +111,16 @@ bash scripts/install.sh
111111
bash scripts/install.sh --all
112112
```
113113

114+
!!! warning "`--all` needs the learned-algorithm dependencies first"
115+
`--all` only turns the three CMake options on; it does **not** install LightGBM and XGBoost.
116+
On a machine that does not already have them, the build then fails during configuration with
117+
an error such as `LIGHTGBM_PATH not found`. Run the dependency script first:
118+
119+
```bash
120+
bash scripts/install_deps.sh # or install_deps_user.sh without sudo
121+
bash scripts/install.sh --all
122+
```
123+
114124
Building the extension requires a C++17 compiler, CMake ≥ 3.15, and Ninja, plus three native
115125
dependencies that CMake looks for at configure time: **pkg-config**, **GLib 2.0** and
116126
**Zstandard**. All three are mandatory — `CMakeLists.txt` declares them with

‎docs/src/zh/developer.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ pip install -e ".[dev]"
4343

4444
`dev` 附加依赖会引入 `pytest`、`ruff`、`mypy` 和 `pre-commit`。
4545

46-
`scripts/install.sh` 会完成上述全部步骤并随后运行测试。加上 `--all` 可启用可选的学习型算法:
46+
`scripts/install.sh` 自动化了其中大部分工作:更新子模块、以可编辑模式安装、验证导入,并运行测试。注意它安装的是普通的 `-e .` 外加 `pytest`,**并非**完整的 `dev` 附加依赖——如果需要 `ruff`、`mypy` 和 `pre-commit`,仍要执行上面的命令。加上 `--all` 可启用可选的学习型算法:
4747

4848
```bash
49+
# --all 只是打开 CMake 选项;请先安装 LightGBM/XGBoost,
50+
# 否则配置阶段会因 LIGHTGBM_PATH not found 而失败
51+
bash scripts/install_deps.sh # 无 sudo 权限时用 install_deps_user.sh
4952
bash scripts/install.sh --all
5053
```
5154

‎docs/src/zh/getting_started/installation.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ git submodule update --init --recursive
8888
pip install .
8989
```
9090

91-
`scripts/install.sh` 封装了整个流程——它会更新子模块、以可编辑模式安装本包、检查导入是否正常,并运行测试套件:
91+
`scripts/install.sh` 封装了整个流程——它会更新子模块、以可编辑模式安装本包(`pip install -e .`)、检查导入是否正常,并运行测试套件:
9292

9393
```bash
9494
bash scripts/install.sh
@@ -97,6 +97,14 @@ bash scripts/install.sh
9797
bash scripts/install.sh --all
9898
```
9999

100+
!!! warning "`--all` 需要先安装学习型算法的依赖"
101+
`--all` 只是打开三个 CMake 选项,并**不会**安装 LightGBM 和 XGBoost。在尚未装好它们的机器上,构建会在配置阶段失败,报出类似 `LIGHTGBM_PATH not found` 的错误。请先运行依赖脚本:
102+
103+
```bash
104+
bash scripts/install_deps.sh # 无 sudo 权限时用 install_deps_user.sh
105+
bash scripts/install.sh --all
106+
```
107+
100108
构建扩展需要支持 C++17 的编译器、CMake ≥ 3.15 以及 Ninja,另外还需要三个在 configure 阶段查找的原生依赖:**pkg-config**、**GLib 2.0** 和 **Zstandard**。这三者都是必需的——`CMakeLists.txt` 中分别以 `find_package(PkgConfig REQUIRED)`、`pkg_check_modules(GLib REQUIRED glib-2.0)` 和 `find_package(ZSTD REQUIRED)` 声明——缺少任意一个都会在编译任何代码之前中断配置,并报出类似 `No package 'glib-2.0' found` 的错误。
101109

102110
上文的依赖脚本会在其支持的平台上安装它们(`install_deps.sh` 面向基于 yum 的发行版和 macOS)。在 Debian/Ubuntu 上,请使用子模块提供的脚本,或直接安装:

0 commit comments

Comments
 (0)