wiki:epics/bbb/epics

Version 1 (modified by michkawa, 6 years ago) (diff)

--

BeagleBone Black へのEPICS インストール

raspberry pi の対抗馬として登場したBeagleBone Black(以降はBBB)へお約束のEPICSインストールするためのメモ。

Angstrom

BBBのデフォルトで入っているOSであるAngstrom Linuxにインストール。今回はeMMC上に直接インストールしたが、AngstromをmicroSDにインストールしたものに設定したほうが精神衛生上いいかも。

EPICS base

EPICSのbaseはR3.14.2.3を使用し、/optにインストール。
コンパイル環境は初めから入っているようなので、パッケージの追加なしでコンパイル。

root@beaglebone:~# mkdir -p /opt/epics/R314.12.3
root@beaglebone:~# cd /opt/epics/R314.12.3
root@beaglebone:/opt/epics/R314.12.3# wget http://www.aps.anl.gov/epics/download/base/baseR3.14.12.3.tar.gz
root@beaglebone:/opt/epics/R314.12.3# tar zxvf baseR3.14.12.3.tar.gz
root@beaglebone:/opt/epics/R314.12.3# mv base-3.14.12.3 base
root@beaglebone:/opt/epics/R314.12.3# cd base
root@beaglebone:/opt/epics/R314.12.3/base# make

と思ったら、途中で止まった。

perl /usr/lib/perl/5.14.2/ExtUtils/xsubpp -typemap /usr/lib/perl/5.14.2/ExtUtils/typemap ../Cap5.xs > Cap5.c_new && mv Cap5.c_new Cap5.c
Can't open perl script "/usr/lib/perl/5.14.2/ExtUtils/xsubpp": No such file or directory
make[3]: *** [Cap5.c] Error 2
make[3]: Leaving directory `/opt/epics/R314.12.3/base/src/cap5/O.linux-arm'
make[2]: *** [install.linux-arm] Error 2
make[2]: Leaving directory `/opt/epics/R314.12.3/base/src/cap5'
make[1]: *** [cap5.install] Error 2
make[1]: Leaving directory `/opt/epics/R314.12.3/base/src'
make: *** [src.install] Error 2

xsubppというコマンドがないらしい。
perlのスクリプトらしいので、検索でそれらしいところからwget。

root@beaglebone:/usr/lib/perl/5.14.2/ExtUtils# wget http://www.boristheengineer.co.uk/slug/download/xsubpp
Connecting to www.boristheengineer.co.uk (212.159.8.91:80)
xsubpp               100% |***************************************************************| 51745   0:00:00 ETA

再度、make。

root@beaglebone:/opt/epics/R314.12.3/base# make

               :

perl /usr/lib/perl/5.14.2/ExtUtils/xsubpp -typemap /usr/lib/perl/5.14.2/ExtUtils/typemap ../Cap5.xs > Cap5.c_new && mv Cap5.c_new Cap5.c
Can't find /usr/lib/perl/5.14.2/ExtUtils/typemap in /opt/epics/R314.12.3/base/src/cap5
make[3]: *** [Cap5.c] Error 2
make[3]: Leaving directory `/opt/epics/R314.12.3/base/src/cap5/O.linux-arm'
make[2]: *** [install.linux-arm] Error 2
make[2]: Leaving directory `/opt/epics/R314.12.3/base/src/cap5'
make[1]: *** [cap5.install] Error 2
make[1]: Leaving directory `/opt/epics/R314.12.3/base/src'
make: *** [src.install] Error 2

今度はtypemapがないらしい。同じところからwget。

root@beaglebone:/usr/lib/perl/5.14.2/ExtUtils# wget http://www.boristheengineer.co.uk/slug/download/typemap
Connecting to www.boristheengineer.co.uk (212.159.8.91:80)
typemap              100% |***************************************************************|  6810   0:00:00 ETA

再度、make。

root@beaglebone:/opt/epics/R314.12.3/base# make

               :

