sudo apt-get install \build-essential automake flex bison mercurial \libgtk-3-dev libgl1-mesa-dev libglu1-mesa-dev \libpython3.10-dev libssl-dev \python3.10 virtualenv cmake git mercurial
环境配置(系统的先决条件)
apt-get install -y build-essential
apt-get install -y automake
apt-get install -y flex
apt install -y bison
apt-get install -y mercurial
apt-get instll -y libgtk-3-dev
apt-get install -y libgl1-mesa-dev
apt-get install -y libglu1-mesa-dev
#此处有修改
apt-get install -y libpython3.8-devapt-get install -y libssl-dev
apt install -y python3.8
#此处有修改
pip install virtualenv
apt-get install -y cmake
apt-get install -y git
apt-get install -y mercurial
mkdir ~/Beremiz
cd ~/Beremiz
cd ~/Beremiz
hg clone https://hg.beremiz.org/beremiz
hg clone https://hg.beremiz.org/matiec
安装 Beremiz 可以通过几种不同的方式进行,取决于您使用的操作系统。以下是针对 Windows 和 Linux 的安装指南:
对于 Windows 用户
-
从 GitHub Releases 下载 Windows 安装程序:
- 访问 Beremiz GitHub Releases 页面。
- 寻找最新的发布版本,并下载适用于 Windows 的安装文件(通常是一个
.exe
文件)。
-
运行安装程序:
- 找到您下载的安装文件并双击它来启动安装向导。
- 按照屏幕上的提示完成安装过程。
-
启动 Beremiz IDE:
- 安装完成后,您可以从开始菜单或桌面快捷方式启动 Beremiz IDE。
对于 Linux 用户 (Ubuntu 为例)
使用 Snap 包安装
- 打开终端。
- 安装 Beremiz:
sudo snap install beremiz --classic
或者从源码构建(开发者设置)
如果您想从源代码构建 Beremiz,以下是步骤概要:
-
安装系统先决条件:
sudo apt-get update sudo apt-get install build-essential automake flex bison mercurial libgtk-3-dev libgl1-mesa-dev libglu1-mesa-dev libpython3-dev libssl-dev python3 virtualenv cmake git
-
准备构建目录:
mkdir ~/Beremiz cd ~/Beremiz
-
获取源代码:
- 使用 Mercurial 或 Git 克隆仓库:
hg clone https://hg.beremiz.org/beremiz hg clone https://hg.beremiz.org/matiec # 或者使用 Git: git clone https://github.com/beremiz/beremiz.git git clone https://github.com/beremiz/matiec.git
- 使用 Mercurial 或 Git 克隆仓库:
-
设置 Python 环境:
virtualenv ~/Beremiz/venv source ~/Beremiz/venv/bin/activate pip install -r ~/Beremiz/beremiz/requirements.txt
运行pip install -r ~/Beremiz/beremiz/requirements.txt后结果(需要等较长时间)
- 构建 MatIEC 编译器:
cd ~/Beremiz/matiec autoreconf -i ./configure make
./configure运行后的结果
运行make后的结果
-
(可选)构建 CanFestival、Modbus 库和 BACnet:
- 如果需要 CANopen 支持,请构建 CanFestival。
- 如果需要 Modbus 支持,请构建 Modbus 库。
- 如果需要 BACnet 支持,请构建 BACnet。
-
启动 Beremiz IDE:
python ~/Beremiz/beremiz/Beremiz.py
-
运行独立的 Beremiz 运行时(如果需要):
mkdir ~/beremiz_runtime_workdir python ~/Beremiz/beremiz/Beremiz_service.py -p 61194 -i localhost -x 0 -a 1 ~/beremiz_runtime_workdir
请确保在执行上述命令前根据您的具体环境调整命令中的路径和其他参数。对于更详细的指导,建议参考官方文档或访问 Beremiz 官方网站 获取最新信息。