Skip to content
README.md 4.46 KiB
Newer Older
yih@ihep.ac.cn's avatar
yih@ihep.ac.cncommitted
1 2
# 程序文档教程-[用户手册](https://docs.ihep.ac.cn/link/AA1DE9EC81CB7049B185CB1AA30FF01F25)
yih@ihep.ac.cn's avatar
yih@ihep.ac.cncommitted
3
-[介绍报告](https://docs.ihep.ac.cn/link/AAC492D66A53C94DB9A5559CABABD2D828)
yih@ihep.ac.cn's avatar
yih@ihep.ac.cncommitted
4 5
-[使用教程](https://www.bilibili.com/video/BV1e77j62Ewt/?spm_id_from=333.1387.homepage.video_card.click&vd_source=752a33a845dc197d2672a4790fc6a4cc)
6 7
# 环境配置指南
yih@ihep.ac.cn's avatar
yih@ihep.ac.cncommitted
8
**前提要求**:ROOT 框架已安装并配置完成。
本文档详细描述了从 GitLab 克隆项目后,如何配置运行环境。## 目录1.[克隆项目](#1-克隆项目)2.[安装依赖](#2-安装依赖)
yih@ihep.ac.cn's avatar
yih@ihep.ac.cncommitted
15
3.[运行GUI](#3-运行-gui)
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 cdecho"=== 配置环境 ==="source/path/to/root/bin/thisroot.shsudoapt-get updatesudoapt-getinstallpython3 python3-pipsudoapt-getinstallpython3-tksudoapt-getinstallcmakesudoapt-getinstallbuild-essentialecho"=== 启动 GUI ==="python3 program_gui.py```---## 联系信息如有问题,请联系项目维护者:
yih@ihep.ac.cn's avatar
yih@ihep.ac.cncommitted
-郭罗坤:guoluokun@mail.ustc.edu.cn-张房越:fyzhang@ihep.ac.cn-易晗:yih@ihep.ac.cn## 代码更新订阅如果想接收GitLab仓库更新的邮件推送,请发送邮件至yih@ihep.ac.cn,我们会将您加入邮件订阅列表。
Baidu
map