wiki:epics/bbb/debian/install

EPICS インストール詳細

EPICS base R3.15.5

使用するEPICS baseは安定版の最新である3.15.5
前回作成した時はR3.14.12.3で、その時からmake一発でコンパイルできたので今回も同じ。
これを実行する前に、libreadline6-devをインストールしておかないと、IOCを作成時にiocshの履歴機能が使えなくなるので、あらかじめ入れておいたほうがいい。

root@beaglebone:~# apt-get install libreadline6-dev
root@beaglebone:~# cd /opt/epics
root@beaglebone:/opt/epics# mkdir -p R315.5/src
root@beaglebone:/opt/epics# cd R315.5/src
root@beaglebone:/opt/epics/R315.5/src# wget https://www.aps.anl.gov/epics/download/base/base-3.15.5.tar.gz
root@beaglebone:/opt/epics/R315.5/src# cd ..
root@beaglebone:/opt/epics/R315.5# tar zxvf base-3.15.5.tar.gz
root@beaglebone:/opt/epics/R315.5# mv base-3.15.5 base
root@beaglebone:/opt/epics/R315.5# cd base
root@beaglebone:/opt/epics/R315.5/base# make

modules/soft

次によく使うmodulesをインストール。

root@beaglebone:/opt/epics/R315.5# mkdir -p modules/soft

sequencer

インストール前にパッケージをインストール。

root@beaglebone:/opt/epics/R315.5# apt-get install re2c

展開してmake。

root@beaglebone:/opt/epics/R315.5# mkdir -p modules/soft/seq
root@beaglebone:/opt/epics/R315.5# cd src
root@beaglebone:/opt/epics/R315.5/src# wget http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.2.4.tar.gz
root@beaglebone:/opt/epics/R315.5/src# cd ../modules/soft/seq
root@beaglebone:/opt/epics/R315.5/modules/soft/seq# tar zxvf /opt/epics/R315.5/src/seq-2.2.4.tar.gz
root@beaglebone:/opt/epics/R315.5/modules/soft/seq# mv seq-2.2.4 2.2.4
root@beaglebone:/opt/epics/R315.5/modules/soft/seq# cd 2.2.4/
root@beaglebone:/opt/epics/R315.5/modules/soft/seq/2.2.4# emacs -nw configure/RELEASE

EPICS_BASE=/opt/epics/R315.5/base

root@beaglebone:/opt/epics/R315.5/modules/soft/seq/2.2.4# make

asyn

asynも普通にmakeできる。

root@beaglebone:/opt/epics/R315.5# mkdir -p modules/soft/asyn
root@beaglebone:/opt/epics/R315.5# cd src
root@beaglebone:/opt/epics/R315.5/src# wget https://www.aps.anl.gov/epics/download/modules/asyn4-31.tar.gz
root@beaglebone:/opt/epics/R315.5/src# cd ../modules/soft/asyn
root@beaglebone:/opt/epics/R315.5/modules/soft/asyn# tar zxvf /opt/epics/R315.5/src/asyn4-31.tar.gz
root@beaglebone:/opt/epics/R315.5/modules/soft/asyn# mv asyn4-31 4-31
root@beaglebone:/opt/epics/R315.5/modules/soft/asyn# cd 4-31/
root@beaglebone:/opt/epics/R315.5/modules/soft/asyn/4-31# emacs -nw 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-14

# SEQ is required for testIPServer
#SNCSEQ=$(SUPPORT)/seq-2-2-4
SNCSEQ=$(EPICS_BASE)/../modules/soft/seq/2.2.4/

#  EPICS_BASE 3.14.6 or later is required
#EPICS_BASE=/corvette/usr/local/epics-devel/base-3.15.5
EPICS_BASE=/opt/epics/R315.5/base
-include $(TOP)/../configure/EPICS_BASE.$(EPICS_HOST_ARCH)

root@beaglebone:/opt/epics/R315.5/modules/soft/asyn/4-31# make

streamdevice

streamdeviceも同じ。
但し、streamdeviceはgitHubに入っているので、masterをダウンロード。

root@beaglebone:/opt/epics/R315.5# mkdir -p modules/soft/stream
root@beaglebone:/opt/epics/R315.5# cd src
root@beaglebone:/opt/epics/R315.5/src# wget https://github.com/paulscherrerinstitute/StreamDevice/archive/master.zip
root@beaglebone:/opt/epics/R315.5/src# mv master.zip streamdevice.zip
root@beaglebone:/opt/epics/R315.5/src# cd ../modules/soft/stream
root@beaglebone:/opt/epics/R315.5/modules/soft/stream# unzip ../../../src/streamdevice.zip
root@beaglebone:/opt/epics/R315.5/modules/soft/stream# mv StreamDevice-master 2.7.7
root@beaglebone:/opt/epics/R315.5/modules/soft/stream# cd 2.7.7/

