Debian11编译EPICS ADAravis记录
一年前整理的上面文,这几天重新走了一遍,有些地方会碰到问题,需要补充些环节,motor模块以前和areaDetector一条龙编译时,总是有问题,当时就没尝试了,这几天尝试了一下,流程再总结如下:
准备:
Debian11的基础安装(我用的是网络安装的虚拟机,选安装包时选ssh服务和网络工具两个选项),git抓包需要自己找渠道设置环境变量翻墙。
root权限下:
#改更新源,网络安装时选科大镜像的话,第一个sed可以省掉
sed -i 's/ftp.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
apt-get install git make gcc g++ #编译base需要
编译base:
adduser beam
mkdir /half #以合肥先进光源为例
chown -R beam:beam /half
cd /half
su beam
mkdir epics
cd epics
############下载和编译epics base7#################################
git clone --recursive -b 7.0 https://git.launchpad.net/epics-base base-7.0
ln -s base-7.0 base
cd base
make
EPICS 7 - EPICS Controls
areaDetector需要的包:
EPICS Products Required for Building areaDetector
areaDetector requires EPICS base. R3.14.12.4 or higher, any 3.15 release should work.areaDetector also requires asyn. The most recent release of asyn is recommended.
Each areaDetector detector module builds both a library and an EPICS IOC application. To build the library only EPICS base and asynDriver are required. To build the IOC application the synApps modules AUTOSAVE, BUSY, CALC, and SSCAN are required. If the CALC module is built with SNCSEQ support then SNCSEQ is also required. The most recent release of the synApps modules is recommended.
The DEVIOCSTATS and ALIVE modules are optional.
EPICS base, asyn and the synApps modules must be built before building areaDetector.
su下运行:
apt-get install libx11-dev libxext-dev wget re2c #编译areaDetector需要
######下载和修改synApps的脚本(当前最新版是6.2.1 --2024.1.21)###### 1. download the installer script
wget https://raw.githubusercontent.com/EPICS-synApps/support/master/assemble_synApps.sh# 2. edit assemble_synApps.sh for your version of EPICS base and local directory paths
# 3. (optional) Specify the (new) directory name where synApps will be installed.
# This is the default:
# export SYNAPPS_DIR=synApps
# This directory will be created when assemble_synApps.sh is run.# 4. download & install the synApps source files:
# 来自:GitHub - EPICS-synApps/support: APS BCDA synApps module: support
修改这个文件,根据上面的说明只保留了下面的模块,就能少下载些:
bash ./assemble_synApps.sh #一次可能不能把所有的包抓下来,多运行几次
之后进入support目录:
随上面脚本下载的motor7.2.2包直接编译通不过,我直接下载最新版本:
git clone https://github.com/epics-modules/motor.git
cp motor-R7-2-2/configure/RELEASE motor/configure/.
之后再把下面文件motor那一行改一下:
之后直接编译就好了:
make release
make
apt-get install meson pkg-config glib-2.0 libxml2-dev #编译下面驱动需要:
之后安装aravis驱动,root权限下:
取ADGenICam — areaDetector 3-11-2-gf866e7e documentation 里的这部分即可:
cd /usr/local
git clone https://github.com/AravisProject/aravis
cd aravis/
meson build
cd build
ninja #Debian已经有,不用专门装
ninja install
上面这步在写页首文档时没问题,现在这步可能会碰到meson版本低的问题,按这里的指南装好新版本的meson再重做上一步就好了:https://wenku.csdn.net/answer/de4dfc7a917045afbf6e36bf8be1275f
编译后面的ADAravis需要在su下先运行下面两条命令:
cp /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h /usr/include/.
apt-get install libusb-1.0.0-dev
编译ADGenICam和ADAravis,普通用户权限运行:
cd /half/epics/synApps/support/areaDetector-R3-11/
git clone https://github.com/areaDetector/ADGenICam.git
cd ADGenICam/
make
cd ..
git clone https://github.com/areaDetector/ADAravis.git
cd ADAravis/
make
上面编译ADAravis时,会碰到这类找不到的问题:
是因为现在安装avaris驱动的时候,已经到了0.10版本,而git clone下来的ADAravis的src里还是0.8版本的,运行下面的命令再重新做一遍就好了:
sed -i "s/-0.8/-0.10/g" aravisApp/src/Makefile
sed -i "s/-0.8/-0.10/g" iocs/aravisIOC/aravisApp/src/Makefile
上面两条替换命令能解决部分问题,但是编译过程中出现的这类问题还不能解决:
不知道这类的编译命令里的这类参数在哪里设置,路过的知道的希望能指点,我就只好这样解决:
cp -rf /usr/local/include/aravis-0.10 /usr/local/include/aravis-0.8
至此ADAravis和motor模块一条龙编译环节就都做好了,后面就是针对具体的摄像头和motor控制器的情况,搭建IOC了。
这个流程手动改文件设置和版本不匹配等问题多了一些环节,相信在那些技术大神的完善下,这些手动冗余的步骤都会慢慢省掉吧。。。
路过的从事相关任务的可以自己走一遍这个过程,Debian12下尝试了一下,很不顺利,希望有人能针对这个以及新版本的openEuler系统也尝试一下。