Difference between revisions of "Installing CODA2.6"

From Hall A Wiki
Jump to: navigation, search
Line 148: Line 148:
 
http://hallaweb.jlab.org/equipment/daq/coda_hints.html
 
http://hallaweb.jlab.org/equipment/daq/coda_hints.html
  
Editing the COOL database:   
+
Regarding the COOL database:   
  
 
1. The environment variable $COOL_HOME points to it.
 
1. The environment variable $COOL_HOME points to it.
  
2. It is a bunch of text files, so in principle you could edit them with emacs if you understood the syntax.
+
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 better, though, 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 CODA2 database.
+
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 CODA2 database.
  
4. I think that eventually the msql database will no longer exist (CODA version 3 ?).  Not sure exactly what the plan is.
+
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:
 
5. How to get scripts to the COOL database in such a way that they actually run is shown here:

Revision as of 11:31, 21 March 2014

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

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)

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 CODA2 database.

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

Testing the First Time

Differences to CODA 2.5