Difference between revisions of "Installing CODA"

From New IAC Wiki
Jump to navigation Jump to search
 
(96 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=download CODA 2.5=
+
=Installing CODA 2.5=
  
Go to the ftp web page
+
==Go to the ftp web page==
  
[ftp://ftp.jlab.org/pub/coda/2.5/w.example.com ftp://ftp.jlab.org/pub/coda/2.5/]
+
[ftp://ftp.jlab.org/pub/coda/2.5 ftp://ftp.jlab.org/pub/coda/2.5/]
  
 +
and save the files below into the CODA/2.5 subdirectory
  
from my JLAB account I got the latest 2.5 version from /site/coda/2.5/Linux-rhe
+
I currently have the files
  
create coda subdirectory
+
2.5 >ls -1
  
mkdir CODA/2.5
 
  
I already created the CODA subdirectory when I installed the VxWorks kernel and bootscripts
+
cdev_1.7.5.tar.gz
 +
tar - CMLOG-R2_1-PROD-1.tar.gz
 +
coda.setup
 +
codausersetup
 +
common.tar
 +
Linux-rhe.tar
 +
README.InstallFAQ
 +
README.x86-linux
 +
VXWORKSPPC55.tar
 +
x86-linux.tar
  
cd CODA/2.5
 
  
==scp the CODA binary version==
+
== Unpack the tar files ==
  
  scp -r tforest@jlab.org:/site/coda/2.5/Linux-rhe ./
+
  tar -zxvf cdev_1.7.5.tar.gz
 +
tar -zxvf CMLOG-R2_1-PROD-1.tar.gz
 +
tar -xvf Linux-rhe.tar
 +
tar -xvf VXWORKSPPC55.tar
 +
xvf x86-linux.tar
 +
xvf common.tar
  
A bin and lib subdirectory are created
+
remove the tar archives
  
 +
rm *.gz
 +
rm *.tar
  
also copy over the common, examples, and extensions subdirectories
+
Here is what my directory structure looks like now
  
  scp -r tforest@jlab.org:/site/coda/2.5/commons ./
+
  2.5 >ls -1
  scp -r tforest@jlab.org:/site/coda/2.5/examples ./
+
  cdev_1.7.5
  scp -r tforest@jlab.org:/site/coda/2.5/extensions ./
+
  CMLOG-R2_1-PROD-1
 +
coda.setup
 +
codausersetup
 +
common
 +
Linux
 +
README.InstallFAQ
 +
README.x86-linux
 +
tmp
 +
VXWORKSPPC55
 +
x86-linux
  
 +
== Setup the environment variables==
  
The extensions subdirectory has a lot of libraries for several VME modules.
+
Set environmental variables in file codauserscript
  
== scp the CMLOG files==
+
#!/bin/csh
 +
echo Setting up coda 2.5 on $HOST
 +
  setenv CODA /usr/local/coda/2.5
 +
source $CODA/coda.setup
 +
# Point to msqld on my host
 +
setenv MSQL_TCP_HOST daq1
 +
setenv MSQL_HOME $CODA/common/rcdb
 +
# My database/session
 +
setenv EXPID LDS
 +
setenv SESSION test
 +
# CMLOG browser (cmlog) setup file
 +
setenv CMLOG_CONFIG /usr/local/CMLOG/cmlogrc
 +
# broadcast message port must match that in /usr/local/CMLOG/cmlog.config
 +
setenv CMLOG_PORT 8102
 +
# User specific env variables
 +
setenv CODA_DIRECTORY /home/daq/CODA
 +
setenv CODA_DATA /data1
 +
cd ~/CODA
  
scp -r tforest@jlab.org:/site/coda/CMLOG ./
 
  
== download the gnu cross compiler==
+
== X windows needs==
  
scp -r tforest@jlab.org:/site/vxworks/5.5/ppc/host/x86-linux ./
+
CODA 2.5 requires libXm.so.3
  
also need the header files
+
Using CentOS 5  you need to install openmotif to get libXm.o.3
  
  scp -r tforest@jlab.org:/site/vxworks/5.5/ppc/target/h ./
+
  yum install opentmotif22-2.2.3-18-i386
  
 +
Stopped installation here
  
My directory structure looked like this
+
= Installing CODA 2.6=
  
 +
;Information source:
  
2.5 >ls -1
+
[https://coda.jlab.org/wiki/index.php/Main_Page  CODA wiki]
cdev_1.7.5
 
CMLOG-R2_1-PROD-1
 
common
 
Linux-rhe
 
VXWORKSPPC55
 
x86-linux
 
  
2.) as root create the following sudirectory and soft links
 
  
mkdir /usr/local/coda
 
chmod a+rw /usr/local/coda
 
  
ln -s /home/daq/CODA/2.5 /usr/local/coda/2.5
+
== Instructions to start up CODA==
ln -s /home/daq/CODA/2.5/CMLOG-R2_1-PROD-1 /usr/local/CMLOG
+
 
 +
It appears you only need two processes now to run CODA, "platform" and "rcgui".  It is probably still wise to have a terminal open monitoring the ROC
 +
 
 +
 
 +
 
 +
===To run coda2.6 platform:===
 +
# source /home/daq/CODA/2.6/setup
 +
# cd $AFECS_HOME/bin
 +
# platform
 +
 
 +
===To run coda2.6 run-control===
 +
# source /home/daq/CODA/2.6/setup
 +
# cd $AFECS_HOME/bin
 +
# rcgui -name g1
 +
 
 +
Following packages are installed:
 +
Java
 +
location:  /home/daq/Java/jdk1.6.0_17
 +
 
 +
Afecs-1.3
 +
location: /home/daq/CODA/2.6.1/Afecs-1.3
 +
 
 +
Following files were modified:
 +
~/.tcshrc
 +
/home/daq/CODA/2.6/setup
 +
/home/daq/CODA/2.6.1/Afecs-1.3/db/setup.xml
 +
 
 +
 
 +
 
 +
[ftp://ftp.jlab.org/pub/coda/2.6 ftp://ftp.jlab.org/pub/coda/2.6/]
 +
 
 +
and save the files below into the CODA/2.6 subdirectory
 +
 
 +
I currently have the files
 +
 
 +
==Errors setting up rcplatform==
 +
 
 +
set environment variables
 +
 
 +
setenv COOL_HOME /usr/local/coda/2.6/cool
 +
 
 +
setenv AFECS_HOME /usr/local/coda/2.6/afecs/1.0
 +
 
 +
<pre>
 +
got the error message
 +
 
 +
2.6 >rcplatform
 +
/usr/java/j2sdk1.4.2_14/bin/java: Command not found.
 +
</pre>
 +
 
 +
setenv JAVA_HOME /usr
 +
 
 +
got the error
 +
 
 +
<pre>
 +
2.6 >rcplatform
 +
Exception in thread "main" java.lang.NoClassDefFoundError: rca.coda
 +
  at gnu.java.lang.MainThread.run(libgcj.so.7rh)
 +
Caused by: java.lang.ClassNotFoundException: rca.coda not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
 +
  at java.net.URLClassLoader.findClass(libgcj.so.7rh)
 +
  at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
 +
  at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
 +
  at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
 +
  at gnu.java.lang.MainThread.run(libgcj.so.7rh)
 +
 
 +
</pre>
 +
 
 +
 
 +
Vardan recommended running "ant" from the subdirectory
 +
 
 +
/usr/local/coda/2.6/afecs/1.0/
 +
 
 +
I had to install "ant" for this so I logged in as root and typed
 +
 
 +
yum install ant
 +
 
 +
I now have
 +
<pre>
 +
1.0 >ant -version
 +
Apache Ant version 1.6.5 compiled on January 6 2007
 +
 
 +
</pre>
 +
 
 +
 
 +
The error message running ant is
 +
 
 +
<pre>
 +
 
 +
 
 +
1.0 >ant
 +
Buildfile: build.xml
 +
 
 +
init:
 +
 
 +
clean.module.afecs:
 +
 
 +
clean:
 +
 
 +
compile.module.afecs.production:
 +
    [mkdir] Created dir: /home/daq/CODA/2.6/afecs/afecs/classes
 +
 
 +
compile.module.afecs.tests:
 +
 
 +
compile.module.afecs:
 +
 
 +
build.jar:
 +
 
 +
BUILD FAILED
 +
/home/daq/CODA/2.6/afecs/1.0/build.xml:111: /home/daq/CODA/2.6/afecs/1.0/classes not found.
 +
 
 +
Total time: 0 seconds
 +
 
 +
</pre>
 +
 
 +
==Readout Library Git Repository==
 +
 
 +
All right.  I've updated the 'devel' branch of the mkLinuxvmeDist repo. v792 and v785 repos were added, and I've made them publicly available in the JeffersonLab github organization.
 +
 
 +
Found a bug, as well. It might've taken me awhile to notice it, if you hadn't emailed me.
 +
 
 +
Sure.. it's here:
 +
https://github.com/JeffersonLab/mkLinuxvmeDist.git
 +
 
 +
The 'devel' branch has the most recent updates.
 +
 
 +
===error including cMsg.h ===
 +
 
 +
[daq@daq2 remex]$ make
 +
Building remexLib.o
 +
gcc -I. -I/usr/include -I/home/daq/CODA/2.6.2/include -I/home/daq/CODA/2.6.2/common/include -D_GNU_SOURCE -lm -lresolv -rdynamic -lrt -ldl -L. -L/home/daq/CODA/2.6.2/Linux-`uname -m`/lib/ -lcmsg -lcmsgRegex -L/home/daq/CODA/2.6.2/lib -O2 -c -o remexLib.o remexLib.c
 +
remexLib.c:30:18: error: cMsg.h: No such file or directory
 +
remexLib.c: In function ‘remexAddName’:
 +
remexLib.c:186: error: ‘CMSG_OK’ undeclared (first use in this function)
 +
remexLib.c:186: error: (Each undeclared identifier is reported only once
 +
remexLib.c:186: error: for each function it appears in.)
 +
remexLib.c:190: warning: incompatible implicit declaration of built-in function ‘exit’
 +
remexLib.c: In function ‘remexInit’:
 +
remexLib.c:494: error: ‘CMSG_OK’ undeclared (first use in this function)
 +
remexLib.c: In function ‘remexClose’:
 +
remexLib.c:606: error: ‘CMSG_OK’ undeclared (first use in this function)
 +
remexLib.c: In function ‘remexCallback’:
 +
remexLib.c:637: warning: initialization makes pointer from integer without a cast
 +
make: *** [remexLib.o] Error 1
 +
 
 +
= Installing CODA 2.6.1=
 +
 
 +
;Information source:
 +
 
 +
[https://coda.jlab.org/wiki/index.php/Main_Page  CODA wiki]
 +
 
 +
== Software infrastructure==
 +
 
 +
1.) RHEL4 or higher  (RHEL5 issues are addressed in "examples/rhel5")
 +
 
 +
 
 +
~>less /etc/redhat-release
 +
CentOS release 5.3 (Final)
 +
 
 +
2.) you need to install [http://www.scons.org/ scons] for Redhat
 +
 
 +
I downloaded the READhat version and did
 +
 
 +
rpm -i scons-1.3.0-1.noarch.rpm
 +
 
 +
2.) next you need to be sure Java sdk 1.6 or higher is installed (/apps/java/jdk1.6.0_03)
 +
 
 +
Looking on my maching I saw
 +
~>java --version
 +
java version "1.4.2"
 +
gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-44)
 +
 
 +
went to http://java.sun.com/
 +
 
 +
and got the file
 +
 
 +
jdk-6u20-linux-i586-rpm.bin
 +
 
 +
 
 +
as root I did
 +
 
 +
chmod a+x jdk-6u20-linux-i586-rpm.bin
 +
./jdk-6u20-linux-i586-rpm.bin
 +
 
 +
It said
 +
 
 +
Java(TM) SE Development Kit 6 successfully installed.
 +
 
 +
but the install version is same as above
 +
 
 +
package jdk-1.6.0_20-fcs.i586 is already installed
 +
 
 +
It seems the rpm file does not install java onto the system but into its own directory
 +
 
 +
OK, I will unstall java under the DAQ account and use environmental variables to set the default java
 +
 
 +
<pre>
 +
2.6.1 >printenv | grep JAVA
 +
2.6.1 >JAVA_HOME=/home/daq/Java/jdk1.6.0_17
 +
$JAVA_HOME/bin/java -version
 +
java version "1.6.0_17"
 +
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
 +
Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
 +
</pre>
 +
 
 +
4.) VxWorks 5.5 Kernel and cross compiler (/site/vxworks/5.5/ppc/host/x86-linux/bin)
 +
 
 +
My ROC is set to load the kernel at
 +
 
 +
 
 +
/home/daq/CODA/VXWorks/vx6100_v4.1
 +
 
 +
 
 +
this seems to be V 5.5.1
 +
 
 +
 
 +
5.) change your ROC boot script to support Multicasts
 +
 
 +
