操作系统:CentOS Linux release 7.5.1804
EPICS Base:base-3.15.6.tar.gz
依赖软件包:一般情况下,安装了基本开发工具环境的CentOS7只需要额外安装readline-devel,其他所需的依赖软件安装时都自带了。
先安装依赖软件包readline-devel:yum -y install readline-devel
创建epics目录,将压缩包base-3.15.6.tar.gz解压到该目录下,并改名为base:
mkdir -p /usr/local/epics
cd /usr/local/epics
tar -zxvf /root/base-3.15.6.tar.gz
mv base-3.15.6 base
运行startup目录下的EpicsHostArch:
cd /usr/local/epics/base/startup
./EpicsHostArch
vi /root/.bashrc
在最后面添加环境变量:
EPICS_HOST_ARCH=linux-x86_64
export EPICS_HOST_ARCH
PATH=$PATH:/usr/local/epics/base/bin/linux-x86_64/
export PATH
EPICS_BASE=/usr/local/epics/base/
export EPICS_BASE
source /root/.bashrc
在base目录下编译:
cd /usr/local/epics/base
make clean && make
缺少软件包导致编译失败的话,再安装相应的软件包。
如果没安装readline-devel,会出现以下错误:
没有出现错误的话,在/usr/local/epics/base/bin/linux-x86_64目录下可看到一系列文件,Base安装成功了。
创建放置IOC实例的目录top:
mkdir -p /usr/local/epics/base/top
查看PATH,复制路径:
将路径添加到/root/.bash_profile的PATH后面(这里不是很懂,照着参考链接做的):
vi /root/.bash_profile
source /root/.bash_profile
在top目录下利用makeBaseApp.pl建立一个IOC实例:
cd /usr/local/epics/base/top
/usr/local/epics/base/bin/linux-x86_64/makeBaseApp.pl -t example firstIoc
/usr/local/epics/base/bin/linux-x86_64/makeBaseApp.pl -i -t example firstIocBoot
这时需要你输入启动名字,firstIoc
在top目录下进行编译:
make clean && make
没有出现错误,接着给iocfirstIocBoot目录下的st.cmd增加权限:
cd /usr/local/epics/base/top/iocBoot/iocfirstIocBoot
chmod +x st.cmd
运行st.cmd:
./st.cmd
IOC实例安装成功。
这部分作为拓展,将上述安装过程写成一个脚本,vim EpicsBaseIocAuto.sh
#!/bin/bash
yum -y install readline-devel
mkdir -p /usr/local/epics
cd /usr/local/epics
tar -zxvf /root/base-3.15.6.tar.gz
mv base-3.15.6 base
cd base/startup
./EpicsHostArch
cd
sed -i '$a EPICS_HOST_ARCH=linux-x86_64\
export EPICS_HOST_ARCH\
PATH=$PATH:/usr/local/epics/base/bin/linux-x86_64/ \
export PATH \
EPICS_BASE=/usr/local/epics/base/ \
export EPICS_BASE
' /root/.bashrc
source /root/.bashrc
cd /usr/local/epics/base
make
###IOC
cd
sed -i '10d' /root/.bash_profile
sed -i '10i PATH=$PATH:$HOME/bin:/usr/local/epics/base/bin/linux-x86_64/
' /root/.bash_profile
source /root/.bash_profile
mkdir -p /usr/local/epics/base/top
cd /usr/local/epics/base/top
$EPICS_BASE/bin/$EPICS_HOST_ARCH/makeBaseApp.pl -t example firstIoc
$EPICS_BASE/bin/$EPICS_HOST_ARCH/makeBaseApp.pl -i -t example firstIocBoot << EOF
firstIoc
EOF
make
cd iocBoot/iocfirstIocBoot
chmod +x st.cmd
exit 0
运行sh EpicsBaseIocAuto.sh
,即可自动化安装Base与IOC
关关难过关关过——EPICS base 安装和利用makeBaseApp.pl建立一个IOC实例
Linux下安装epics中Base-3.15.5步骤(向胡勇老师致敬)
EPICS之一个简单的设备支持程序
张根灿. 上海质子治疗装置注入器远程控制系统的构建[D]. 2018.