root@beaglebone:/opt/epics/R315.5/modules/soft/stream/2.7.7# export PATH=/opt/epics/R315.5/base/bin/linux-arm:$PATH
root@beaglebone:/opt/epics/R315.5/modules/soft/stream/2.7.7# makeBaseApp.pl -t support
root@beaglebone:/opt/epics/R315.5/modules/soft/stream/2.7.7# emacs -nw configure/RELEASE

SNCSEQ = $(EPICS_BASE)/../modules/soft/seq/2.2.4/
ASYN   = $(EPICS_BASE)/../modules/soft/asyn/4-31

ここで、/opt/epics/R315.5/modules/soft/stream/2.7.7以下の各ディレクトリにあるMakefileのTOPを変更。

TOP=..    -> TOP=.
TOP=../.. -> TOP=./..


root@beaglebone:/opt/epics/R315.5/modules/soft/stream/2.7.7# make

modules/instruments

BBBのIOを使うために専用(?)のmoduleをmakeする。
展開するディレクトリを作成。

root@beaglebone:/opt/epics/R315.5/modules# mkdir -p instruments/bbb

devgpio

GPIOを使うためのドライバサポート。
gitHubからダウンロード。

root@beaglebone:/opt/epics/R315.5/src# wget https://github.com/ffeldbauer/epics-devgpio/archive/master.zip
root@beaglebone:/opt/epics/R315.5/src# mv master.zip bbb_devgpio.zip
root@beaglebone:/opt/epics/R315.5/src# cd ../modules/instruments/bbb
root@beaglebone:/opt/epics/R315.5/modules/instruments/bbb# unzip ../../../src/bbb_devgpio.zip
root@beaglebone:/opt/epics/R315.5/modules/instruments/bbb# mv epics-devgpio-master devgpio
root@beaglebone:/opt/epics/R315.5/modules/instruments/bbb# cd devgpio
root@beaglebone:/opt/epics/R315.5/modules/instruments/bbb/devgpio# emacs -nw configure/RELEASE

SNCSEQ=$(EPICS_BASE)/../modules/soft/seq/2.2.4

# EPICS_BASE usually appears last so other apps can override stuff:
EPICS_BASE=/opt/epics/R315.5/base

root@beaglebone:/opt/epics/R315.5/modules/instruments/bbb/devgpio# make

drvAsynI2C

今度はI2Cを使うためのドライバサポート。
asynとstreamdeviceでI2Cが使えるようになる。
これもgitHubからダウンロード。

root@beaglebone:/opt/epics/R315.5/src# wget https://github.com/ffeldbauer/drvAsynI2C/archive/master.zip
root@beaglebone:/opt/epics/R315.5/src# mv master.zip bbb_asyni2c.zip
root@beaglebone:/opt/epics/R315.5/src# cd ../modules/instruments/bbb
root@beaglebone:/opt/epics/R315.5/modules/instruments/bbb# unzip ../../../src/bbb_asyni2c.zip
root@beaglebone:/opt/epics/R315.5/modules/instruments/bbb# mv drvAsynI2C-master drvAsynI2C
root@beaglebone:/opt/epics/R315.5/modules/instruments/bbb# cd drvAsynI2C
root@beaglebone:/opt/epics/R315.5/modules/instruments/bbb/drvAsynI2C# emacs -nw configure/RELEASE

EPICS_BASE=/opt/epics/R315.5/base
ASYN=$(EPICS_BASE)/../modules/soft/asyn/4-31

root@beaglebone:/opt/epics/R315.5/modules/instruments/bbb/drvAsynI2C# make

このままの状態ではstreamdeviceを使った通信ができないので、一緒に入っているパッチをStreamDeviceにあてる必要がある。
パッチを当てるstreamdeviceは 2.7.7_I2Cとして別にコンパイルしなおす。