add the line
 +
 
 +
# Add Routes for Multicast Support
 +
mRouteAdd("224.0.0.0","129.57.29.0",0xf0000000,0,0)
 +
 
 +
where the subnet 129.57.29.0 should be replaced by your local subnet.
 +
 
 +
 
 +
for me this is
 +
 
 +
# Add Routes for Multicast Support
 +
mRouteAdd("224.0.0.0","10.1.1.0",0xf0000000,0,0)
 +
 
 +
== Environmental Variables==
 +
 
 +
The script below sets up the environmental variables for running CODA
 +
 
 +
in particular the logMessage processes are taken out and the cMsg and new ROC libraries loaded.
 +
 
 +
<pre>
 +
 
 +
#!/bin/csh
 +
#
 +
# File:
 +
#      $/usr/local/coda/2.6/.setup
 +
#
 +
# Description:
 +
#      Setup file for CODA
 +
#
 +
# Set up CODA specific environment variables
 +
 
 +
        setenv CODA_VERSION 2.6
 +
        setenv OSTYPE      `uname|sed 's/-/_/'`
 +
 
 +
        grep Enterprise /etc/redhat-release >& /dev/null
 +
        if ($status == 0) then
 +
            setenv OSTYPE Linux
 +
        endif
 +
 
 +
        if ($?CODA != "1") then
 +
            setenv CODA      /usr/local/coda/2.6
 +
        endif
 +
 
 +
        if ($?CDEVROOT != "1") then
 +
            setenv CDEVROOT /site/coda/cdev_1.7.5
 +
        endif
 +
 
 +
        setenv CODA_BIN $CODA/$OSTYPE/bin
 +
        setenv CODA_LIB $CODA/$OSTYPE/lib
 +
 
 +
        if ( $OSTYPE == "SunOS") then
 +
        setenv CDEV_LIB  $CDEVROOT/lib/solaris
 +
        else
 +
        setenv CDEV_LIB  $CDEVROOT/lib/$OSTYPE
 +
        endif
 +
 
 +
        setenv CODA_CBIN  $CODA/common/bin
 +
 
 +
        setenv TCL_ROOT    /usr/local/tclc1.1b2.sol
 +
        setenv TCL_LIBRARY $CODA/common/lib/tcl7.4
 +
        setenv ITCL_LIBRARY $CODA/common/lib/itcl2.0
 +
        setenv TK_LIBRARY  $CODA/common/lib/tk
 +
        setenv ITK_LIBRARY $CODA/common/lib/itk2.0
 +
        setenv DP_LIBRARY  $CODA/common/lib/dp
 +
        setenv TIX_LIBRARY $CODA/common/lib/tix
 +
 
 +
        setenv VXWORKS_ROOT /site/vxworks
 +
 
 +
#      Overwrite this in your own .cshrc file!
 +
        setenv EXPID LDS
 +
        setenv TCLINCLUDE_DIR $CODA/common/include
 +
        setenv TKINCLUDE_DIR $CODA/common/include
 +
 
 +
        set lpath = "`echo $path | sed s+$CODA_BIN++g`"
 +
        set path = ($CODA_BIN $lpath)
 +
 
 +
 
 +
# Do not clobber LD_LIBRARY_PATH
 +
        if ($?LD_LIBRARY_PATH) then
 +
            setenv LD_LIBRARY_PATH  ${LD_LIBRARY_PATH}:${CODA_LIB}:${CDEV_LIB}
 +
        else
 +
            setenv LD_LIBRARY_PATH  ${CODA_LIB}:${CDEV_LIB}
 +
        endif
 +
 
 +
        if ($?CDEVDDL != "1") then
 +
            setenv CDEVDDL $CODA_LIB/coda.ddl
 +
        endif
 +
        if ($?CDEVSHOBJ != "1") then
 +
            setenv CDEVSHOBJ $CODA_LIB
 +
        endif
 +
 
 +
#      debug utility
 +
#-----------------------------------------------
 +
# setenv FFLAGS "-w1 -O -Olimit 1500"
 +
# setenv CFLAGS
 +