rm -f CA.html
podchecker ../CA.pm && pod2html --infile=../CA.pm --outfile=CA.html
/bin/sh: podchecker: command not found
make[3]: *** [CA.html] Error 127
make[3]: Leaving directory `/opt/epics/R314.12.3/base/src/cap5/O.linux-arm'
make[2]: *** [install.linux-arm] Error 2
make[2]: Leaving directory `/opt/epics/R314.12.3/base/src/cap5'
make[1]: *** [cap5.install] Error 2
make[1]: Leaving directory `/opt/epics/R314.12.3/base/src'
make: *** [src.install] Error 2

今度はpodcheckerがない。
検索してもあまり芳しくないので、pfrproc6でwhichしたら/usr/binにあったので、中身を見るとただのperlスクリプトだった。perlの追加パッケージをインストール。
Angstromのパッケージ一覧は、http://www.angstrom-distribution.org/repo/?letter=pで検索可能だったので、それらしいものを取得してインストール。
Angstromのパッケージ管理ツールは opkg というプログラムを使っているらしい。

root@beaglebone:~/pkg# wget http://www.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/perl/perl-module-pod-checker_5.14.2-r13.2_armv7a-vfp-neon.ipk
Connecting to www.angstrom-distribution.org (188.40.83.200:80)
perl-module-pod-chec 100% |***************************************************************| 12414   0:00:00 ETA
root@beaglebone:~/pkg# opkg install perl-module-pod-checker_5.14.2-r13.2_armv7a-vfp-neon.ipk
Upgrading perl-module-pod-checker on root from 5.14.2-r13.1 to 5.14.2-r13.2...
Configuring perl-module-pod-checker.

インストール後にインストールされたファイルの一覧を見てもモジュールだけだったので、pfrproc6からコピー。

root@beaglebone:~/pkg# opkg files perl-module-pod-checker
Package perl-module-pod-checker (5.14.2-r13.2) is installed on root and has the following files:
/usr/lib/perl/5.14.2/Pod/Checker.pm
root@beaglebone:~/pkg# cd /usr/bin
root@beaglebone:/usr/bin# scp pfrproc6.cerl.kek.jp:/usr/bin/podchecker .

再度、make。

root@beaglebone:/opt/epics/R314.12.3/base# make

               :

/bin/sh: pod2html: command not found
make[3]: *** [CA.html] Error 127
make[3]: Leaving directory `/opt/epics/R314.12.3/base/src/cap5/O.linux-arm'
make[2]: *** [install.linux-arm] Error 2
make[2]: Leaving directory `/opt/epics/R314.12.3/base/src/cap5'
make[1]: *** [cap5.install] Error 2
make[1]: Leaving directory `/opt/epics/R314.12.3/base/src'
make: *** [src.install] Error 2

今度は、pod2htmlがない。pfrproc6からまたコピーして、再度、make。