root@beaglebone:/opt/epics/R315.5/modules/instruments/bbb/drvAsynI2C# cd /opt/epics/R315.5/modules/soft/stream/
root@beaglebone:/opt/epics/R315.5/modules/soft/stream# cp -r 2.7.7 2.7.7_I2C
root@beaglebone:/opt/epics/R315.5/modules/soft/stream# cd 2.7.7_I2C
root@beaglebone:/opt/epics/R315.5/modules/soft/stream/2.7.7_I2C# patch -p2 < /opt/epics/R315.5/modules/instruments/bbb/drvAsynI2C/streamDevice/0001-Added-asynI2C-interface.patch
patching file src/AsynDriverInterface.cc
patching file streamApp/Makefile
can't find file to patch at input line 87
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/configure/RELEASE b/configure/RELEASE
|index bee74c1..b95de67 100644
|--- a/configure/RELEASE
|+++ b/configure/RELEASE
--------------------------
File to patch: ^C

configure/RELEASEは自分で編集。以下の行を追加。

DRVASYNI2C=$(EPICS_BASE)/../modules/instruments/bbb/drvAsynI2C

root@beaglebone:/opt/epics/R315.5/modules/soft/stream/2.7.7_I2C# make clean;make

IOCで使うときには、configure/RELEASEに

ASYN       = $(EPICS_BASE)/../modules/soft/asyn/4-31
STREAM     = $(EPICS_BASE)/../modules/soft/stream/2.7.7_I2C
DRVASYNI2C = $(EPICS_BASE)/../modules/instruments/bbb/drvAsynI2C

を設定する。

extensions

extensionsのconfig fileをダウンロードして展開。

root@beaglebone:/opt/epics/R315.5# cd src/
root@beaglebone:/opt/epics/R315.5/src# wget https://www.aps.anl.gov/epics/download/extensions/extensionsTop_20120904.tar.gz
root@beaglebone:/opt/epics/R315.5/src# cd ..
root@beaglebone:/opt/epics/R315.5# tar zxvf src/extensionsTop_20120904.tar.gz

procServ

procServはなんか新しくなったみたい。githubに入っていたので、masterのzipを取得。

root@beaglebone:/opt/epics/R315.5/extensions# cd src/
root@beaglebone:/opt/epics/R315.5/extensions/src# wget https://github.com/ralphlange/procServ/archive/master.zip

              :
2017-06-21 00:16:04 (337 KB/s) - ‘master.zip’ saved [76417]

root@beaglebone:/opt/epics/R315.5/extensions/src# mv master.zip procServ.zip
root@beaglebone:/opt/epics/R315.5/extensions/src# unzip procServ.zip

展開したソースをmake。

root@beaglebone:/opt/epics/R315.5/extensions/src/procServ-master# make
Cleaning autotools debris
rm -f configure aclocal.m4 Makefile.in Makefile.Automake.in;
autoreconf -si
configure.ac:32: installing 'build-aux/compile'
configure.ac:14: installing 'build-aux/config.guess'
configure.ac:14: installing 'build-aux/config.sub'
configure.ac:15: installing 'build-aux/install-sh'
configure.ac:15: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'
root@beaglebone:/opt/epics/R315.5/extensions/src/procServ-master# ls
acceptFactory.cc  build-aux         connectionItem.cc  libtelnet.c        Makefile.in        procServ.h
aclocal.m4        ChangeLog         COPYING            libtelnet.h        NEWS               procServ.spec
appveyor.yml      clientFactory.cc  debian             makefile           processClass.h     procServ.txt
AUTHORS           configure         forkpty.c          Makefile.am        processFactory.cc  README.md
autom4te.cache    configure.ac      INSTALL            Makefile.Epics.in  procServ.cc
root@beaglebone:/opt/epics/R315.5/extensions/src/procServ-master# ./configure

     :

configure: error: Documentation not found.  Use --disable-doc to skip installing it, or --enable-doc to generate it

configureでエラーになる。gitHubのREADMEに、asciidocとlibtelnetに依存関係があるというので、asciidocのパッケージをaptで検索。