# setenv CFLAGS -O
 +
#alias debug "set debug_args=(\!:*); source $DD_BIN/debug.csh; unset debug_args"
 +
#echo "CODA $CODA_VERSION setup script..."
 +
#echo "========================"
 +
#echo ""
 +
#echo "Operating system $OSTYPE."
 +
#echo ""
 +
#echo "Environment"
 +
#echo ""
 +
#echo "Default experiment EXPID        = $EXPID"
 +
#echo "TCL_LIBRARY                    = $TCL_LIBRARY"
 +
#echo "TK_LIBRARY                      = $TK_LIBRARY"
 +
#echo "DP_LIBRARY                      = $DP_LIBRARY"
 +
#echo "TIX_LIBRARY                    = $TIX_LIBRARY"
 +
#echo ""
 +
#echo "Directories"
 +
#echo ""
 +
#echo "Root directory,    CODA        = $CODA"
 +
#echo "Executables,      CODA_BIN    = $CODA_BIN"
 +
#echo "Libraries,        CODA_LIB    = $CODA_LIB"
 +
#echo "VxWorks files,    VXWORKS_ROOT = $VXWORKS_ROOT"
 +
#echo "================================="
 +
setenv AFECS_HOME /home/daq/CODA/2.6.1/Afecs-1.3
 +
setenv COOL_HOME /home/daq/CODA/2.6.1/Afecs-1.3/db
 +
setenv SESSION DAQ
 +
setenv MSQL_TCP_HOST daq1
 +
setenv MSQL_HOME $CODA/common/rcdb
 +
 
 +
</pre>
 +
 
 +
== ROC boot script==
 +
 
 +
The ROC boot script need to load in several new components
 +
 
 +
my new bootscript "roc1.boot" now says
 +
 
 +
<pre>
 +
 
 +
# Boot file for CODA ROC 2.0
 +
# PowerPC version
 +
 
 +
hostAdd "daq1.physics.isu.edu","10.1.1.1"
 +
hostAdd "daq1","10.1.1.1"
 +
hostAdd "localdaq","10.1.1.1"
 +
 
 +
 
 +
# Add Routes for Multicast Support
 +
mRouteAdd("224.0.0.0","10.1.1.0",0xf0000000,0,0)
 +
 
 +
 
 +
# up the sliding window
 +
tcp_sendspace=0x8000
 +
tcp_recvspace=0x8000
 +
 
 +
# Setup environment / load coda_roc
 +
putenv "MSQL_TCP_HOST=daq1"
 +
putenv "EXPID=LDS"
 +
putenv "TCL_LIBRARY=/usr/local/coda/2.5/common/lib/tcl7.4"
 +
putenv "ITCL_LIBRARY=/usr/local/coda/2.5/common/lib/itcl2.0"
 +
putenv "DP_LIBRARY=/usr/local/coda/2.5/common/lib/dp"
 +
putenv "CMLOG_PORT=8102"
 +
putenv "TOKEN_PORT=5555"
 +
putenv "SESSION=DAQ"
 +
 
 +
 
 +
# Download Message logging libraries/client
 +
#ld < /usr/local/coda/2.6.1/extensions/tempeDma/usrTempeDma.o
 +
 
 +
# Load cMsg Stuff
 +
cd "/usr/local/coda/2.6.1/cMsg/vxworks-ppc"
 +
ld< lib/libcmsgRegex.o
 +
ld< lib/libcmsg.o
 +
 
 +
cd "/usr/local/coda/2.6.1/VXWORKSPPC55/bin"
 +
ld < coda_roc_rc3.4
 +
 
 +
#ld < caSrvr
 +
 
 +
cd "/home/daq/CODA/ROClibs/libs"
 +
ld < sis3610Lib.o 
 +
ld < v260Lib.o
 +
ld < v1495Lib.o
 +
#ld < v792Lib.o
 +
#ld < adc1182_ppc.o 
 +
#ld < scale32Lib_ppc.o
 +
#ld < pas9740Lib_ppc.o
 +
 
 +
# Get around Clock returning 0 1st time its called
 +
mytv = malloc(8)
 +
clock_gettime(0,mytv)
 +
# Spawn tasks
 +
taskDelay (60*15)
 +
# spawn the roc task
 +
 
 +
taskSpawn ("ROC",200,0x8,250000,coda_roc,"","-s","DAQ","-objects","roc1 ROC")
 +
 
 +
</pre>
 +
 
 +
== Create RCplatform database==
 +
 
 +
<pre>
 +
2.6.1 >afecs/bin/platform
 +
Warning: COOL_HOME does not have a required srtucture.
 +
Auto-create default structure? Y/N
 +
y
 +
Warning: Can not find clients database file.
 +
Warning: Can not find sessions database file.
 +
>> **** cMsg server sucessfully started at Wed Jun 02 11:35:51 MDT 2010 **** <<
 +
**************************************************
 +
*            Afecs-1.3 Platform                *
 +
**************************************************
 +
- Name        = LDS
 +
- Host        = daq1.physics.isu.edu
 +
- TCP port    = 45000
 +
- UDP port    = 45000
 +
- RC UDP port  = 45200
 +
- Start time  = 2010/06/02 11:35:51
 +
**************************************************
 +
**************************************************
 +
*            Afecs-1.3 Container                *
 +
**************************************************
 +
APlatform:Info Registration request from daq1.physics.isu.edu_admin agent runnin
 +
g at daq1.physics.isu.edu
 +
- Name                  = daq1.physics.isu.edu_admin
 +
- Host                  = daq1.physics.isu.edu
 +
- Start time            = 2010/06/02 11:35:54
 +
- Connected to:
 +
- Platform              = daq1.physics.isu.edu
 +
- Platform TCP port    = 45000
 +
- Platform UDP port    = 45000
 +
- Platform RC UDP port  = 45200
 +
**************************************************
 +
 
 +
</pre>
 +
 
 +
 
 +
== Start up the CODA components==
 +
 
 +
I didn't have the cMsg shared object directory in my path so
 +
 
 +
setenv LD_LIBRARY_PATH /home/daq/ROOT/root/lib:/usr/local/coda/2.6.1/Linux/lib:/site/coda/cdev_1.7.5/lib/Linux:/home/daq/CODA/2.6.1/cMsg/Linux-i686/lib/
 +
 
 +
 
 +
start up the usual
 +
 
 +
et_start
 +
 
 +
coda_eb_rc3.3 -i -s DAQ -n eb1 -t CDEB
 +
 
 +
coda_er_rc3 -i -s DAQ -n LDS_ER -t ER
 +
 
 +
then start up the runcontrol gui
 +
 
 +
rcgui
 +
 
 +
== Start the Run control GUI==
 +
 
 +
run the Run control gui with the command
 +
 
 +
rcgui
 +
 
 +
== First time session creation==
 +
 
 +
You need to convert your old data base to the new one using the "Option" menu
 +
 
 +
Option->CODA2 Database->Session
 +
 
 +
I selected the only one listed which was "DAQ"
 +
 
 +
 
 +
I then selected the Control->Connect menus item and The tools icon became active.
 +
 
 +
Now you need to transfer one of the run configurations into the new data base
 +
 
 +
Option->CODA2 Database->Run Types
 +
 
 +
I selected the SIS3610 run type since this is my trigger supervisor.
 +
 
 +
 
 +
== ROC error message==
 +
 
 +
Connecting to ROC failed
 +
 
 +
-> Running the cMsg RC client, "roc1"                                         
 +
  connecting to UDL, cMsg:rc://multicast/LDS
 +
 
 +
The ROC is not registering with "platform" as I do not see any messages in the platform window
 +
 
 +
== using codamaster==
 +
 
 +
the program codamaster is a Tcl based GUI for launching CODA processes like event recorder, event builder, the ET system, and run control.
 +
 
 +
You need to edit the codamaster script located in $CODA_BIN/codamaster to identify the event builder and recorder names so the global variables read
 +
 
 +
<pre>
 +
set ERNAME "LDS_ER"
 +
set EBNAME "eb1"
 +
</pre>
 +
 
 +
 
 +
after that all you neet to do to get the DAQ running is to launch "platform" and "codamaster" once you set up the environment by doing
 +
 
 +
source ~/CODA/2.6.1/setup
 +
 
 +
you will also want to open up a minicom session (as root) with the ROC to monitor messages
 +
 
 +
=Installing CODA 2.6.2 =
 +
 
 +
==Download files==
 +
 
 +
scp -r tforest@login1.jlab.org:/site/coda/2.6.2 ./
 +
 
 +
