Installing CODA2.6
Notes on Installing CODA 2.6 on Red Hat Enterprise Linux Workstation release 6.5 on a 64-bit machine ( with "uname -m" returning x86_64 ).
authors Robert Michaels, with Rakitha Beminiwattha
Contents
Finding CODA version
I do not officially support CODA; you should ask the DAQ group for that. However, I note that CODA is on /site/coda and you can do a recursive copy of the version you want. Currently we are using 2.6.2 on most of our setups. In principle, you don't have to make a copy if you are on site and have mounted /site/coda. Instead you can use /site/coda/2.6.2/.setup (note the dot!) with slight modifications, see more on this below. Personally, I think it's a good idea to have a private copy of the CODA software, and of course it's necessary if you are off-site.
Once you get the official CODA there is usually a *README* file with it (the * are wildcards -- other text)
Please see also the official CODA web page
https://coda.jlab.org/wiki/index.php/Main_Page
Account and environment
I normally use the tcsh. This means the account should be registered to use this shell in the /etc/passwd file. I think bash would work, too. For example
entry in /etc/passwd compton:x:500:501:compton:/home/compton:/bin/tcsh
An example of a .tcshrc login script
[compton@compton ~]$ more .tcshrc #!/bin/csh # # This environment must be changed to match your system # This is a minimalist example setenv CODA /site/coda/2.6.2 echo Setting up coda 2.6.2 from ${CODA} source $CODA/.setup setenv MSQL_TCP_HOST compton setenv MSQL_HOME /home/compton/rcdb setenv EXPID compton_polarimeter setenv SESSION cpt1 setenv KILL_CODA_SCRIPT /home/compton/bin/kill_coda_script # CODA 3 Run Control echo AFECS Home set to ${CODA}/afecs setenv AFECS_HOME ${CODA}/afecs setenv CMSG_HOME ${CODA}/cMsg setenv COOL_HOME /home/compton/coda/cool setenv RCREMLOG /home/compton/coda/ setenv CODA_DB_DRIVER com.imaginary.sql.msql.MsqlDriver setenv CODA_DB_URL jdbc:msql://${MSQL_TCP_HOST}:8101/$EXPID #setenv CODA_DB_USER #setenv CODA_DB_PASSWORD setenv JAVA_HOME /u/apps/java/jdk1.6.0_03 setenv PATH ${AFECS_HOME}/bin:${JAVA_HOME}/bin:~/bin:$PATH echo done.
Another, someone more elaborate example
[adaq@atedf3 ~]$ more .tcshrc # tcshrc initialization file. # # Needed for running CODA 2.6 on Linux. # The default shell should be tcsh. # # Warning - For VxWorks targets to successfully boot # from this account the .tcshrc file should # NOT print anything to stdout (no 'echo', etc) set history=1000 set autologout=0 set ignoreeof set notify set savehist=1000 set noclobber set autolist # CODA version setenv CODA /home/coda/2.6.2 source $CODA/.setup setenv MSQL_TCP_HOST atedf3 setenv MSQL_HOME /usr/local/msql_log setenv EXPID atedf setenv SESSION compton # CODA 3 Run Control setenv AFECS_HOME $CODA/afecs setenv CMSG_HOME $CODA/cMsg setenv CODA_DIRECTORY /home/adaq/coda26 setenv COOL_HOME $CODA_DIRECTORY/cool setenv RCREMLOG $CODA_DIRECTORY setenv CODA_DB_DRIVER com.imaginary.sql.msql.MsqlDriver # this is like $MSQL_TCP_HOST:8101/$EXPID setenv CODA_DB_URL jdbc:msql://atedf3.jlab.org:8101/atedf setenv CODA_DB_USER atedf setenv CODA_DB_PASSWORD setenv EXPERIMENT compton setenv EPICS_CA_AUTO_ADDR_LIST YES setenv EPICS_CA_ADDR_LIST "129.57.255.12 129.57.255.13" setenv KILL_CODA_SCRIPT /adaqfs/halla/adaq/bin/kcoda setenv AUTOBOOT TRUE setenv EDITOR emacs setenv VISUAL ${EDITOR} setenv PRINTER cha2hp setenv LPDEST ${PRINTER} # version of quartus ("linux" is 32-bit, "linux64" is 64-bit) setenv QUARTUS /home/adaq/altera/10.1sp1/quartus/linux # may need this for ccppc # setenv GCC_EXEC_PREFIX /adaqfs/appsroot/gnu-vxworks/gnu-ppc/lib/gcc-lib/ setenv ROOTSYS /u/apps/root/5.34.05/root setenv PATH ${ROOTSYS}/bin:${PATH}:/home/adaq/bin:${QUARTUS} if (!($?LD_LIBRARY_PATH)) then setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:.:/home/adaq/crl:/usr/lib64:${QUARTUS} else setenv LD_LIBRARY_PATH ${ROOTSYS}/lib:.:/home/adaq/crl:/usr/lib64:${QUARTUS}:${LD_LIBRARY_PATH} endif setenv CVS_RSH ssh alias rm '/bin/rm -i' alias govme 'ssh -Y intelvmeha6 -l adev' setenv JAVA_HOME /u/apps/java/jdk1.6.0_03 setenv PATH ${AFECS_HOME}/bin:${JAVA_HOME}/bin:$PATH
MSQL and COOL databases
CODA 2.6 has TWO databases to maintain. You can see /site/coda/2.6.*/*README* for an explanation of why. Briefly, there is a msqld database that is a carryover from CODA 2.5, and a COOL database that is needed by their Java GUI rcgui (this GUI is new with CODA 2.6).
Editing and maintaining the msqld database was pretty well explained here for CODA 2.5, so I won't repeat myself:
http://hallaweb.jlab.org/equipment/daq/coda_hints.html
Regarding the COOL database:
1. The environment variable $COOL_HOME points to it.
2. The COOL database is a bunch of text files, so in principle you could edit them with emacs if you understood the syntax.
3. It is best to create this database in an automatic way. The first time you run "platform" it starts this process. Then in "rcgui" you can create the COOL database from the msql database as follows: a) Select Options, then b) CODA2 database; then c) Run Types and select your run type and click OK. Note: you must do this every time you change the msql database for that configuration.
4. I think that eventually the msql database will no longer exist (CODA version 3 ?). Not sure exactly when -- ask the DAQ group.
5. How to get scripts to the COOL database in such a way that they actually run is shown here:
To add scripts: 1. Add the scripts to MSQL database. 2. Do the translation to COOL. The script now appears in $COOL_HOME/$EXPID/config/Control/CONFIG/Processes where CONFIG is the CODA config you run. 3. See the *.rdf files there. Need to change cool:isSynchronous flag to false.
Readout Lists
For vxWorks, the readout lists for CODA 2.6 is was pretty much the same as for CODA 2.5 (explained here so I won't repeat myself)
http://hallaweb.jlab.org/equipment/daq/coda_hints.html
However, you do need to add make two changes in the boot script:
1. When you boot the ROC you need a line like this to allow the ROC to talk to the platform. Note, the 192 here is the subnet that the ROC is on, which is not necessarily the subnet of the host machine where the platform runs.
mRouteAdd("224.0.0.0","129.57.192.0",0xf0000000,0,0)
2. Use the correct version of coda_roc, which presently is coda_roc_rc3.6
For the IntelPCs there are significant differences in the readout lists. I may explain it later, but note the CODA web page which has some info about this
https://coda.jlab.org/wiki/index.php/Main_Page
Paranthetic note: what stops us from using CODA 3 in hall A is that we still have vxWorks. I believe that with CODA 3 they made a complete break from vxWorks and only use Intel PCs, e.g. in hall D.
Testing the First Time
Before running CODA with a VME crate, you should run it as a self-contained DAQ on the PC on which you installed it. This means running a "UNIX ROC" configuration, where the ROC runs on the PC and generates fake data. This exercises most of the installation.
Create a unix_list.so by taking unix_list.crl from an example and compiling with "makelist unix_list.crl native" The word "native" tells the compiler the code runs on this PC, not on a vxWorks platform for example. Next, run all the components "by hand" in separate xterms. This allows you to see error messages and crashes, which typically will happen until you sort out all the problems. et_start (note : if you ctrl-c out of et_start it's a good idea to "rm /tmp/et_sys_$SESSION" before restarting) platform (note: it's a good idea to wait 10 sec before starting other stuff. let platform do it's thing first) rcgui coda_eb_rc3 -i -s $SESSION -n EBU -t CDEB coda_er_rc3 -i -s $SESSION -n ERU -t ER coda_roc_rc3 -i -s $SESSION -n ROCU -t ROC Try to download, prestart, and start a run.
About "rcgui" buttons: The first time, you may have trouble guessing what they mean. I think they are mostly like a CD player buttons. A way to "discover" their meaning: click on the window (top bar), then let the mouse hover without clicking on top of a button whose meaning you want to find. A text like "End" or "Prestart" will appear within 5 sec. It takes some time to learn what sequence you need to go through to configure and get a run started.
Differences to CODA 2.5
Some differences between CODA 2.6 and 2.5 are noted here. If you've never used 2.5 this won't mean anything to you.
1. In addition to an msql database, you need a COOL database. This was explained above.
2. You need a couple changes to the vxWorks ROC boot script (see above).
3. rcgui is a new gui that replaces runcontrol.
4. If you use vxWorks the CRL codes are the same, but if you use IntelPCs it's a lot different. Some of this is documented on the CODA web page