podchecker ../CA.pm && pod2html --infile=../CA.pm --outfile=CA.html
../CA.pm pod syntax OK.
Installing html ../../../html/./CA.html
rm CA.html
make[3]: Leaving directory `/opt/epics/R314.12.3/base/src/cap5/O.linux-arm'
make[2]: Leaving directory `/opt/epics/R314.12.3/base/src/cap5'
make[1]: Leaving directory `/opt/epics/R314.12.3/base/src'
root@beaglebone:/opt/epics/R314.12.3/base#

やっと、通った。

root@beaglebone:/ cd /opt/epics/R314.12.3/base/bin/linux-arm
root@beaglebone:/opt/epics/R314.12.3/base/bin/linux-arm# ./cainfo PFRCO:ENECNTR:CH0001
**** The executable "caRepeater" couldn't be located
**** because of errno = "No such file or directory".
**** You may need to modify your PATH environment variable.
**** Unable to start "CA Repeater" process.
PFRCO:ENECNTR:CH0001
    State:            connected
    Host:             172.28.64.120:5064
    Access:           read, write
    Native data type: DBF_DOUBLE
    Request type:     DBR_DOUBLE
    Element count:    1

とりあえず動いた。

sequencer

次にseqencerをコンパイル。

root@beaglebone:/opt/epics/R314.12.3# mkdir -p modules/soft/seq
root@beaglebone:/opt/epics/R314.12.3# cd modules/soft/seq
root@beaglebone:/opt/epics/R314.12.3/modules/soft/seq# wget http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.1.14.tar.gz
Connecting to www-csr.bessy.de (193.149.12.250:80)
seq-2.1.14.tar.gz    100% |***************************************************************|   298k  0:00:00 ETA
root@beaglebone:/opt/epics/R314.12.3/modules/soft/seq# tar zxvf seq-2.1.14.tar.gz
root@beaglebone:/opt/epics/R314.12.3/modules/soft/seq# mv seq-2.1.14 2.1.14
root@beaglebone:/opt/epics/R314.12.3/modules/soft/seq# cd 2.1.14
root@beaglebone:/opt/epics/R314.12.3/modules/soft/seq/2.1.14# vi configure/RELEASE

EPICS_BASE=/opt/epics/R314.12.3/base

root@beaglebone:/opt/epics/R314.12.3/modules/soft/seq/2.1.14# make

いつも通り、途中でre2cがないといわれるので、re2cをインストール

root@beaglebone:~/tmp# wget http://sourceforge.net/projects/re2c/files/re2c/0.13.6/re2c-0.13.6.tar.gz
root@beaglebone:~/tmp# cd re2c-0.13.6
root@beaglebone:~/tmp/re2c-0.13.6# ./configure
root@beaglebone:~/tmp/re2c-0.13.6# make
root@beaglebone:~/tmp/re2c-0.13.6# make install

再度、make。

root@beaglebone:/opt/epics/R314.12.3/modules/soft/seq/2.1.14# make

コンパイル完了。

asyn

asynもコンパイル。

root@beaglebone:/opt/epics/R314.12.3/modules/soft# mkdir asyn
root@beaglebone:/opt/epics/R314.12.3/modules/soft# cd asyn
root@beaglebone:/opt/epics/R314.12.3/modules/soft/asyn# wget http://www.aps.anl.gov/epics/download/modules/asyn4-21.tar.gz
Connecting to www.aps.anl.gov (164.54.98.14:80)
asyn4-21.tar.gz      100% |***************************************************************|  6842k  0:00:00 ETA
root@beaglebone:/opt/epics/R314.12.3/modules/soft/asyn# tar zxvf asyn4-21.tar.gz
root@beaglebone:/opt/epics/R314.12.3/modules/soft/asyn# mv asyn4-21 4-21
root@beaglebone:/opt/epics/R314.12.3/modules/soft/asyn# cd 4-21
root@beaglebone:/opt/epics/R314.12.3/modules/soft/asyn/4-21# vi configure/RELEASE

#RELEASE Location of external products

#SUPPORT=/corvette/home/epics/devel
#-include $(TOP)/../configure/SUPPORT.$(EPICS_HOST_ARCH)

#  IPAC is only necessary if support for Greensprings IP488 is required
#  IPAC release V2-7 or later is required.
#IPAC=$(SUPPORT)/ipac-2-11

# SEQ is required for testIPServer
SNCSEQ=/opt/epics/R314.12.3/modules/soft/seq/2.1.14

#  EPICS_BASE 3.14.6 or later is required
LINUX_GPIB=NO
EPICS_BASE=/opt/epics/R314.12.3/base
-include $(TOP)/../configure/EPICS_BASE.$(EPICS_HOST_ARCH)

root@beaglebone:/opt/epics/R314.12.3/modules/soft/asyn/4-21# make

               :

/usr/bin/gcc -c  -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500            -DUNIX  -D_BSD_SOURCE -Dlinux  -D_REENTRANT   -O3   -Wall          -fPIC -MMD -I. -I../O.Common -I. -I.. -I../../asyn/asynDriver -I../../asyn/asynGpib -I../../asyn/drvAsynSerial -I../../asyn/interfaces -I../../asyn/miscellaneous -I../../asyn/asynPortDriver/exceptions -I../../asyn/asynPortDriver -I../../asyn/devEpics -I../../asyn/asynRecord -I../../asyn/vxi11 -I../../asyn/ni1014 -I../../asyn/devGpib -I../../include/os/Linux -I../../include  -I/opt/epics/R314.12.3/modules/soft/seq/2.1.14/include   -I/opt/epics/R314.12.3/base/include/os/Linux -I/opt/epics/R314.12.3/base/include       ../../asyn/asynRecord/drvAsyn.c
cp ../vxi11/vxi11core.rpcl .
rpcgen  vxi11core.rpcl
make[2]: rpcgen: Command not found
make[2]: *** [vxi11core_xdr.c] Error 127
make[2]: Leaving directory `/opt/epics/R314.12.3/modules/soft/asyn/4-21/asyn/O.linux-arm'
make[1]: *** [install.linux-arm] Error 2
make[1]: Leaving directory `/opt/epics/R314.12.3/modules/soft/asyn/4-21/asyn'
make: *** [asyn.install] Error 2

今回はrpcgenがないと言われて、エラーになる。
色々調べた結果、glibc-utilsに入っているようなので、パッケージをインストール。

root@beaglebone:~/pkg# wget http://www.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/base/eglibc-utils_2.16-r15+svnr20393.5_armv7a-vfp-neon.ipk
Connecting to www.angstrom-distribution.org (188.40.83.200:80)
eglibc-utils_2.16-r1 100% |***************************************************************|   157k  0:00:00 ETA
root@beaglebone:~/pkg# opkg install eglibc-utils_2.16-r15+svnr20393.5_armv7a-vfp-neon.ipk
Installing eglibc-utils (2.16-r15+svnr20393.5) to root...
Configuring eglibc-utils.
root@beaglebone:~/pkg# opkg files eglibc-utils
Package eglibc-utils (2.16-r15+svnr20393.5) is installed on root and has the following files:
/usr/bin/sprof
/usr/bin/gencat
/usr/bin/pcprofiledump
/usr/sbin/zic
/usr/bin/sotruss
/usr/bin/getent
/usr/bin/locale
/usr/sbin/zdump
/usr/bin/getconf
/usr/bin/iconv
/usr/bin/makedb
/usr/bin/rpcgen
/usr/bin/pldd
/usr/bin/tzselect
/usr/bin/xtrace
/usr/sbin/iconvconfig

入ってたので、再度make。
今度はコンパイル完了。

StreamDevice

asynを入れたらStreamDeviceを入れないと意味がない。

root@beaglebone:/opt/epics/R314.12.3/modules/soft# mkdir stream
root@beaglebone:/opt/epics/R314.12.3/modules/soft# cd stream
root@beaglebone:/opt/epics/R314.12.3/modules/soft/stream# wget http://epics.web.psi.ch/software/streamdevice/StreamDevice-2-6.tgz
Connecting to epics.web.psi.ch (129.129.190.101:80)
StreamDevice-2-6.tgz 100% |***************************************************************|   154k  0:00:00 ETA
root@beaglebone:/opt/epics/R314.12.3/modules/soft/stream# tar zxvf StreamDevice-2-6.tgz
root@beaglebone:/opt/epics/R314.12.3/modules/soft/stream# mv StreamDevice-2-6 2-6

StreamDeviceはいつもと同じ方法でコンパイルOK