==install other software==
 +
 
 +
;scons
 +
:sudo yum install scons
 +
 
 +
;Java version 1.5.0
 +
 
 +
<pre>
 +
[daq@daq2 2.6.2]$ java --version
 +
java version "1.5.0"
 +
gij (GNU libgcj) version 4.4.6 20110731 (Red Hat 4.4.6-3)
 +
</pre>
 +
 
 +
;Instal JDK development environment
 +
 
 +
sudo yum install java-1.6.0-openjdk-devel.i686
 +
 
 +
==setup script for environmental variables==
 +
 
 +
[[coda2.6.2_setup.txt]]
 +
 
 +
===coda_eb_rc3 cant find cMsg shared library===
 +
<pre>
 +
 
 +
[daq@daq2 2.6.2]$ coda_eb_rc3
 +
coda_eb_rc3: error while loading shared libraries: libcmsgRegex.so: cannot open shared object file: No such file or directory
 +
</pre>
 +
 
 +
added path to cMsg library to environmental variable LD_LIBRATH_PATH
 +
 
 +
in setup script change line to
 +
 
 +
<pre>
 +
# Do not clobber LD_LIBRARY_PATH
 +
if ($?LD_LIBRARY_PATH) then
 +
    setenv LD_LIBRARY_PATH  ${LD_LIBRARY_PATH}:${CODA_LIB}:${CDEV_LIB}:${CODA}/cMsg/Linux-i686/lib/
 +
 
 +
</pre>
 +
 
 +
 
 +
<pre>
 +
[daq@daq2 2.6.2]$ printenv LD_LIBRARY_PATH
 +
/usr/local/root/lib:/home/daq/CODA/2.6.2/Linux/lib:/site/coda/cdev_1.7.5/lib/Linux:/home/daq/CODA/2.6.2/Linux/lib:/site/coda/cdev_1.7.5/lib/Linux:/home/daq/CODA
 +
</pre>
 +
 
 +
==Startup CODA programs==
 +
 
 +
source CODA/2.6.2/setup
 +
 
 +
start up msqld, et_start, rcplatform
 +
 
 +
coda_eb_rc3 -i -s DAQ -n eb1 -t CDEB
 +
 
 +
coda_er_rc3 -i -s DAQ -n LDS_ER -t ER
 +
 
 +
login to the ROC (rocdaq1) and start the process
 +
 
 +
coda_roc_rc3 -t ROC -n rocdaq1
 +
 
 +
==Running codamaster==
 +
 
 +
1.) the dpwish distribution looks for
 +
 
 +
<pre>
 +
/home/daq/CODA/2.6.2/Linux/bin/dpwish: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
 +
</pre>
 +
 
 +
CentOS6 uses
 +
 
 +
/usr/lib/libstdc++.so.6
 +
 
 +
so I installed the older version using yum
 +
 
 +
sudo yum install libstdc++.so.5
 +
 
 +
2.) codamaster looks for a msqld with the LDS experiment defined in the data bas.
 +
 
 +
I copied the msql data base from daq1.
 +
 
 +
==Intel ROCS==
 +
 
 +
;The readoutlists and the ROC libraries are all compiled on the Linux ROC
 +
;Before they were cross compiled on the host machine for VxWorks
 +
 
 +
run the program below on the ROC
 +
 
 +
coda_roc_rc3 -t ROC -n rocdaq1 -msqld_host 134.50.3.12
 +
 
 +
Note: I copied the CODA subdirectory to the ROC
 +
 
 +
 
 +
===Compiling SIS3610===
 +
 
 +
On the ROC computer you should have the subdirectory called linuxvme
 +
 
 +
 
 +
  LINUXVME_INC = /root/linuxvme/include
 +
  LINUXVME_LIB = /root/linuxvme/lib
 +
 
 +
 
 +
You'll need to compile it with
 +
make
 +
 
 +
New way of compiling the .crl's.  Just make them with
 +
make -f Makefile-rol gen_int_list.so
 +
 
 +
The .so's you'll need to include in the database (instead of the vxWorks .o files).
 +
 
 +
There's a test program in the "test" directory to test the interrupt capability of the sis3610.  You can compile that with
 +
  make
 +
then run it with
 +
  s3610LibTest
 +
You will probably have to modify the sis3610 VME address within the source code.
 +
 
 +
All this assumes you've set up your environment variables:
 +
  LINUXVME_INC
 +
  LINUXVME_LIB
 +
to their proper locations.
 +
 
 +
= Now setup ROC script=
 +
 
 +
==Installing CMLOG==
 +
 
 +
I copied the binary files at /site/coda/cmlog over to /home/daq/CODA/2.5
 +
 
 +
~/CODA >scp -r tforest@ftp.jlab.org:/site/coda/CMLOG ./
 +
 
 +
== ROC boot script==
 +
create the roc boot script and write it to /home/daq/CODA/bootscripts/roc1.boot
 +
 
 +
# Boot file for CODA ROC 2.0
 +
# PowerPC version
 +
 
 +
# up the sliding window
 +
tcp_sendspace=0x8000
 +
tcp_recvspace=0x8000
 +
 
 +
# Setup environment / load coda_roc
 +
putenv "MSQL_TCP_HOST=daq1"
 +
putenv "EXPID=LDS"
 +
putenv "TCL_LIBRARY=/home/daq/CODA/2.5/common/lib/tcl7.4"
 +
putenv "ITCL_LIBRARY=/home/daq/CODA/2.5/common/lib/itcl2.0"
 +
putenv "DP_LIBRARY=/home/daq/CODA/2.5/common/lib/dp"
 +
putenv "CMLOG_PORT=8102"
 +
putenv "TOKEN_PORT=5555"
 +
putenv "SESSION=daq"
 +
 
 +
# Download Message logging libraries/client
 +
ld < /home/daq/CODA/2.5/CMLOG/2.1/bin/ppc-vw55/cmlogClientD
 +
ld < /home/daq/CODA/2.5/CMLOG/2.1/lib/ppc-vw55/libcmlog.a
 +
ld < /home/daq/CODA/2.5/CMLOG/2.1/bin/ppc-vw55/cmlogVxLogMsg
 +
#cd "/home/daq/CODA/2.5/VXWORKSPPC55/lib"
 +
#ld < libcamac.o
 +
 
 +
cd "/home/daq/CODA/2.5/VXWORKSPPC55/bin"
 +
ld < coda_roc
 +
#ld < caSrvr
 +
 
 +
#cd "/home/daq/ROClibs"
 +
#ld < adc1182_ppc.o 
 +
#ld < scale32Lib_ppc.o
 +
#ld < pas9740Lib_ppc.o
 +
#ld < sis3610Lib_ppc.o 
 +
 
 +
# Spawn tasks
 +
sp cmlogClientD
 +
sp cmlogVxLogMsg
 +
taskDelay (60*5)
 +
# spawn the CAMAC remote server
 +
taskSpawn "caServ",110,spTaskOptions,10000,caSrvr_main
 +
# spawn the roc task
 +
taskSpawn ("ROC",200,0x8,250000,coda_roc,"-i","-s","daq","-objects","roc1 ROC")
 +
 
 +
 
 +
==as root create the following subdirectory and soft links==
 +
 
 +
 
 +
ln -s /home/daq/CODA /usr/local/coda
 +
 
 +
ln -s /home/daq/CODA/2.5/x86-linux /usr/local/x86-linux
 +
 
 +
mkdir /usr/local/gnu
 +
 
 
ln -s /home/daq/CODA/2.5/x86-linux /usr/local/gnu/x86-linux
 
ln -s /home/daq/CODA/2.5/x86-linux /usr/local/gnu/x86-linux
  
 
+
==set the environmental variables==
3.) set the environmental variables
 
  
 
create a script to setup the environmenal variables
 
create a script to setup the environmenal variables
  
  
#!/bin/csh   
+
#!/bin/csh   
echo Setting up coda 2.5 on $HOST   
+
echo Setting up coda 2.5 on $HOST   
setenv CODA /usr/local/coda   
+
setenv CODA /usr/local/coda   
#  
+
#  
source $CODA/coda.setup   
+
source $CODA/coda.setup   
 
+
# Point to msqld on my host   
# Point to msqld on my host   
+
setenv MSQL_TCP_HOST daq1   
setenv MSQL_TCP_HOST daq1   
+
setenv MSQL_HOME /usr/local/coda/common/rcdb   
setenv MSQL_HOME /usr/local/coda/common/rcdb   
+
# My database/session   
 
