= EPICS install = == ディレクトリ構造 == 今回は、インストール先を {{{ /opt/epics }}} 以下とする。 {{{ [epics@myvm1 ~]$ su - [root@myvm1 ~]# cd /opt [root@myvm1 opt]# mkdir epics [root@myvm1 opt]# chown epics:epics epics }}} 全体の方針(appとかcssディレクトリは当面必要ない) {{{ /opt └─ epics ├─ R314.12.3 │ ├─ base <--- base │ ├─ extensions <--- extensions │ ├─ modules <--- modules │ │ ├─ soft │ │ │ ├─ asyn │ │ │ ├─ seq │ │ │ ├─ stream │ │ │ └─ ...... │ │ │ │ │ └─ instruments │ │ ├─ xxx │ │ └─ ...... │ │ │ │ │ └── etc <--- 環境設定など │ ├─ app <--- 各グループ用の運転用アプリケーション │ ├── CO │ ├── LLRF │ ├── VAC │ └── .... │ ├─ css │ ├── download │ └── linux-x86 │ └── arc <--- ダウンロードしてきたファイル置き場 }}} ディレクトリを作成し、ダウンロードしたファイルをarcに置いておく. {{{ [epics@myvm1 ~]$ cd /opt/epics/ [epics@myvm1 epics]$ ls [epics@myvm1 epics]$ mkdir R314.12.3 [epics@myvm1 epics]$ mkdir arc [epics@myvm1 epics]$ cd arc [epics@myvm1 arc]$ wget http://www.aps.anl.gov/epics/download/base/baseR3.14.12.3.tar.gz [epics@myvm1 arc]$ wget http://www.aps.anl.gov/epics/download/modules/asyn4-21.tar.gz [epics@myvm1 arc]$ wget http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.1.12.tar.gz [epics@myvm1 arc]$ wget http://www.aps.anl.gov/epics/download/extensions/extensionsTop_20120904.tar.gz [epics@myvm1 arc]$ wget http://www.aps.anl.gov/epics/download/extensions/gateway2_0_4_0.tar.gz [epics@myvm1 arc]$ wget http://www.aps.anl.gov/epics/download/extensions/msi1-6.tar.gz [epics@myvm1 arc]$ wget http://downloads.sourceforge.net/project/procserv/2.6.0/procServ-2.6.0.tar.gz [epics@myvm1 arc]$ wget http://epics.web.psi.ch/software/streamdevice/StreamDevice-2-6.tgz [epics@myvm1 arc]$ wget http://epics.web.psi.ch/software/streamdevice/StreamDevice-2-6-patch20121113 }}} {{{ [epics@myvm1 ~]$ cd /opt/epics/R314.12.3 [epics@myvm1 R314.12.3]$ gzip -dc ../arc/baseR3.14.12.3.tar.gz | tar xvf - [epics@myvm1 R314.12.3]$ mv base-3.14.12.3 base }}} 環境変数の設定。 {{{ [epics@myvm1 base]$ setenv EPICS_HOST_ARCH linux-x86 [epics@myvm1 base]$ setenv LANG C }}} .cshrcにも書いておく {{{ [epics@myvm1 base]$ vi ~/.cshrc setenv EPICS_HOST_ARCH linux-x86 set path=(/opt/epics/R314.12.3/base/bin/${EPICS_HOST_ARCH} /opt/epics/R314.12.3/extensions/bin/${EPICS_HOST_ARCH} $path) }}} makeかける(本当はconfigure/以下のディレクトリを参照して、サイト依存の定義ファイルを適宜書き換える必要があるのだが、とりあえずVM上で使う分には全てデフォルトのままでmake一発でも問題ない....だろう) {{{ [epics@myvm1 base]$ pwd /opt/epics/R314.12.3/base [epics@myvm1 base]$ setenv LANG C [epics@myvm1 base]$ make |& tee log_make }}} エラーが出ずに終了すればOK。足りないライブラリ等があればyumで適宜インストールする。 caget, camonitor などのコマンドが実行できるかどうかを確認。 == application 作成して動作確認 == {{{ [epics@myvm1 ~]$ mkdir app [epics@myvm1 ~]$ cd app/ [epics@myvm1 ~/app]$ mkdir example [epics@myvm1 ~/app]$ cd example [epics@myvm1 example]$ makeBaseApp.pl -l Valid application types are: support ioc caServer example caClient Valid iocBoot types are: ioc example [epics@myvm1 ~/app]$ makeBaseApp.pl -t example example [epics@myvm1 ~/app]$ makeBaseApp.pl -i -t example example Using target architecture linux-x86 (only one available) The following applications are available: example What application should the IOC(s) boot? The default uses the IOC's name, even if not listed above. Application name? [epics@myvm1 example]$ [epics@myvm1 example]$ ls Makefile configure exampleApp iocBoot [epics@myvm1 example]$ make ....... [epics@myvm1 example]$ ls Makefile bin configure db dbd exampleApp include iocBoot lib [epics@myvm1 example]$ cd iocBoot/iocexample/ [epics@myvm1 iocexample]$ chmod +x st.cmd [epics@myvm1 iocexample]$ ./st.cmd #!../../bin/linux-x86/example ## You may have to change example to something else ## everywhere it appears in this file < envPaths epicsEnvSet("ARCH","linux-x86") epicsEnvSet("IOC","iocexample") epicsEnvSet("TOP","/home/epics/app/example") epicsEnvSet("EPICS_BASE","/opt/epics/R314.12.3/base") cd /home/epics/app/example ## Register all support components dbLoadDatabase "dbd/example.dbd" example_registerRecordDeviceDriver pdbbase ## Load record instances dbLoadTemplate "db/userHost.substitutions" dbLoadRecords "db/dbSubExample.db", "user=epicsHost" ## Set this to see messages from mySub #var mySubDebug 1 ## Run this to trace the stages of iocInit #traceIocInit cd /home/epics/app/example/iocBoot/iocexample iocInit Starting iocInit ############################################################################ ## EPICS R3.14.12.3 $Date: Mon 2012-12-17 14:11:47 -0600$ ## EPICS Base built May 9 2013 ############################################################################ iocRun: All initialization complete ## Start any sequence programs #seq sncExample, "user=epicsHost" epics> dbl epicsHost:ai1 epicsHost:ai2 epicsHost:ai3 epicsHost:aiExample epicsHost:aiExample1 epicsHost:aiExample2 epicsHost:aiExample3 epicsHost:aSubExample epicsHost:calc1 epicsHost:calc2 epicsHost:calc3 epicsHost:calcExample epicsHost:calcExample1 epicsHost:calcExample2 epicsHost:calcExample3 epicsHost:compressExample epicsHost:subExample epicsHost:xxxExample epics> }}} {{{ [epics@myvm1 ~]$ camonitor epicsHost:ai1 epicsHost:ai1 2013-05-09 15:46:32.849534 0 LOLO MAJOR epicsHost:ai1 2013-05-09 15:46:33.850045 1 LOLO MAJOR epicsHost:ai1 2013-05-09 15:46:34.850436 2 LOLO MAJOR epicsHost:ai1 2013-05-09 15:46:35.850790 3 LOW MINOR epicsHost:ai1 2013-05-09 15:46:36.851606 4 LOW MINOR }}} == excasで動作確認 == こっちが先か? {{{ [epics@myvm1 ~]$ excas [epics@myvm1 example]$ camonitor jane jane 2013-05-09 15:50:58.817616 0.160158 jane 2013-05-09 15:50:59.729124 0.0654289 jane 2013-05-09 15:50:59.824466 0.0727615 jane 2013-05-09 15:50:59.920104 0.00726627 jane 2013-05-09 15:51:00.015853 0.0968468 jane 2013-05-09 15:51:00.111367 0.0201175 jane 2013-05-09 15:51:00.207458 0.100361 jane 2013-05-09 15:51:00.303285 0.0551737 }}}