| 1 | = EPICS install = |
| 2 | |
| 3 | == ディレクトリ構造 == |
| 4 | 今回は、インストール先を {{{ /opt/epics }}} 以下とする。 |
| 5 | |
| 6 | |
| 7 | {{{ |
| 8 | [epics@myvm1 ~]$ su - |
| 9 | |
| 10 | [root@myvm1 ~]# cd /opt |
| 11 | [root@myvm1 opt]# mkdir epics |
| 12 | [root@myvm1 opt]# chown epics:epics epics |
| 13 | }}} |
| 14 | |
| 15 | |
| 16 | 全体の方針(appとかcssディレクトリは当面必要ない) |
| 17 | {{{ |
| 18 | /opt |
| 19 | └─ epics |
| 20 | ├─ R314.12.3 |
| 21 | │ ├─ base <--- base |
| 22 | │ ├─ extensions <--- extensions |
| 23 | │ ├─ modules <--- modules |
| 24 | │ │ ├─ soft |
| 25 | │ │ │ ├─ asyn |
| 26 | │ │ │ ├─ seq |
| 27 | │ │ │ ├─ stream |
| 28 | │ │ │ └─ ...... |
| 29 | │ │ │ |
| 30 | │ │ └─ instruments |
| 31 | │ │ ├─ xxx |
| 32 | │ │ └─ ...... |
| 33 | │ │ |
| 34 | │ │ |
| 35 | │ └── etc <--- 環境設定など |
| 36 | │ |
| 37 | ├─ app <--- 各グループ用の運転用アプリケーション |
| 38 | │ ├── CO |
| 39 | │ ├── LLRF |
| 40 | │ ├── VAC |
| 41 | │ └── .... |
| 42 | │ |
| 43 | ├─ css |
| 44 | │ ├── download |
| 45 | │ └── linux-x86 |
| 46 | │ |
| 47 | └── arc <--- ダウンロードしてきたファイル置き場 |
| 48 | |
| 49 | }}} |
| 50 | |
| 51 | |
| 52 | ディレクトリを作成し、ダウンロードしたファイルをarcに置いておく. |
| 53 | {{{ |
| 54 | [epics@myvm1 ~]$ cd /opt/epics/ |
| 55 | [epics@myvm1 epics]$ ls |
| 56 | [epics@myvm1 epics]$ mkdir R314.12.3 |
| 57 | [epics@myvm1 epics]$ mkdir arc |
| 58 | [epics@myvm1 epics]$ cd arc |
| 59 | [epics@myvm1 arc]$ wget http://www.aps.anl.gov/epics/download/base/baseR3.14.12.3.tar.gz |
| 60 | [epics@myvm1 arc]$ wget http://www.aps.anl.gov/epics/download/modules/asyn4-21.tar.gz |
| 61 | [epics@myvm1 arc]$ wget http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-2.1.12.tar.gz |
| 62 | |
| 63 | [epics@myvm1 arc]$ wget http://www.aps.anl.gov/epics/download/extensions/extensionsTop_20120904.tar.gz |
| 64 | [epics@myvm1 arc]$ wget http://www.aps.anl.gov/epics/download/extensions/gateway2_0_4_0.tar.gz |
| 65 | [epics@myvm1 arc]$ wget http://www.aps.anl.gov/epics/download/extensions/msi1-6.tar.gz |
| 66 | [epics@myvm1 arc]$ wget http://downloads.sourceforge.net/project/procserv/2.6.0/procServ-2.6.0.tar.gz |
| 67 | |
| 68 | [epics@myvm1 arc]$ wget http://epics.web.psi.ch/software/streamdevice/StreamDevice-2-6.tgz |
| 69 | [epics@myvm1 arc]$ wget http://epics.web.psi.ch/software/streamdevice/StreamDevice-2-6-patch20121113 |
| 70 | |
| 71 | }}} |
| 72 | |
| 73 | |
| 74 | {{{ |
| 75 | [epics@myvm1 ~]$ cd /opt/epics/R314.12.3 |
| 76 | [epics@myvm1 R314.12.3]$ gzip -dc ../arc/baseR3.14.12.3.tar.gz | tar xvf - |
| 77 | [epics@myvm1 R314.12.3]$ mv base-3.14.12.3 base |
| 78 | }}} |
| 79 | |
| 80 | |
| 81 | 環境変数の設定。 |
| 82 | {{{ |
| 83 | [epics@myvm1 base]$ setenv EPICS_HOST_ARCH linux-x86 |
| 84 | [epics@myvm1 base]$ setenv LANG C |
| 85 | }}} |
| 86 | |
| 87 | .cshrcにも書いておく |
| 88 | {{{ |
| 89 | [epics@myvm1 base]$ vi ~/.cshrc |
| 90 | |
| 91 | setenv EPICS_HOST_ARCH linux-x86 |
| 92 | set path=(/opt/epics/R314.12.3/base/bin/${EPICS_HOST_ARCH} /opt/epics/R314.12.3/extensions/bin/${EPICS_HOST_ARCH} $path) |
| 93 | }}} |
| 94 | |
| 95 | |
| 96 | |
| 97 | makeかける(本当はconfigure/以下のディレクトリを参照して、サイト依存の定義ファイルを適宜書き換える必要があるのだが、とりあえずVM上で使う分には全てデフォルトのままでmake一発でも問題ない....だろう) |
| 98 | {{{ |
| 99 | [epics@myvm1 base]$ pwd |
| 100 | /opt/epics/R314.12.3/base |
| 101 | [epics@myvm1 base]$ setenv LANG C |
| 102 | [epics@myvm1 base]$ make |& tee log_make |
| 103 | }}} |
| 104 | エラーが出ずに終了すればOK。足りないライブラリ等があればyumで適宜インストールする。 |
| 105 | |
| 106 | caget, camonitor などのコマンドが実行できるかどうかを確認。 |
| 107 | |
| 108 | == application 作成して動作確認 == |
| 109 | {{{ |
| 110 | [epics@myvm1 ~]$ mkdir app |
| 111 | [epics@myvm1 ~]$ cd app/ |
| 112 | [epics@myvm1 ~/app]$ mkdir example |
| 113 | [epics@myvm1 ~/app]$ cd example |
| 114 | |
| 115 | [epics@myvm1 example]$ makeBaseApp.pl -l |
| 116 | Valid application types are: |
| 117 | support |
| 118 | ioc |
| 119 | caServer |
| 120 | example |
| 121 | caClient |
| 122 | Valid iocBoot types are: |
| 123 | ioc |
| 124 | example |
| 125 | |
| 126 | [epics@myvm1 ~/app]$ makeBaseApp.pl -t example example |
| 127 | [epics@myvm1 ~/app]$ makeBaseApp.pl -i -t example example |
| 128 | Using target architecture linux-x86 (only one available) |
| 129 | The following applications are available: |
| 130 | example |
| 131 | What application should the IOC(s) boot? |
| 132 | The default uses the IOC's name, even if not listed above. |
| 133 | Application name? |
| 134 | [epics@myvm1 example]$ |
| 135 | |
| 136 | |
| 137 | [epics@myvm1 example]$ ls |
| 138 | Makefile configure exampleApp iocBoot |
| 139 | [epics@myvm1 example]$ make |
| 140 | ....... |
| 141 | [epics@myvm1 example]$ ls |
| 142 | Makefile bin configure db dbd exampleApp include iocBoot lib |
| 143 | |
| 144 | [epics@myvm1 example]$ cd iocBoot/iocexample/ |
| 145 | [epics@myvm1 iocexample]$ chmod +x st.cmd |
| 146 | [epics@myvm1 iocexample]$ ./st.cmd |
| 147 | #!../../bin/linux-x86/example |
| 148 | ## You may have to change example to something else |
| 149 | ## everywhere it appears in this file |
| 150 | < envPaths |
| 151 | epicsEnvSet("ARCH","linux-x86") |
| 152 | epicsEnvSet("IOC","iocexample") |
| 153 | epicsEnvSet("TOP","/home/epics/app/example") |
| 154 | epicsEnvSet("EPICS_BASE","/opt/epics/R314.12.3/base") |
| 155 | cd /home/epics/app/example |
| 156 | ## Register all support components |
| 157 | dbLoadDatabase "dbd/example.dbd" |
| 158 | example_registerRecordDeviceDriver pdbbase |
| 159 | ## Load record instances |
| 160 | dbLoadTemplate "db/userHost.substitutions" |
| 161 | dbLoadRecords "db/dbSubExample.db", "user=epicsHost" |
| 162 | ## Set this to see messages from mySub |
| 163 | #var mySubDebug 1 |
| 164 | ## Run this to trace the stages of iocInit |
| 165 | #traceIocInit |
| 166 | cd /home/epics/app/example/iocBoot/iocexample |
| 167 | iocInit |
| 168 | Starting iocInit |
| 169 | ############################################################################ |
| 170 | ## EPICS R3.14.12.3 $Date: Mon 2012-12-17 14:11:47 -0600$ |
| 171 | ## EPICS Base built May 9 2013 |
| 172 | ############################################################################ |
| 173 | iocRun: All initialization complete |
| 174 | ## Start any sequence programs |
| 175 | #seq sncExample, "user=epicsHost" |
| 176 | epics> dbl |
| 177 | epicsHost:ai1 |
| 178 | epicsHost:ai2 |
| 179 | epicsHost:ai3 |
| 180 | epicsHost:aiExample |
| 181 | epicsHost:aiExample1 |
| 182 | epicsHost:aiExample2 |
| 183 | epicsHost:aiExample3 |
| 184 | epicsHost:aSubExample |
| 185 | epicsHost:calc1 |
| 186 | epicsHost:calc2 |
| 187 | epicsHost:calc3 |
| 188 | epicsHost:calcExample |
| 189 | epicsHost:calcExample1 |
| 190 | epicsHost:calcExample2 |
| 191 | epicsHost:calcExample3 |
| 192 | epicsHost:compressExample |
| 193 | epicsHost:subExample |
| 194 | epicsHost:xxxExample |
| 195 | epics> |
| 196 | |
| 197 | }}} |
| 198 | |
| 199 | |
| 200 | |
| 201 | {{{ |
| 202 | [epics@myvm1 ~]$ camonitor epicsHost:ai1 |
| 203 | epicsHost:ai1 2013-05-09 15:46:32.849534 0 LOLO MAJOR |
| 204 | epicsHost:ai1 2013-05-09 15:46:33.850045 1 LOLO MAJOR |
| 205 | epicsHost:ai1 2013-05-09 15:46:34.850436 2 LOLO MAJOR |
| 206 | epicsHost:ai1 2013-05-09 15:46:35.850790 3 LOW MINOR |
| 207 | epicsHost:ai1 2013-05-09 15:46:36.851606 4 LOW MINOR |
| 208 | |
| 209 | }}} |
| 210 | |
| 211 | |
| 212 | == excasで動作確認 == |
| 213 | こっちが先か? |
| 214 | {{{ |
| 215 | [epics@myvm1 ~]$ excas |
| 216 | |
| 217 | [epics@myvm1 example]$ camonitor jane |
| 218 | jane 2013-05-09 15:50:58.817616 0.160158 |
| 219 | jane 2013-05-09 15:50:59.729124 0.0654289 |
| 220 | jane 2013-05-09 15:50:59.824466 0.0727615 |
| 221 | jane 2013-05-09 15:50:59.920104 0.00726627 |
| 222 | jane 2013-05-09 15:51:00.015853 0.0968468 |
| 223 | jane 2013-05-09 15:51:00.111367 0.0201175 |
| 224 | jane 2013-05-09 15:51:00.207458 0.100361 |
| 225 | jane 2013-05-09 15:51:00.303285 0.0551737 |
| 226 | }}} |