+
setenv EXPID ISU_LDS   
# My database/session   
+
setenv SESSION DAQ   
setenv EXPID ISU_LDS   
+
# CMLOG browser (cmlog) setup file   
setenv SESSION DAQ   
+
setenv CMLOG_CONFIG /home/data1/CODA/cmlogrc   
 
+
# broadcast message port must match that in /usr/local/CMLOG/cmlog.config   
# CMLOG browser (cmlog) setup file   
+
setenv CMLOG_PORT 8102   
setenv CMLOG_CONFIG /home/data1/CODA/cmlogrc   
+
# User specific env variables   
# broadcast message port must match that in /usr/local/CMLOG/cmlog.config   
+
setenv CODA_DIRECTORY /home/daq/CODA   
setenv CMLOG_PORT 8102   
+
setenv CODA_DATA /data1   
 
+
  # set up to use Cross compilers  
# User specific env variables   
+
set path = ( $path . /usr/local/gnu/x86-linux/bin ${CODA}/2.5/Linux-rhe/bin )  
setenv CODA_DIRECTORY /home/daq/CODA   
 
setenv CODA_DATA /data1   
 
   
 
# set up to use Cross compilers  
 
set path = ( $path . /usr/local/gnu/x86-linux/bin ${CODA}/2.5/Linux-rhe/bin )  
 
  
  
4.) setup msql
+
==start msql==
  
 
startup msql deamon
 
startup msql deamon
  
msqld
+
msqld
  
 
and let in run
 
and let in run
  
in another window startup cedit
+
== reboot ROC and check that all the libraries loaded==
 +
 
 +
=Create Run Configuration=
 +
 
 +
Be sure the msql database is running
 +
 
 +
~/CODA >msqld
 +
mSQL Server 1.0.16coda starting ...
 +
setjmp returned 0
 +
Checking Authority to use databases in /usr/local/coda/common/rcdb
 +
loading administration ACL msql.acl
 +
admin ACL loaded
 +
loading ACL for database LDS
 +
Warning : Couldn't open ACL file: No such file or directory
 +
database LDS ACL loaded.
 +
ACL load done
 +
 
 +
 
 +
==cedit==
 +
 
 +
CODA uses the msql database to hold information reguarding host computer names, IP adresses, output files, and others.  You can create your first data base entry using cedit and then edit it like a spreadsheet using dbedit.  Below is an example of a simple database configuration after installing all the components using cedit.
 +
 
 +
[[Image:DataBaseSetupUsingCedit.jpg | 400 px]]<br>
 +
 
 +
create another window startup cedit
  
create a new database using the "File" men
+
create a new database using the "File" menu "New Database"
  
 
I gave it the name "LDS"
 
I gave it the name "LDS"
  
I quite cedit and restarted to check that it was stil there.
+
I quit cedit and restarted to check that it was still there.
  
now add components:
+
 
 +
now add components
 +
 
 +
==create and event builder ==
 +
 
 +
click on the icon for the event builder (blocks being assembled)
 +
 
 +
[[Image:CeditCreateEBbutton.jpg]]
 +
 
 +
Name: eb1 <br>
 +
Ethernet Host:134.50.3.210    ! this is the daq1 IP address<br>
 +
ID # : 1<br>
 +
 
 +
== created a roc ==
 +
 
 +
click on the 2nd icon below the gun which looks like the image below
 +
 
 +
[[Image:CeditCreateROCButton.jpg]]
 +
 
 +
Name: roc1 <br>
 +
Ethernet Host: 134.50.3.216
 +
Id Number: 2
 +
Booting String $CODA_BIN/coda_roc
 +
Readout List:$CODA/readoutlist/SIS3610/gen_int_list.crl
 +
 
 +
 
 +
== connect ROC and EB ==
 +
 
 +
You create a connection from the ROC to the EB by clicking  on the green square on the ROC a drwaing a red line to a green square on the EB.
 +
 
 +
== create an Event Recorder (ER) button ==
 +
 
 +
click on the image which looks like a cassette tape:
 +
 
 +
[[Image:CediteCreateERbutton.jpg]]
 +
 
 +
This will create and event recorder component which you will then conenct to a output file component
 +
 
 +
== create an output file component==
 +
 
 +
click on the icon which looks like a bullseye to create an output file component
 +
 
 +
[[Image:CeditCreateOutputFileComponent.jpg]]
 +
 
 +
== connect ER and output file==
 +
 
 +
Click on the ER's green tab to draw a red line from the ER to a green tab on the output file component.
 +
 
 +
== created coda file output ==
 +
 
 +
clicking on bullseye like symbol in cedit
 +
 
 +
then clicked on green scquares to tie EB to bullseye
 +
 
 +
== dbedit==
 +
 
 +
I usually check everything using dbedit.  It is a spreadsheet like interface allowing you to edit data base cells.
 +
 
 +
using dbedit:
  
 
to get DBEDIT to run I had to add the following to LD_LIBRARY_PATH
 
to get DBEDIT to run I had to add the following to LD_LIBRARY_PATH
  
 +
so now I have
 +
 +
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/CMLOG/lib/Linux:${CODA}/Linux-rhe/lib:${CODA}/cdev_1.7.5/lib/Linux-rh9
 
:${CODA}/cdev_1.7.5/lib/Linux-rh9
 
:${CODA}/cdev_1.7.5/lib/Linux-rh9
  
 +
== codamaster==
 +
 +
setenv KILL_CODA_SCRIPT
 +
 +
then run codamaster
 +
 +
everything was reported as down.
  
so now I have
 
  
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/CMLOG/lib/Linux:${CODA}/Linux-rhe/lib:${CODA}/cdev_1.7.5/lib/Linux-rh9
+
10.) had comment line in $CODA_BIN/makelist
  
i.) event builder:
+
#      $CODA_BIN/fb_strip < $DOING_FILE.i.c > $DOING_FILE.c 
  
click on the icon for the event builder (blocks being assembled)
 
  
Name: eb1
 
Ethernet Host:134.50.3.210    ! this is the daq1 IP address
 
ID # : 1
 
  
 
5.) rcServer
 
5.) rcServer
Line 163: Line 984:
  
  
 
9.) created coda file clicking on bullseye like symbol in cedit
 
  
 
10.) had comment line in $CODA_BIN/makelist
 
 
#      $CODA_BIN/fb_strip < $DOING_FILE.i.c > $DOING_FILE.c 
 
  
  
Line 182: Line 997:
  
 
makelist test_list.crl native
 
makelist test_list.crl native
 +
 +
 +
=Readoutlist=
 +
 +
makelist gen_int_list.crl ppc
 +
 +
 +
[http://wiki.iac.isu.edu/index.php/Data_Acquisition return to DAQ page]

Latest revision as of 21:00, 28 October 2016

Installing CODA 2.5

Go to the ftp web page

ftp://ftp.jlab.org/pub/coda/2.5/

and save the files below into the CODA/2.5 subdirectory

I currently have the files

2.5 >ls -1


cdev_1.7.5.tar.gz

tar - CMLOG-R2_1-PROD-1.tar.gz

coda.setup
codausersetup
common.tar
Linux-rhe.tar
README.InstallFAQ
README.x86-linux
VXWORKSPPC55.tar
x86-linux.tar


Unpack the tar files

tar -zxvf cdev_1.7.5.tar.gz
tar -zxvf CMLOG-R2_1-PROD-1.tar.gz
tar -xvf Linux-rhe.tar
tar -xvf VXWORKSPPC55.tar
xvf x86-linux.tar
xvf common.tar

remove the tar archives

rm *.gz
rm *.tar

Here is what my directory structure looks like now

2.5 >ls -1
cdev_1.7.5
CMLOG-R2_1-PROD-1
coda.setup
codausersetup
common
Linux
README.InstallFAQ
README.x86-linux
tmp
VXWORKSPPC55
x86-linux

Setup the environment variables

Set environmental variables in file codauserscript

#!/bin/csh
echo Setting up coda 2.5 on $HOST
 setenv CODA /usr/local/coda/2.5
source $CODA/coda.setup
# Point to msqld on my host
setenv MSQL_TCP_HOST daq1
setenv MSQL_HOME $CODA/common/rcdb
# My database/session
setenv EXPID LDS
setenv SESSION test
# CMLOG browser (cmlog) setup file
setenv CMLOG_CONFIG /usr/local/CMLOG/cmlogrc
# broadcast message port must match that in /usr/local/CMLOG/cmlog.config
setenv CMLOG_PORT 8102
# User specific env variables
setenv CODA_DIRECTORY /home/daq/CODA
setenv CODA_DATA /data1
cd ~/CODA


X windows needs

CODA 2.5 requires libXm.so.3

Using CentOS 5 you need to install openmotif to get libXm.o.3

yum install opentmotif22-2.2.3-18-i386
Stopped installation here

Installing CODA 2.6

Information source

CODA wiki


Instructions to start up CODA

It appears you only need two processes now to run CODA, "platform" and "rcgui". It is probably still wise to have a terminal open monitoring the ROC


To run coda2.6 platform:

  1. source /home/daq/CODA/2.6/setup
  2. cd $AFECS_HOME/bin
  3. platform

To run coda2.6 run-control

  1. source /home/daq/CODA/2.6/setup
  2. cd $AFECS_HOME/bin
  3. rcgui -name g1

Following packages are installed: Java location: /home/daq/Java/jdk1.6.0_17

Afecs-1.3 location: /home/daq/CODA/2.6.1/Afecs-1.3

Following files were modified: ~/.tcshrc /home/daq/CODA/2.6/setup /home/daq/CODA/2.6.1/Afecs-1.3/db/setup.xml


ftp://ftp.jlab.org/pub/coda/2.6/

and save the files below into the CODA/2.6 subdirectory

I currently have the files

Errors setting up rcplatform

set environment variables

setenv COOL_HOME /usr/local/coda/2.6/cool

setenv AFECS_HOME /usr/local/coda/2.6/afecs/1.0

got the error message

2.6 >rcplatform
/usr/java/j2sdk1.4.2_14/bin/java: Command not found.

setenv JAVA_HOME /usr

got the error

2.6 >rcplatform
Exception in thread "main" java.lang.NoClassDefFoundError: rca.coda
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)
Caused by: java.lang.ClassNotFoundException: rca.coda not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.7rh)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)