root@beaglebone:/opt/epics/R315.5/extensions/src/procServ-master# apt-cache search asciidoc
asciidoc - Highly configurable text format for writing documentation
asciidoctor - AsciiDoc to HTML rendering for Ruby
asciidoctor-doc - AsciiDoc to HTML rendering for Ruby (documentation)
root@beaglebone:/opt/epics/R315.5/extensions/src/procServ-master# apt-get install asciidoc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  dblatex docbook-dsssl docbook-utils docbook-xml docbook-xsl fonts-lmodern fonts-texgyre jadetex
  libaudio2 libauthen-sasl-perl libencode-locale-perl libfile-basedir-perl libfile-desktopentry-perl
  libfile-homedir-perl libfile-listing-perl libfile-mimeinfo-perl libfile-which-perl libfont-afm-perl
  libfontenc1 libharfbuzz-icu0 libhtml-form-perl libhtml-format-perl libhtml-parser-perl
  libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl
  libhttp-message-perl libhttp-negotiate-perl libio-html-perl libio-socket-ssl-perl libkpathsea6
  liblwp-mediatypes-perl liblwp-protocol-https-perl libmailtools-perl libmng1 libnet-dbus-perl
  libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libopenjpeg5 libosp5 libostyle1c2
  libpoppler-qt4-4 libpoppler46 libpotrace0 libptexenc1 libqt4-xml libqtcore4 libqtgui4 libruby2.1
  libsgmls-perl libsp1c2 libsynctex1 libtcl8.6 libtie-ixhash-perl libtk8.6 liburi-perl libwww-perl
  libwww-robotrules-perl libx11-protocol-perl libxml-parser-perl libxml-twig-perl libxml-xpathengine-perl
  libxml2-utils libxslt1.1 libxss1 libyaml-0-2 libyaml-tiny-perl libzzip-0-13 lmodern lynx lynx-cur
  openjade prerex preview-latex-style prosper ps2eps python-apt python-apt-common qtcore4-l10n ruby
  ruby2.1 rubygems-integration sgml-base sgml-data sgmlspl sp tcl tcl8.6 tex-common tex-gyre texlive
  texlive-base texlive-bibtex-extra texlive-binaries texlive-extra-utils texlive-font-utils
  texlive-fonts-recommended texlive-fonts-recommended-doc texlive-generic-recommended texlive-latex-base
  texlive-latex-base-doc texlive-latex-extra texlive-latex-extra-doc texlive-latex-recommended
  texlive-latex-recommended-doc texlive-math-extra texlive-pictures texlive-pictures-doc texlive-pstricks
  texlive-pstricks-doc tipa tk tk8.6 vprerex x11-utils xdg-utils xml-core xmlto xsltproc xterm zip
Suggested packages:
  source-highlight vim-addon-manager docbook graphicsmagick-imagemagick-compat imagemagick latex-cjk-all
  opensp pdf-viewer texlive-lang-all texlive-lang-cyrillic texlive-xetex transfig docbook-dsssl-doc
  docbook-defguide dbtoepub docbook-xsl-doc-html docbook-xsl-doc-pdf docbook-xsl-doc-text docbook-xsl-doc
  docbook-xsl-saxon fop libsaxon-java libxalan2-java libxslthl-java xalan nas libdigest-hmac-perl
  libgssapi-perl libdata-dump-perl libcrypt-ssleay-perl qt4-qtconfig sgmls-doc libauthen-ntlm-perl
  libunicode-map8-perl libunicode-string-perl xml-twig-tools doc-base python-apt-dbg python-gtk2
  python-vte python-apt-doc ri ruby-dev bundler sgml-base-doc perlsgml w3-recs tcl-tclreadline perl-tk
  latexdiff latexmk dvidvi fragmaster lacheck purifyeps xindy chktex dvipng psutils t1utils
  python-pygments libtcltk-ruby dot2tex gvfs-bin xmltex xfonts-cyrillic
Recommended packages:
  wish
The following NEW packages will be installed:
  asciidoc dblatex docbook-dsssl docbook-utils docbook-xml docbook-xsl fonts-lmodern fonts-texgyre jadetex
  libaudio2 libauthen-sasl-perl libencode-locale-perl libfile-basedir-perl libfile-desktopentry-perl
  libfile-homedir-perl libfile-listing-perl libfile-mimeinfo-perl libfile-which-perl libfont-afm-perl
  libfontenc1 libharfbuzz-icu0 libhtml-form-perl libhtml-format-perl libhtml-parser-perl
  libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl
  libhttp-message-perl libhttp-negotiate-perl libio-html-perl libio-socket-ssl-perl libkpathsea6
  liblwp-mediatypes-perl liblwp-protocol-https-perl libmailtools-perl libmng1 libnet-dbus-perl
  libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libopenjpeg5 libosp5 libostyle1c2
  libpoppler-qt4-4 libpoppler46 libpotrace0 libptexenc1 libqt4-xml libqtcore4 libqtgui4 libruby2.1
  libsgmls-perl libsp1c2 libsynctex1 libtcl8.6 libtie-ixhash-perl libtk8.6 liburi-perl libwww-perl
  libwww-robotrules-perl libx11-protocol-perl libxml-parser-perl libxml-twig-perl libxml-xpathengine-perl
  libxml2-utils libxslt1.1 libxss1 libyaml-0-2 libyaml-tiny-perl libzzip-0-13 lmodern lynx lynx-cur
  openjade prerex preview-latex-style prosper ps2eps python-apt python-apt-common qtcore4-l10n ruby
  ruby2.1 rubygems-integration sgml-base sgml-data sgmlspl sp tcl tcl8.6 tex-common tex-gyre texlive
  texlive-base texlive-bibtex-extra texlive-binaries texlive-extra-utils texlive-font-utils
  texlive-fonts-recommended texlive-fonts-recommended-doc texlive-generic-recommended texlive-latex-base
  texlive-latex-base-doc texlive-latex-extra texlive-latex-extra-doc texlive-latex-recommended
  texlive-latex-recommended-doc texlive-math-extra texlive-pictures texlive-pictures-doc texlive-pstricks
  texlive-pstricks-doc tipa tk tk8.6 vprerex x11-utils xdg-utils xml-core xmlto xsltproc xterm zip
