Skip to content

BuildingOldCvsVersions

Gijs Molenaar edited this page Feb 13, 2014 · 4 revisions

This document refers to older versions of Timba!

IMPORTANT: As of 25/08/06, Timba resides in its own Subversion repository. This document only applies to building older versions which can be checked out of the LOFAR CVS repository. To build newer versions, refer to ../ActualBuild.

Checking out and building Timba per se

(Once you succeed with this, see also ../ThingsToTry.)

To begin with, you need a cvs account on cvs.astron.nl. Contact Ruud Overeem [[overeem@astron.nl|mailto:overeem@astron.nl]] or Oleg Smirnov [[smirnov@astron.nl|mailto:smirnov@astron.nl]] or Kjeld van der Schaaf [[schaaf@astron.nl|mailto:schaaf@astron.nl]] to obtain one. Once you have it, make sure $CVSROOT is set properly in your .bashrc or .cshrc, to something like:

     * `:pserver:`_USERNAME_`@cvs.astron.nl:/cvs/cvsroot` 

See also UsingCvs for cvs usage tips.

Setting up

Check out cvs modules

You will only need to do this once.

    $ cvs login 
          # (persist until it logs you in)
    $ cvs co LOFAR/autoconf_share
    $ cvs co LOFAR/LCS/Common
    $ cvs co LOFAR/Timba

Create a variants file for your machine

A variants file describes your local build environment (compilers, AIPS++, etc.) Skip this step if you're on lofar9/10, since a working variants file is checked into cvs. Otherwise, use variants.lofar10 as a starting point:

  $ cd LOFAR/autoconf_share
  $ cp variants.lofar10 variants.YOUR_HOST_NAME

Now check the variants file to make sure the compiler specification (CXX), Qt and aips++ paths all match your system. (Have no fear, if they don't, you'll learn about it soon enough anyway).

Note the use of CXX=ccache\ /path/to/g++ in the lofar10 file. This compiler specification assumes you have ccache installed (and you really ought to, as it makes rebuilds a helluva lot faster.) If you don't, just give the direct path to the compiler instead.

Setup LCS/Common

The LOFAR build environment kind of hinges on the LCS/Common directory. Even though we no longer use any code from it, it must still be configured for stuff to work. This is a one-time operation (hopefully, you'll do it once for each build variant, i.e. gnu3_debug, gnu3_opt, etc., and never touch it again):

  $ cd ~/LOFAR/LCS/Common
  $ ./bootstrap
  $ mkdir -p build/gnu3_debug    # it may already exist
  $ cd build/gnu3_debug
  $ ../../lofarconf

Configure and install ParmDB package

The ParmDB package is needed for the ParmTables, you need to install this for each build variant:

  $ cd ~/LOFAR
  $ autoconf_share/rub -conf -build gnu3_debug CEP/BB/ParmDB

For an optimized build variant - see below - the equivalent call is:

  $ cd ~/LOFAR
  $ autoconf_share/rub -conf -build gnu3_opt CEP/BB/ParmDB

To fall back on the old ParmTables, you have to uninstall ParmDB, the easiest way is described in UninstallParmdb.

Bootstrap the Timba build environment

    $ cd ~/LOFAR/Timba
    $ ./bootstrap
      # (watch messages go by...)
    $ mkdir -p build/gnu3_debug    # it may already exist
    $ cd build/gnu3_debug
    $ ../../lofarconf
      # (watch messages go by...)
    $

This also creates a build directory and runs configuration in it.

For an optimized build variant - see below - you would do:

    $ cd ~/LOFAR/Timba
    $ ./bootstrap               # if you previously did a 'debug' build, this call is not necessary
      # (watch messages go by...)
    $ mkdir -p build/gnu3_opt   # it may already exist
    $ cd build/gnu3_opt
    $ ../../lofarconf
      # (watch messages go by...)
    $

A note on build variants

The directory name gnu3_debug specifies a build variant. Given that directory name, lofarconf will automatically setup all Makefiles for a debugging build with gcc-3.x. Other useful build variants are gnu3_opt for an optimized build, and gnu3_prof for a profiling build.

Evil Symlink Kludge: RIP

The evil symlink kludge documented in ../CommonProblems/EvilSymlinkKludge is no more. No need to worry about it.

Building the beast

If any software has been updated, you can bring your local copy up-to-date with:

    $ cd ~/LOFAR/Timba
    $ cvs up

Then, this command (re)builds the entire system:

    $ cd ~/LOFAR/Timba/build/gnu3_debug
    $ make 
      # (Go out to lunch)
    $

Speed up your builds with distcc

On lofar9/10, you may harness the power of distributed compilation by setting up distcc:

    $ mkdir ~/.distcc
      # copy over my distcc hosts file:
    $ cp ~oms/.distcc/hosts ~/.distcc
    $ export CCACHE_PREFIX=distcc    # this assumes bash, tcsh use setenv
    $ cd ~/LOFAR/Timba/build/gnu3_debug
    $ make -j10 
      # and hope it works -- get a cup of coffee instead of lunch

Installing the products

Assuming the build was successful, the sofware needs to be installed in some specific location. Although the build system supports a make install command (copy-install), this is not very convenient for an actively developed system (and in fact will probably be broken more often than not), so symlinking in place is the recommended alternative.

Copy-install

NB: this is currently not recommended, since the install targets are out of date. Use symlinking in place instead.

You can do a make install to copy the software over into an install tree. Install trees live under ~/LOFAR/installed, and are named according to build variant, e.g., ~/LOFAR/installed/gnu3_debug. This scheme is handy for keeping several versions or snapshots of the software. A symlink called current points to the version currently in use, e.g.:

~/LOFAR/installed/current -> ~/LOFAR/installed/gnu3_debug

To install all products into an install tree, use:

    $ cd ~/LOFAR/Timba/build/gnu3_debug
    $ make install

Symlinking in place

A convenient alternative to installation is to set up a tree of symlinks directly into the source/build tree. Then, you never need to reinstall, only edit/update and rebuild. I recommend this approach for active developers, as it saves a lot of useless reinstalls when you edit scripts or rebuild. A current tarball that unpacks into a tree of symlinks is provided in CVS. Try:

      $ cd ~/LOFAR/installed
      $ tar zxvf ../Timba/install-symlinked.tgz
      $ rm current
      $ ln -s symlinked current

This creates and populates LOFAR/installed/symlinked, and links current to it.

In the unlikely (but unfortunately known to happen...) event that the cvs tarball is out of date, you may check my home directory on lofar10 for a more up-to-date tree (lofar10:/home/oms/LOFAR/installed/symlinked). You should be able to just copy my tree (since I use relative symlinks) and have everything work:

    $ slogin lofar10
    # (login)
    $ cd /home/oms/LOFAR/installed
    $ tar cvf ~/symlinks.tar symlinked.tar
    # (move the .tar file to your machine, and untar under your LOFAR/installed)

Alternatively, you can copy them over directly, if you have access to my home directory locally. E.g., working on lofar9, you could do:

    $ cd ~/LOFAR/installed
    $ cp -a /net/lofar10/home/oms/LOFAR/installed/symlinked .

Setting up paths

  • Add the folliwing directory to your $PATH: * LOFAR/installed/current/bin
  • For Python, you need to set the $PYTHONPATH environment variable to * $HOME/LOFAR/installed/current/libexec/python
  • For Glish, just copy (or merge) LOFAR/Timba/.glishrc into your ~/.glishrc. To run the browser, simply type meqbrowser.py

Note that this all assumes that scripts and binaries may be found under ~/LOFAR/installed/current, so make sure your "current" symlink is correct.

Clone this wiki locally