Vardan recommended running "ant" from the subdirectory

/usr/local/coda/2.6/afecs/1.0/

I had to install "ant" for this so I logged in as root and typed

yum install ant

I now have

1.0 >ant -version
Apache Ant version 1.6.5 compiled on January 6 2007


The error message running ant is



1.0 >ant
Buildfile: build.xml

init:

clean.module.afecs:

clean:

compile.module.afecs.production:
    [mkdir] Created dir: /home/daq/CODA/2.6/afecs/afecs/classes

compile.module.afecs.tests:

compile.module.afecs:

build.jar:

BUILD FAILED
/home/daq/CODA/2.6/afecs/1.0/build.xml:111: /home/daq/CODA/2.6/afecs/1.0/classes not found.

Total time: 0 seconds

Readout Library Git Repository

All right. I've updated the 'devel' branch of the mkLinuxvmeDist repo. v792 and v785 repos were added, and I've made them publicly available in the JeffersonLab github organization.

Found a bug, as well. It might've taken me awhile to notice it, if you hadn't emailed me.

Sure.. it's here: https://github.com/JeffersonLab/mkLinuxvmeDist.git

The 'devel' branch has the most recent updates.

error including cMsg.h

[daq@daq2 remex]$ make Building remexLib.o gcc -I. -I/usr/include -I/home/daq/CODA/2.6.2/include -I/home/daq/CODA/2.6.2/common/include -D_GNU_SOURCE -lm -lresolv -rdynamic -lrt -ldl -L. -L/home/daq/CODA/2.6.2/Linux-`uname -m`/lib/ -lcmsg -lcmsgRegex -L/home/daq/CODA/2.6.2/lib -O2 -c -o remexLib.o remexLib.c remexLib.c:30:18: error: cMsg.h: No such file or directory remexLib.c: In function ‘remexAddName’: remexLib.c:186: error: ‘CMSG_OK’ undeclared (first use in this function) remexLib.c:186: error: (Each undeclared identifier is reported only once remexLib.c:186: error: for each function it appears in.) remexLib.c:190: warning: incompatible implicit declaration of built-in function ‘exit’ remexLib.c: In function ‘remexInit’: remexLib.c:494: error: ‘CMSG_OK’ undeclared (first use in this function) remexLib.c: In function ‘remexClose’: remexLib.c:606: error: ‘CMSG_OK’ undeclared (first use in this function) remexLib.c: In function ‘remexCallback’: remexLib.c:637: warning: initialization makes pointer from integer without a cast make: *** [remexLib.o] Error 1

Installing CODA 2.6.1

Information source

CODA wiki

Software infrastructure

1.) RHEL4 or higher (RHEL5 issues are addressed in "examples/rhel5")


~>less /etc/redhat-release 
CentOS release 5.3 (Final)

2.) you need to install scons for Redhat

I downloaded the READhat version and did

rpm -i scons-1.3.0-1.noarch.rpm

2.) next you need to be sure Java sdk 1.6 or higher is installed (/apps/java/jdk1.6.0_03)

Looking on my maching I saw

~>java --version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-44)

went to http://java.sun.com/

and got the file

jdk-6u20-linux-i586-rpm.bin


as root I did

chmod a+x jdk-6u20-linux-i586-rpm.bin
./jdk-6u20-linux-i586-rpm.bin

It said

Java(TM) SE Development Kit 6 successfully installed.

but the install version is same as above

package jdk-1.6.0_20-fcs.i586 is already installed

It seems the rpm file does not install java onto the system but into its own directory

OK, I will unstall java under the DAQ account and use environmental variables to set the default java

2.6.1 >printenv | grep JAVA
2.6.1 >JAVA_HOME=/home/daq/Java/jdk1.6.0_17
$JAVA_HOME/bin/java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)

4.) VxWorks 5.5 Kernel and cross compiler (/site/vxworks/5.5/ppc/host/x86-linux/bin)

My ROC is set to load the kernel at


/home/daq/CODA/VXWorks/vx6100_v4.1


this seems to be V 5.5.1


5.) change your ROC boot script to support Multicasts

add the line

  1. Add Routes for Multicast Support

mRouteAdd("224.0.0.0","129.57.29.0",0xf0000000,0,0)

where the subnet 129.57.29.0 should be replaced by your local subnet.


for me this is

  1. Add Routes for Multicast Support

mRouteAdd("224.0.0.0","10.1.1.0",0xf0000000,0,0)

Environmental Variables

The script below sets up the environmental variables for running CODA

in particular the logMessage processes are taken out and the cMsg and new ROC libraries loaded.


#!/bin/csh
#
# File:
#       $/usr/local/coda/2.6/.setup
#
# Description:
#       Setup file for CODA
#
# Set up CODA specific environment variables

        setenv CODA_VERSION 2.6
        setenv OSTYPE      `uname|sed 's/-/_/'`

        grep Enterprise /etc/redhat-release >& /dev/null
        if ($status == 0) then
            setenv OSTYPE Linux
        endif

        if ($?CODA != "1") then
            setenv CODA       /usr/local/coda/2.6
        endif

        if ($?CDEVROOT != "1") then
            setenv CDEVROOT /site/coda/cdev_1.7.5
        endif

        setenv CODA_BIN $CODA/$OSTYPE/bin
        setenv CODA_LIB $CODA/$OSTYPE/lib

        if ( $OSTYPE == "SunOS") then
        setenv CDEV_LIB   $CDEVROOT/lib/solaris
        else
        setenv CDEV_LIB   $CDEVROOT/lib/$OSTYPE
        endif

        setenv CODA_CBIN   $CODA/common/bin

        setenv TCL_ROOT    /usr/local/tclc1.1b2.sol
        setenv TCL_LIBRARY $CODA/common/lib/tcl7.4
        setenv ITCL_LIBRARY $CODA/common/lib/itcl2.0
        setenv TK_LIBRARY  $CODA/common/lib/tk
        setenv ITK_LIBRARY $CODA/common/lib/itk2.0
        setenv DP_LIBRARY  $CODA/common/lib/dp
        setenv TIX_LIBRARY $CODA/common/lib/tix

        setenv VXWORKS_ROOT /site/vxworks

#       Overwrite this in your own .cshrc file!
        setenv EXPID LDS
        setenv TCLINCLUDE_DIR $CODA/common/include
        setenv TKINCLUDE_DIR $CODA/common/include

        set lpath = "`echo $path | sed s+$CODA_BIN++g`"
        set path = ($CODA_BIN $lpath)