0 upgraded, 125 newly installed, 0 to remove and 0 not upgraded.
Need to get 760 MB of archives.
After this operation, 1,251 MB of additional disk space will be used.

ディスク容量を食いそうなのでパス。次にlibtelnet。

root@beaglebone:/opt/epics/R315.5/extensions/src/procServ-master# apt-cache search libtelnet
libtelnet-dev - Small library for parsing the TELNET protocol - development files
libtelnet-utils - Small library for parsing the TELNET protocol - utilities
libtelnet2 - Small library for parsing the TELNET protocol - shared library
root@beaglebone:/opt/epics/R315.5/extensions/src/procServ-master# apt-get install libtelnet-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libtelnet2
Suggested packages:
  libtelnet-utils telnet
The following NEW packages will be installed:
  libtelnet-dev libtelnet2
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 44.0 kB of archives.
After this operation, 145 kB of additional disk space will be used.
Do you want to continue? [Y/n]
         :

libtelnetは問題ないのでインストールした。
本体のコンパイル。
gitHubのREADMEにBuilding with the EPICS Build Systemとあるので、--with-epics-topオプションを設定する。
docは必要ないのでdisable。

root@beaglebone:/opt/epics/R315.5/extensions/src/procServ-master# ./configure --with-epics-top=../.. --disable-doc
root@beaglebone:/opt/epics/R315.5/extensions/src/procServ-master# make

            :

root@beaglebone:/opt/epics/R315.5/extensions/src/procServ-master# make install

            :

root@beaglebone:/opt/epics/R315.5/extensions/src/procServ-master# ls -la /opt/epics/R315.5/extensions/bin/linux-arm
total 248
drwxr-xr-x 2 root root   4096 Jun 21 00:44 .
drwxr-xr-x 3 root root   4096 Jun 21 00:44 ..
-r-xr-xr-x 1 root root 243604 Jun 21 00:44 procServ

環境変数

最後に、環境変数設定スクリプトを作成。

root@beaglebone:/opt/epics/R315.5# mkdir etc
root@beaglebone:/opt/epics/R315.5# cd etc
root@beaglebone:/opt/epics/R315.5# emacs -nw setenv_R315_5.csh

setenv EPICS_HOST_ARCH linux-arm
setenv EPICS_BASE /opt/epics/R315.5/base
setenv EPICS_EXTENSIONS /opt/epics/R315.5/extensions

#setenv EPICS_CA_ADDR_LIST

setenv EPICS_CA_AUTO_ADDR_LIST NO
setenv EPICS_CA_MAX_ARRAY_BYTES 1000000

set path=(${EPICS_BASE}/bin/${EPICS_HOST_ARCH} ${EPICS_EXTENSIONS}/bin/${EPICS_HOST_ARCH} $path)

root@beaglebone:/opt/epics/R315.5# emacs -nw setenv_R315_5.sh

export EPICS_HOST_ARCH=linux-arm
export EPICS_BASE=/opt/epics/R315.5/base
export EPICS_EXTENSIONS=/opt/epics/R315.5/extensions

#export EPICS_CA_ADDR_LIST=

export EPICS_CA_AUTO_ADDR_LIST=NO
export EPICS_CA_MAX_ARRAY_BYTES=1000000

export PATH=$EPICS_BASE/bin/$EPICS_HOST_ARCH:$EPICS_EXTENSIONS/bin/$EPICS_HOST_ARCH:$PATH

Last modified 8 years ago Last modified on 06/21/17 15:18:52