Difference between revisions of "SCONS for online"

From GlueXWiki
Jump to: navigation, search
m
m
Line 14: Line 14:
 
'''Creating a new package'''
 
'''Creating a new package'''
  
To create a new package in your own directory execute the Python script xxx. This will set up a directory structure that includes SCONS files needed for building the package. In the package root directory is a file named SConsctructThis is the top-level SCONS file, and the package can be built by executing the "scons" command here.  SCONS will descend the directory tree and build the libraries, executables, etc. that it comes across.  Executing "scons install" will install what it previously built into an architecture-dependent directory in the package root directory, with subdirectories for header files, librraries, etc:
+
To create a new package in your own directory execute the Python script:
 +
 
 +
  $ create_online_package myPackage
 +
 
 +
This will set up a package root and directory structure that includes SCONS files needed for building the package:
 +
 
 +
  $ ls myPackage/
 +
doc/  java/  Linux_RHEL6-x86_64-gcc4.8.0/ SConstruct  src/
 +
 
 +
SConstruct is the top-level SCONS file, and the package can be built by executing the "scons" command here.  SCONS will descend the directory tree and build the libraries, executables, etc. that it comes across:
 +
 
 +
$ scons
 +
scons: Reading SConscript files ...
 +
 
 +
  Processing package: myPackage
 +
  --> Building for architecture Linux_RHEL6-x86_64-gcc4.8.0
 +
 
 +
scons: done reading SConscript files.
 +
scons: Building targets ...
 +
scons: done building targets.
 +
 
 +
Executing "scons install" will install what it previously built into an architecture-dependent directory in the package root directory, with subdirectories for header files, librraries, etc:
  
 
  $ ls Linux_RHEL6-x86_64-gcc4.8.0/
 
  $ ls Linux_RHEL6-x86_64-gcc4.8.0/

Revision as of 15:34, 10 May 2013

How To Build Online Packages with the SCONS-Based Build System

Introduction

SCONS is used in the online build system due to its superior scripting abilities and built-in knowledge of dependencies in different languages (n.b. Make is used in the offline). It is based on Python, the main scripting language used in the online. Package building is vastly simplified via a library of SCONS scripts that implement the Hall D directory and installation scheme. The result is that package developers will likely only need to make one-line modifications to SCONS scripts to build their package.

Developers need only deal with the individual packages and their directory structures, and should work from their own personal accounts. Deployment of packages into the production environment, and the directory structures used for deployment, is the concern of software system managers (via the hdsys account), and will not be discussed here.

SVN is used for code management for all packages We use the same repository as the offline, but in a separate online area. Code management will not be discussed here.


Creating a new package

To create a new package in your own directory execute the Python script:

$ create_online_package myPackage

This will set up a package root and directory structure that includes SCONS files needed for building the package:

$ ls myPackage/
doc/  java/  Linux_RHEL6-x86_64-gcc4.8.0/  SConstruct  src/

SConstruct is the top-level SCONS file, and the package can be built by executing the "scons" command here. SCONS will descend the directory tree and build the libraries, executables, etc. that it comes across:

$ scons
scons: Reading SConscript files ...
Processing package: myPackage
  --> Building for architecture Linux_RHEL6-x86_64-gcc4.8.0
scons: done reading SConscript files.
scons: Building targets ...
scons: done building targets.

Executing "scons install" will install what it previously built into an architecture-dependent directory in the package root directory, with subdirectories for header files, librraries, etc:

$ ls Linux_RHEL6-x86_64-gcc4.8.0/
bin/  include/	lib/  scripts/




Building a package