# Do not clobber LD_LIBRARY_PATH
        if ($?LD_LIBRARY_PATH) then
            setenv LD_LIBRARY_PATH  ${LD_LIBRARY_PATH}:${CODA_LIB}:${CDEV_LIB}
        else
            setenv LD_LIBRARY_PATH  ${CODA_LIB}:${CDEV_LIB}
        endif

        if ($?CDEVDDL != "1") then
            setenv CDEVDDL $CODA_LIB/coda.ddl
        endif
        if ($?CDEVSHOBJ != "1") then
            setenv CDEVSHOBJ $CODA_LIB
        endif

#       debug utility
#-----------------------------------------------
# setenv FFLAGS "-w1 -O -Olimit 1500"
# setenv CFLAGS
# setenv CFLAGS -O
#alias debug "set debug_args=(\!:*); source $DD_BIN/debug.csh; unset debug_args"
#echo "CODA $CODA_VERSION setup script..."
#echo "========================"
#echo ""
#echo "Operating system $OSTYPE."
#echo ""
#echo "Environment"
#echo ""
#echo "Default experiment EXPID        = $EXPID"
#echo "TCL_LIBRARY                     = $TCL_LIBRARY"
#echo "TK_LIBRARY                      = $TK_LIBRARY"
#echo "DP_LIBRARY                      = $DP_LIBRARY"
#echo "TIX_LIBRARY                     = $TIX_LIBRARY"
#echo ""
#echo "Directories"
#echo ""
#echo "Root directory,    CODA         = $CODA"
#echo "Executables,       CODA_BIN     = $CODA_BIN"
#echo "Libraries,         CODA_LIB     = $CODA_LIB"
#echo "VxWorks files,     VXWORKS_ROOT = $VXWORKS_ROOT"
#echo "================================="
setenv AFECS_HOME /home/daq/CODA/2.6.1/Afecs-1.3
setenv COOL_HOME /home/daq/CODA/2.6.1/Afecs-1.3/db
setenv SESSION DAQ
setenv MSQL_TCP_HOST daq1
setenv MSQL_HOME $CODA/common/rcdb

ROC boot script

The ROC boot script need to load in several new components

my new bootscript "roc1.boot" now says


# Boot file for CODA ROC 2.0
# PowerPC version

hostAdd "daq1.physics.isu.edu","10.1.1.1"
hostAdd "daq1","10.1.1.1"
hostAdd "localdaq","10.1.1.1"


# Add Routes for Multicast Support
mRouteAdd("224.0.0.0","10.1.1.0",0xf0000000,0,0)


# up the sliding window
tcp_sendspace=0x8000
tcp_recvspace=0x8000

# Setup environment / load coda_roc
putenv "MSQL_TCP_HOST=daq1"
putenv "EXPID=LDS"
putenv "TCL_LIBRARY=/usr/local/coda/2.5/common/lib/tcl7.4"
putenv "ITCL_LIBRARY=/usr/local/coda/2.5/common/lib/itcl2.0"
putenv "DP_LIBRARY=/usr/local/coda/2.5/common/lib/dp"
putenv "CMLOG_PORT=8102"
putenv "TOKEN_PORT=5555"
putenv "SESSION=DAQ"


# Download Message logging libraries/client
#ld < /usr/local/coda/2.6.1/extensions/tempeDma/usrTempeDma.o

# Load cMsg Stuff
cd "/usr/local/coda/2.6.1/cMsg/vxworks-ppc"
ld< lib/libcmsgRegex.o
ld< lib/libcmsg.o

cd "/usr/local/coda/2.6.1/VXWORKSPPC55/bin"
ld < coda_roc_rc3.4

#ld < caSrvr

cd "/home/daq/CODA/ROClibs/libs"
ld < sis3610Lib.o  
ld < v260Lib.o
ld < v1495Lib.o
#ld < v792Lib.o
#ld < adc1182_ppc.o  
#ld < scale32Lib_ppc.o
#ld < pas9740Lib_ppc.o

# Get around Clock returning 0 1st time its called
mytv = malloc(8)
clock_gettime(0,mytv)
# Spawn tasks
taskDelay (60*15)
# spawn the roc task

taskSpawn ("ROC",200,0x8,250000,coda_roc,"","-s","DAQ","-objects","roc1 ROC")

Create RCplatform database

2.6.1 >afecs/bin/platform
Warning: COOL_HOME does not have a required srtucture. 
Auto-create default structure? Y/N
y
Warning: Can not find clients database file.
Warning: Can not find sessions database file.
>> **** cMsg server sucessfully started at Wed Jun 02 11:35:51 MDT 2010 **** <<
**************************************************
*             Afecs-1.3 Platform                 *
**************************************************
- Name         = LDS
- Host         = daq1.physics.isu.edu
- TCP port     = 45000
- UDP port     = 45000
- RC UDP port  = 45200
- Start time   = 2010/06/02 11:35:51
**************************************************
**************************************************
*             Afecs-1.3 Container                *
**************************************************
APlatform:Info Registration request from daq1.physics.isu.edu_admin agent runnin
g at daq1.physics.isu.edu
- Name                  = daq1.physics.isu.edu_admin
- Host                  = daq1.physics.isu.edu
- Start time            = 2010/06/02 11:35:54
- Connected to:
- Platform              = daq1.physics.isu.edu
- Platform TCP port     = 45000
- Platform UDP port     = 45000
- Platform RC UDP port  = 45200
**************************************************


Start up the CODA components

I didn't have the cMsg shared object directory in my path so

setenv LD_LIBRARY_PATH /home/daq/ROOT/root/lib:/usr/local/coda/2.6.1/Linux/lib:/site/coda/cdev_1.7.5/lib/Linux:/home/daq/CODA/2.6.1/cMsg/Linux-i686/lib/


start up the usual

et_start

coda_eb_rc3.3 -i -s DAQ -n eb1 -t CDEB

coda_er_rc3 -i -s DAQ -n LDS_ER -t ER

then start up the runcontrol gui

rcgui

Start the Run control GUI

run the Run control gui with the command

rcgui

First time session creation

You need to convert your old data base to the new one using the "Option" menu

Option->CODA2 Database->Session

I selected the only one listed which was "DAQ"


I then selected the Control->Connect menus item and The tools icon became active.

Now you need to transfer one of the run configurations into the new data base

Option->CODA2 Database->Run Types

I selected the SIS3610 run type since this is my trigger supervisor.


ROC error message

Connecting to ROC failed

-> Running the cMsg RC client, "roc1"

 connecting to UDL, cMsg:rc://multicast/LDS

The ROC is not registering with "platform" as I do not see any messages in the platform window

using codamaster

the program codamaster is a Tcl based GUI for launching CODA processes like event recorder, event builder, the ET system, and run control.

You need to edit the codamaster script located in $CODA_BIN/codamaster to identify the event builder and recorder names so the global variables read

set ERNAME "LDS_ER"
set EBNAME "eb1"


after that all you neet to do to get the DAQ running is to launch "platform" and "codamaster" once you set up the environment by doing

source ~/CODA/2.6.1/setup

you will also want to open up a minicom session (as root) with the ROC to monitor messages

Installing CODA 2.6.2

Download files

scp -r tforest@login1.jlab.org:/site/coda/2.6.2 ./

install other software

scons
sudo yum install scons
Java version 1.5.0
[daq@daq2 2.6.2]$ java --version
java version "1.5.0"
gij (GNU libgcj) version 4.4.6 20110731 (Red Hat 4.4.6-3)
Instal JDK development environment

sudo yum install java-1.6.0-openjdk-devel.i686

setup script for environmental variables

coda2.6.2_setup.txt

coda_eb_rc3 cant find cMsg shared library


[daq@daq2 2.6.2]$ coda_eb_rc3
coda_eb_rc3: error while loading shared libraries: libcmsgRegex.so: cannot open shared object file: No such file or directory

added path to cMsg library to environmental variable LD_LIBRATH_PATH

in setup script change line to

# Do not clobber LD_LIBRARY_PATH
	if ($?LD_LIBRARY_PATH) then
	    setenv LD_LIBRARY_PATH  ${LD_LIBRARY_PATH}:${CODA_LIB}:${CDEV_LIB}:${CODA}/cMsg/Linux-i686/lib/


[daq@daq2 2.6.2]$ printenv LD_LIBRARY_PATH
/usr/local/root/lib:/home/daq/CODA/2.6.2/Linux/lib:/site/coda/cdev_1.7.5/lib/Linux:/home/daq/CODA/2.6.2/Linux/lib:/site/coda/cdev_1.7.5/lib/Linux:/home/daq/CODA

Startup CODA programs

source CODA/2.6.2/setup

start up msqld, et_start, rcplatform

coda_eb_rc3 -i -s DAQ -n eb1 -t CDEB

