Building and Installing the LBC Software

Build the TCS

 > ssh -X
 > cd /lbt/tcs
 > svn export 2013B-build

 > cd 2013B-build
 > export RECIPE=libTCS                       ... we only need the tcs library
 > ./ 2013B | tee install.log 2>&1      ...     takes only a couple minutes 

This installs the required libraries and include files in /lbt/tcs/2013B.
Now, change current link to point to the new version. The TCSVER variable in the LBC makefile uses current for the TCS version.

TCS needs to read the tcs.conf file for LBC to startup from /lbt/tcs/current as well.

How do we get TCS info on the CMU?

LBC communicates via RPC with the TCS. It uses ports defined in the lbt.conf file.

/etc/profile file has:

and executes:
for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        . $i
which includes a
    export LBTCONF_PATH

Building LBC Software

Build the LBC Control Software on the CMU

1. Login to as lbccontrol and export (or checkout, if you're going to make changes) the source code
> ssh -X
> cd /lbccontrol
> svn export https://svn/repos/lbccontrol/trunk VERSION

2. Modify files
  • If the LBC TCS interface module needs work, the code is in src/tcs/tcs.c and tcs.h.
  • If you need to change the TCS version being used, modify the TCSVER variable in the makefile.
  • If you want to update the version number displayed on the GUIs, update: VERSION in src/lbc/lbc.c and the release name in www/ui/6.php.
  • If necessary, update the copyright year in www/footer.html and www/ui/title.html.

3. Build the libraries, executables, and documentation
 > cd /lbccontrol/VERSION
 > gmake 
 > doxygen documentation.dox

4. Release the version
  1. move the soft link /lbccontrol to point to /lbccontrol/VERSION
  2. create the subdirectory /lbccontrol/VERSION/log
  3. create a link in /lbccontrol/current/conf as redfilterslist.dat using the correct red filters file
  4. set the permissions on the directory www/ui/dynamic to 777
  5. set the permissions on the files www/ui/dynamic/*.html to 666
  6. set the permissions on the uploads directory to 777
  7. make sure the following links exist in www/ui/dynamic :
      BAOParam.txt -> /images/tftp/BTech/AOParam.txt
      Bchip1.gif -> /images/tftp/BTech/chip1.gif
      Bchip2.gif -> /images/tftp/BTech/chip2.gif
      Bguide.gif -> /images/tftp/BTech/guide.gif
      Blbcia.log -> /images/tftp/BTech/lbcia.log
      RAOParam.txt -> /images/tftp/RTech/AOParam.txt
      Rchip1.gif -> /images/tftp/RTech/chip1.gif
      Rchip2.gif -> /images/tftp/RTech/chip2.gif
      Rguide.gif -> /images/tftp/RTech/guide.gif
      Rlbcia.log -> /images/tftp/RTech/lbcia.log 

5. Test the new version
  • Check the web interface by enabling the error console in Firefox.
  • Clear the history and make sure the pages are up to date and updating.
  • Make sure the dynamic pages are created when you go to them - for instance, ui/dynamic/1.html is created when you're looking at housekeeping, etc.
  • Move the log and obs directory files over to the new area - just for reference. They are cleaned up periodically from here.
  • When you restart LBC, check that there are no error messages, it can find the config files, etc.
  • Run the web interface with logging enabled in the php files if you need to. Add
    ini_set('display_errors', 1);
  • Clean up the d:\imgs directories on the Windows PCs if you have been running the test.exe on there.

Build TCSSendWavefront on the CMU

Beginning with TCS Build 2014B, the TCSSendWavefront program used by DOFPIA should come from an LBC build, not a TCS build.
With the Ice version of the LBC TCS, the TCSSendWavefront doesn't require any paths when you copy it to the obs machine. The TCSSendWavefront is no longer built with the overall build of LBC software, it's done in the src/tcs subdirectory since it's built differently than the rest of LBC.

But, it really only has to be built if the interface changes.

1. Login to as lbccontrol and go to the current version of LBC instrument control and make
 > ssh -X
 > cd /lbccontrol/current/src/tcs
 > svn export           or use the correct releases/XXXX instead of trunk 
 > svn export
 > gmake clean -f makefile-TCSSendWavefront
 > gmake makefile-TCSSendWavefront

2. Copy the executable to the mountain directories /home/lbcobs/LBCFPIA/lbcfpia/TCSSendWavefront and /home/lbceng/TCSSendWavefront (while we are transitioning to the new DOFPIA we need to do both.)
 > ssh
 > cd LBCFPIA/lbcfpia/TCSSendWavefront
 > scp -p .
 > logout and log in as lbceng or root
 > cd /home/lbceng/TCSSendWavefront
 > scp -p .

Build the LBC Control Windows Software

The LBC ccdctrl.exe CCD controller software is built on a Windows7 VM using Visual Studio 2008 (lbcwindows-devel,, username INAF ).


Since the rehost of the image analysis to the CMU, the file contains much less than it used to - it now only needs two executables (ccdctrl.exe and test.exe , the init files for the CCD controller, and some Windows scripts).

We use a Visual Studio makefile for the ccdctrl build. The following notes assume you're building in a directory you create with an appropriate version name (<VERSION>).

  1. We have Tortoise SVN on the Windows environment. Right click on a directory and choose SVN Checkout... to checkout the source from the repository: to C:\whatever\My Documents\Visual Studio 2008\Projects\<VERSION>
  2. Open the Start Menu shortcut for the Visual Studio 2008 Command Prompt (this is a windows command line window that executes the script to set Visual Studio environment variables)

  3. The command line window opens in the directory
     C:\Documents and Settings\INAF\My Documents\Visual Studio 2008\Projects 
    In the command line window:
     cd <VERSION> 
    cd ccdctrl
    nmake clean
    The executables should be in a bin directory after the make
  4. Build the file
    1. Copy the bin directory from ...Projects\<VERSION> to ...Projects\<VERSION>\zip\lbc\
    2. Zip up the lbc directory from ...Projects\<VERSION>\zip to a file named
  5. Copy to the /images disk on the CMU - mapped drive Z:\
  6. Check if the other files in SVN have been updated, or should be updated - update.bat and go.bat are on the /images disk on the CMU and are in SVN in lbccontrol/trunk/src/windowspc/images. If someone has updated the CMU version, put it into SVN. If SVN has been updated, figure out if we want to release that to the operational environment.
    go.bat is not automatically populated on the Windows PCs. If you make a change to it, you have to manually copy it to each of the four CCD Controller PCs.

application dependencies
skytech files, but they're included in the src dir

If you just want to update config files in the zip, you can do it on Linux:
 > ssh
 > cd /images
 > unzip the file into a working directory somewhere
 > replace the config files with the new ones
 > zip -r lbc/

If you want to zip from the SVN checkout area ( /lbccontrol/current/src/windowspc/zip ), here's how to exclude the SVN directories and files:
  zip -r -x*.svn* -x.svn lbc/

Build the BBB Software

The BeagleBone CCD controller software is in SVN in
The only libraries required to build the ccdctrl RPC client and test application are the SkyTech (CTR_Procedures) and the pthread standard library.

  1. Checkout the files to the CMU (or typically the trunk version is on the CMU somewhere - as of Aug-2016, it's in /lbccontrol/3.0/src/bbb )
  2. Copy the ccdctrl directory files to /home/ubuntu/ccdctrl
  3. make in that directory

Make sure you don't compile on the CMU in the src/bbb/ccdctrl directory. It will compile fine (maybe not link), but it will also make a logcommon.o file that will get picked up by the top-level lbc makefile incorrectly.
If you build in this directory (maybe required for a test), delete the object files afterward.
When the top-level lbc executable is built, it uses two of the files from this directory ( ccdctrlrpc_clnt_bridge.c and ccdctrlrpc_xdr.c and creates object files in the top-level directory where the exe is built.

LBC Control Software Notes

I Attachment Action Size Date Who Comment
lbclabVM.pngpng lbclabVM.png manage 216 K 10 Sep 2018 - 21:06 UnknownUser Windows VM screenshots
lbclabWM-startmenu.pngpng lbclabWM-startmenu.png manage 100 K 10 Sep 2018 - 21:01 UnknownUser Windows VM screenshots
Topic revision: r58 - 10 Sep 2018, KelleeSummers
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback