Newer
Older
# 程序文档教程-[用户手册](https://docs.ihep.ac.cn/link/AA1DE9EC81CB7049B185CB1AA30FF01F25)
-[介绍报告](https://docs.ihep.ac.cn/link/AAC492D66A53C94DB9A5559CABABD2D828)
-[使用教程](https://www.bilibili.com/video/BV1e77j62Ewt/?spm_id_from=333.1387.homepage.video_card.click&vd_source=752a33a845dc197d2672a4790fc6a4cc)
本文档详细描述了从 GitLab 克隆项目后,如何配置运行环境。## 目录1.[克隆项目](#1-克隆项目)2.[安装依赖](#2-安装依赖)
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
4.[可选配置](#4-可选配置)5.[故障排除](#5-故障排除)6.[支持的平台](#6-支持的平台)---## 1. 克隆项目```bashgit clone cd ```---## 2. 安装依赖### 2.1 检查 ROOT 环境(确认已配置)```bash# 验证 ROOT 是否正确配置root--version```如果未配置 ROOT,请先执行:```bashsource/path/to/root/bin/thisroot.sh```### 2.2 Python 环境```bash# 确保 Python 3.8+ 已安装python3--version```如果 Python 未安装,请先执行安装:```bashsudoapt-get update# Ubuntu/Debiansudoapt-getinstallpython3 python3-pip# Ubuntu/Debian#或brewinstallpython# macOS```安装 Tkinter(用于 GUI):```bashsudoapt-getinstallpython3-tk# Ubuntu/Debian# 或brewinstallpython-tk# macOS```### 2.3 CMake```bashsudoapt-getinstallcmake# Ubuntu/Debian# 或brewinstallcmake# macOS# 验证安装cmake--version```### 2.4 编译器```bashsudoapt-getinstallbuild-essential# Ubuntu/Debian# 或xcode-select--install# macOS# 验证安装gcc--versiong++--version```---## 3. 运行 GUI```bashpython3 program_gui.py```---## 4. 可选配置### 4.1 ROOT 环境变量持久化如果每次启动终端都需要手动配置 ROOT,可以将其添加到`~/.bashrc`:```bashecho"source /path/to/root/bin/thisroot.sh">>~/.bashrcsource~/.bashrc```### 4.2 配置文件运行 GUI 后点击 "save config" ,会自动生成`unfolding_config.json`配置文件,可根据需要修改默认参数;如果`unfolding_config.json`文件存在,运行 GUI 会自动加载其参数配置。如果`unfolding_config.json`文件不存在,运行 GUI 保持默认参数配置。---## 5. 故障排除### 问题1:GUI 无法启动 - Tkinter 错误```bash# 安装 Tkintersudoapt-getinstallpython3-tk# Ubuntu/Debianbrewinstallpython-tk# macOS```### 问题2:编译失败 - 缺少依赖```bashsudoapt-getinstalllibgsl-dev libfftw3-dev# Ubuntu/Debian```### 问题3:缺少共享库```bash# 更新库缓存ldconfig# 或者设置 LD_LIBRARY_PATHexportLD_LIBRARY_PATH=/path/to/root/lib:$LD_LIBRARY_PATH```### 问题4:ROOT 命令未找到```bash# 确保正确设置 ROOT 环境变量source/path/to/root/bin/thisroot.sh```---## 6. 支持的平台| 平台 | 状态 | 说明 ||------|------|------|| Linux (Ubuntu/Debian) | ✅ 支持 | 推荐使用 || macOS | ✅ 支持 | 使用 Homebrew 安装依赖 || Windows | ⚠️ 有限支持 | 建议使用 WSL |### macOS 配置说明```bash# 使用 Homebrew 安装依赖brewinstallpython-tkbrewinstallcmake```### Windows 配置说明建议使用**Windows Subsystem for Linux (WSL)**:1.启用 WSL 功能2.安装 Ubuntu 发行版3.按照 Linux 配置步骤进行---## 版本要求| 软件 | 最低版本 | 推荐版本 ||------|----------|----------|| ROOT | 6.20 | 6.28+ || Python | 3.8 | 3.10+ || CMake | 3.16 | 3.20+ || GCC | 7.0 | 11.0+ |---## 快速开始脚本可以创建一个`setup.sh`脚本快速配置:```bash#!/bin/bashecho"=== 克隆项目 ==="git clone cd echo"=== 配置环境 ==="source/path/to/root/bin/thisroot.shsudoapt-get updatesudoapt-getinstallpython3 python3-pipsudoapt-getinstallpython3-tksudoapt-getinstallcmakesudoapt-getinstallbuild-essentialecho"=== 启动 GUI ==="python3 program_gui.py```---## 联系信息如有问题,请联系项目维护者:
-郭罗坤:guoluokun@mail.ustc.edu.cn-张房越:fyzhang@ihep.ac.cn-易晗:yih@ihep.ac.cn## 代码更新订阅如果想接收GitLab仓库更新的邮件推送,请发送邮件至yih@ihep.ac.cn,我们会将您加入邮件订阅列表。