coda_er_rc3 -i -s DAQ -n LDS_ER -t ER

login to the ROC (rocdaq1) and start the process

coda_roc_rc3 -t ROC -n rocdaq1

Running codamaster

1.) the dpwish distribution looks for

/home/daq/CODA/2.6.2/Linux/bin/dpwish: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

CentOS6 uses

/usr/lib/libstdc++.so.6

so I installed the older version using yum

sudo yum install libstdc++.so.5

2.) codamaster looks for a msqld with the LDS experiment defined in the data bas.

I copied the msql data base from daq1.

Intel ROCS

The readoutlists and the ROC libraries are all compiled on the Linux ROC
Before they were cross compiled on the host machine for VxWorks

run the program below on the ROC

coda_roc_rc3 -t ROC -n rocdaq1 -msqld_host 134.50.3.12

Note: I copied the CODA subdirectory to the ROC


Compiling SIS3610

On the ROC computer you should have the subdirectory called linuxvme


 LINUXVME_INC = /root/linuxvme/include
 LINUXVME_LIB = /root/linuxvme/lib


You'll need to compile it with

make

New way of compiling the .crl's. Just make them with

make -f Makefile-rol gen_int_list.so

The .so's you'll need to include in the database (instead of the vxWorks .o files).

There's a test program in the "test" directory to test the interrupt capability of the sis3610. You can compile that with

 make

then run it with

 s3610LibTest

You will probably have to modify the sis3610 VME address within the source code.

All this assumes you've set up your environment variables:

 LINUXVME_INC
 LINUXVME_LIB

to their proper locations.

Now setup ROC script

Installing CMLOG

I copied the binary files at /site/coda/cmlog over to /home/daq/CODA/2.5

~/CODA >scp -r tforest@ftp.jlab.org:/site/coda/CMLOG ./

ROC boot script

create the roc boot script and write it to /home/daq/CODA/bootscripts/roc1.boot

# Boot file for CODA ROC 2.0
# PowerPC version
# up the sliding window
tcp_sendspace=0x8000
tcp_recvspace=0x8000
# Setup environment / load coda_roc
putenv "MSQL_TCP_HOST=daq1"
putenv "EXPID=LDS"
putenv "TCL_LIBRARY=/home/daq/CODA/2.5/common/lib/tcl7.4"
putenv "ITCL_LIBRARY=/home/daq/CODA/2.5/common/lib/itcl2.0"
putenv "DP_LIBRARY=/home/daq/CODA/2.5/common/lib/dp"
putenv "CMLOG_PORT=8102"
putenv "TOKEN_PORT=5555"
putenv "SESSION=daq"
# Download Message logging libraries/client
ld < /home/daq/CODA/2.5/CMLOG/2.1/bin/ppc-vw55/cmlogClientD
ld < /home/daq/CODA/2.5/CMLOG/2.1/lib/ppc-vw55/libcmlog.a
ld < /home/daq/CODA/2.5/CMLOG/2.1/bin/ppc-vw55/cmlogVxLogMsg
#cd "/home/daq/CODA/2.5/VXWORKSPPC55/lib"
#ld < libcamac.o
cd "/home/daq/CODA/2.5/VXWORKSPPC55/bin"
ld < coda_roc
#ld < caSrvr
#cd "/home/daq/ROClibs"
#ld < adc1182_ppc.o  
#ld < scale32Lib_ppc.o
#ld < pas9740Lib_ppc.o
#ld < sis3610Lib_ppc.o  
# Spawn tasks
sp cmlogClientD
sp cmlogVxLogMsg
taskDelay (60*5)
# spawn the CAMAC remote server
taskSpawn "caServ",110,spTaskOptions,10000,caSrvr_main
# spawn the roc task
taskSpawn ("ROC",200,0x8,250000,coda_roc,"-i","-s","daq","-objects","roc1 ROC")


as root create the following subdirectory and soft links

ln -s /home/daq/CODA /usr/local/coda

ln -s /home/daq/CODA/2.5/x86-linux /usr/local/x86-linux

mkdir /usr/local/gnu

ln -s /home/daq/CODA/2.5/x86-linux /usr/local/gnu/x86-linux

set the environmental variables

create a script to setup the environmenal variables


#!/bin/csh  
echo Setting up coda 2.5 on $HOST  
setenv CODA /usr/local/coda  
# 
source $CODA/coda.setup  
# Point to msqld on my host  
setenv MSQL_TCP_HOST daq1  
setenv MSQL_HOME /usr/local/coda/common/rcdb  
# My database/session  
setenv EXPID ISU_LDS  
setenv SESSION DAQ  
# CMLOG browser (cmlog) setup file  
setenv CMLOG_CONFIG /home/data1/CODA/cmlogrc  
# broadcast message port must match that in /usr/local/CMLOG/cmlog.config  
setenv CMLOG_PORT 8102  
# User specific env variables  
setenv CODA_DIRECTORY /home/daq/CODA  
setenv CODA_DATA /data1  
# set up to use Cross compilers 
set path = ( $path . /usr/local/gnu/x86-linux/bin ${CODA}/2.5/Linux-rhe/bin ) 


start msql

startup msql deamon

msqld

and let in run

reboot ROC and check that all the libraries loaded

Create Run Configuration

Be sure the msql database is running

~/CODA >msqld
mSQL Server 1.0.16coda starting ...
setjmp returned 0
Checking Authority to use databases in /usr/local/coda/common/rcdb
loading administration ACL msql.acl
admin ACL loaded
loading ACL for database LDS 
Warning : Couldn't open ACL file: No such file or directory
database LDS ACL loaded.
ACL load done


cedit

CODA uses the msql database to hold information reguarding host computer names, IP adresses, output files, and others. You can create your first data base entry using cedit and then edit it like a spreadsheet using dbedit. Below is an example of a simple database configuration after installing all the components using cedit.

DataBaseSetupUsingCedit.jpg

create another window startup cedit

create a new database using the "File" menu "New Database"

I gave it the name "LDS"

I quit cedit and restarted to check that it was still there.


now add components

create and event builder

click on the icon for the event builder (blocks being assembled)

CeditCreateEBbutton.jpg

Name: eb1
Ethernet Host:134.50.3.210 ! this is the daq1 IP address
ID # : 1

created a roc

click on the 2nd icon below the gun which looks like the image below

CeditCreateROCButton.jpg

Name: roc1
Ethernet Host: 134.50.3.216 Id Number: 2 Booting String $CODA_BIN/coda_roc Readout List:$CODA/readoutlist/SIS3610/gen_int_list.crl


connect ROC and EB

You create a connection from the ROC to the EB by clicking on the green square on the ROC a drwaing a red line to a green square on the EB.

create an Event Recorder (ER) button

click on the image which looks like a cassette tape:

CediteCreateERbutton.jpg

This will create and event recorder component which you will then conenct to a output file component

create an output file component

click on the icon which looks like a bullseye to create an output file component

CeditCreateOutputFileComponent.jpg

connect ER and output file

Click on the ER's green tab to draw a red line from the ER to a green tab on the output file component.

created coda file output

clicking on bullseye like symbol in cedit

then clicked on green scquares to tie EB to bullseye

dbedit

I usually check everything using dbedit. It is a spreadsheet like interface allowing you to edit data base cells.

using dbedit:

to get DBEDIT to run I had to add the following to LD_LIBRARY_PATH

so now I have

setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/CMLOG/lib/Linux:${CODA}/Linux-rhe/lib:${CODA}/cdev_1.7.5/lib/Linux-rh9

${CODA}/cdev_1.7.5/lib/Linux-rh9

codamaster

setenv KILL_CODA_SCRIPT

then run codamaster

everything was reported as down.


10.) had comment line in $CODA_BIN/makelist

  1. $CODA_BIN/fb_strip < $DOING_FILE.i.c > $DOING_FILE.c


5.) rcServer

I needed to setup the shared library path so it searches the CMLOG libs byadding the line below to the "setup" script unser $CODA

setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/CMLOG/lib/Linux


6.) msql configureation


UROC daq1


7.) edit /etc/hosts added line for daq1

edited /etc/sysconfig


edited /etc/resolve

added search line for physics


8.) edited binary file output



11.) codamaster ( can be used to start coda rocs EB and ER...)

setenv KILL_CODA_SCRIPT


coda_roc -i -s -n DAQ -s UROC -t ROC

to make a virtual roc to run native on the Linux host

makelist test_list.crl native


Readoutlist

makelist gen_int_list.crl ppc


return to DAQ page