Instructions for developing and building CORAL components using CMT |
As of version 1.7.0 CORAL is built using CMT. Here one may find some brief instructions for developing and building CORAL.
For details on CMT itself refer to the relevant documentation
Linux:
export SITEROOT=/afs/cern.chWindows (assuming that afs is mapped to the Z: drive):
set SITEROOT=z:\cern.chFor this platform you may want to setup the compiler as well:
"c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat"Set the CMTCONFIG environment variable to the platform name
Linux (eg. slc4_amd64_gcc34):
export CMTCONFIG=slc4_amd64_gcc34Windows:
set CMTCONFIG=win32_vc71_dbgCMT is searching for packages in the directories specified in the CMTPATH path environment variable.
The following directories should be included with the following order:
The source directory of your working installation:
/my/working/directory/CORAL-X_Y_Z/srcOptionally, the source directory of an existing CORAL installation in case one wants to develop packages against this reference release.
/afs/cern.ch/sw/lcg/app/releases/CORAL/CORAL_X_Y_Z/srcThe LCGCMT directory corresponding to a specific software configuration, for the externals.
In this case one should issue:
Linux:
export CMTPATH=/my/working/directory/CORAL-X_Y_Z/src:/afs/cern.ch/sw/lcg/app/releases/CORAL/CORAL_X_Y_Z/src:/afs/cern.ch/sw/lcg/app/releases/LCGCMT/LCGCMT_XXWindows:
set CMTPATH=C:\my\working\directory\CORAL-X_Y_Z\src;Z:\cern.ch\sw\lcg\app\releases\CORAL\CORAL_X_Y_Z\src;Z:\cern.ch\sw\lcg\app\releases\LCGCMT\LCGCMT_XXAssumming that you have created your working directory i.e. /my/working/directory/CORAL-X_Y_Z and the src subdirectory, you should check out the following directories:
In every package, parallel to src and, if applicable, the subdirectory with the public header files, there is also a cmt subdirectory. Under this directory one should find, after the cvs checkout two files:
This containts the definition of the binary deliverables. This is typically a shared library, unit tests and command line tools - utilities. It also specifies the dependencies to external or other CORAL packages.
The convention in CORAL is to hold the name of the current CVS tag. Therefore, when developing a package make sure that you also update and commit the entry in this file before tagging with the same entry.
Building any of the deliverables is possible only when you are under the cmt directory. Before doing anything else issue:
cmt configOn success, this is going to generate the necessary (n)make files used for the building procedures and the setup.(c)sh (or setup.bat) scripts for preparing the runtime environment.
To build the shared library from the .cpp files under the src directory simply issue
cmt makeThis is going to build the shared library as well as the command line tools and install them under the lib and bin subdirectories under the platform-dependend subdirectory under the project top-level directory.
If under the package there is a python subdirectory this operation is also going to install its contents under the python subdirectory.
In order to build the unit tests defined in the requirements file one should issue:
cmt make testsIn order to build everything in one go then issue:
cmt make all_groupsThe tests or test libraries that should be built and installed under the platform/tests/bin and platform/tests/lib directories respectively are defined in the requirements file under Tests/cmt. Issuing
cmt make testswill build and install everything with the order specified in the requirements file. One may opt to build selectively one or more test. In this case instead of tests one should specify the name of the actual test of test library to be built.
Finally one could attempt to build everything in one go. In this case go to src/config/cmt and issue:
cmt configOnce the binaries have been built and installed, one may attempt to run the command line tools or tests. To do so, it is necessary to prepare the run-time environment, which in most of the cases boils down to setting up the PATH and LD_LIBRARY_PATH environment variables accordingly. The generated setup.sh (or setup.csh or setup.bat depending on your shell or platform) files upon execution do this job for you.
For running unit tests in most of the cases it suffices to run this script from the package-specific cmt subdirectory. For the integration and system tests, where the full environment is required, one should run the script under src/config/cmt.
NOTE: The PATH environment variable does not include the platform/tests/bin directory, which means that you may have to call the test applications specifying the full path.