Installing cMsg

From New IAC Wiki
Jump to navigation Jump to search

Compiling cMsg 3-0 on Linux local host

When using scons to compile cMsg it will try to install everything under the subdirectory Linux-i686

I created a softlink to "Linux" so the cMsg binaries and libraries would go to the directory which holds my other coda programs


i then did

scons install
scons examples install

under the cMsg-3.0 subdirectory

This compiled and installed libraries and binaries.

I then tested the message sending using the program called "producer"

Producer

producer -h will output a list of commands

My "rcplatform" cMsg server runs on the DAQ computer

bin >rcplatform 
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 Fri Jun 11 08:19:53 MDT 2010 **** <<
**************************************************
*             Afecs-1.3 Platform                 *
**************************************************
- Name         = your_expt_msql_database_name_goes_here
- Host         = daq1.physics.isu.edu
- TCP port     = 45000
- UDP port     = 45000
- RC UDP port  = 45200
- Start time   = 2010/06/11 08:19:54
**************************************************
**************************************************
APlatform:Info Registration request from daq1.physics.isu.edu_admin agent running at daq1.physics.isu.edu
*             Afecs-1.3 Container                *
**************************************************
- Name                  = daq1.physics.isu.edu_admin
- Host                  = daq1.physics.isu.edu
- Start time            = 2010/06/11 08:19:56
- Connected to:
- Platform              = daq1.physics.isu.edu
- Platform TCP port     = 45000
- Platform UDP port     = 45000
- Platform RC UDP port  = 45200
**************************************************


producer -d -u cMsq:cMsg://daq1.physics.isu.edu:45000/cMsg -delay 1000
consumer TEST cMsg:cMsg://daq1.physics.isu.edu/cMsg

Compile Native cMsg (target and compiling host are the same architecture)

cMsg can be downloaded from the CODA ftp site. The cMsg User's Guide contains useful information. Compiling cMsg requires the BMS package, which contains Makefiles.

wget -c 'ftp://ftp.jlab.org/pub/coda/BMS/BMS.tar.gz'
tar -xzf BMS.tar.gz
wget -c 'ftp://ftp.jlab.org/pub/coda/cMsg/cMsg-3.0.tar.gz'
tar -xzf cMsg-3.0.tar.gz
mv cMsg-3.0 cMsg-3.0_native

Then we define a few variables needed. If you are using CODA, you can define CODA_HOME instead of INSTALL_DIR.

export BMS_HOME=~/code/BMS
export INSTALL_DIR=~/cMsg/native

If you want 64-bit compilation, define CODA_USE64BITS. See BMS/Makefile.GNU for details.

export CODA_USE64BITS=1

Using plain make or make all doesn't work. Use make install instead.

make install

You should see the following output at the end:

Installing cmsg executables:
 /home/brian/cMsg/native/Linux-x86_64-64/bin/consumer
 /home/brian/cMsg/native/Linux-x86_64-64/bin/dummy
 /home/brian/cMsg/native/Linux-x86_64-64/bin/getConsumer
 /home/brian/cMsg/native/Linux-x86_64-64/bin/getResponder
 /home/brian/cMsg/native/Linux-x86_64-64/bin/monitor
 /home/brian/cMsg/native/Linux-x86_64-64/bin/producer
 /home/brian/cMsg/native/Linux-x86_64-64/bin/rcClient
 /home/brian/cMsg/native/Linux-x86_64-64/bin/shutdowner
 /home/brian/cMsg/native/Linux-x86_64-64/bin/cMsgStringTest
 /home/brian/cMsg/native/Linux-x86_64-64/bin/cpptest

Compile Gumstix cMsg

Omitted details can be found above. Extract to a different directory

tar -xzf cMsg-3.0.tar.gz
mv cMsg-3.0 cMsg-3.0_arm
cd cMsg-3.0_arm

Edit BMS Makefile.GNU from

CC  = gcc
CXX = g++

to

ifndef CC
  CC  = gcc
endif
ifndef CXX
  CXX = g++
endif

Set environment variables. The arm cross-compilers need to be in the path and need to have CODA_USE64BITS defined.

export PATH=$PATH:/home/brian/gumstix/gumstix-oe/tmp/cross/bin
export CODA_USE64BITS=1

export CC=arm-angstrom-linux-gnueabi-gcc
export CXX=arm-angstrom-linux-gnueabi-g++
export INSTALL_DIR=~/cMsg/arm

Again, only make install works.

make install

Check to make sure the files are the right architecture

file /home/brian/cMsg/arm/Linux-x86_64-64/bin/*
/home/brian/cMsg/arm/Linux-x86_64-64/bin/cMsgCommand:     ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/cMsgMonitor:     ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/cMsgPayloadTest: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/cMsgReceive:     ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/cMsgStringTest:  ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/consumer:        ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/cpptest:         ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/dummy:           ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/getConsumer:     ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/getResponder:    ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/monitor:         ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/producer:        ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/rcClient:        ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped
/home/brian/cMsg/arm/Linux-x86_64-64/bin/shutdowner:      ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped