Difference between revisions of "Online builds 10-apr-2013"

From GlueXWiki
Jump to: navigation, search
m
m
Line 100: Line 100:
  
  
= Example SCONS Scripts =
+
= SCONS Scripts =
  
 
* Need one SConstruct file at the top of all packages.
 
* Need one SConstruct file at the top of all packages.
Line 106: Line 106:
 
* Need SConscript file in each libsrc,binsrc,scripts,test directory.
 
* Need SConscript file in each libsrc,binsrc,scripts,test directory.
 
* SConscript needed to define package dependencies (e.g. determine include paths for compiling).
 
* SConscript needed to define package dependencies (e.g. determine include paths for compiling).
 +
* Need one Python script per package to define dependencies, where to find header files and libs, etc.
  
  
Line 149: Line 150:
 
  #  build programs
 
  #  build programs
 
  buildBin(binEnv)
 
  buildBin(binEnv)
 +
 +
 +
loadcmsg.py
 +
 +
from util import check_if_dir_exist
 +
import os
 +
 +
def loadcmsg(env) :
 +
OSENV = os.environ
 +
CMSG = OSENV['CMSG']
 +
check_if_dir_exist('CMSG')
 +
if env['SHOWENV'] == "1":
 +
print "Loading CMSG software from ", CMSG
 +
 +
cmsgincs = []
 +
cmsgincs.append(CMSG + '/include')
 +
env.AppendUnique(CPPPATH=cmsgincs)
 +
 +
cmsgldir = []
 +
cmsgldir.append(CMSG + '/lib')
 +
env.AppendUnique(LIBPATH = cmsgldir)
 +
 +
cmsglibs = []
 +
cmsglibs.append('cmsgxx')
 +
cmsglibs.append('cmsg')
 +
cmsglibs.append('cmsgRegex')
 +
cmsglibs.append('pthread')
 +
cmsglibs.append('rt')
 +
cmsglibs.append('dl')
 +
 +
env.AppendUnique(LIBS = cmsglibs)

Revision as of 08:55, 7 May 2013

File structure for release area

Simple but cluttered:

-- builds
   `-- devel
       |-- aPackage
       |-- anotherPackage
       |-- cMsg2et
       |   |-- doc
       |   |-- java
       |       `-- org
       |           `-- jlab
       |               `-- halld
       |   |-- jar
       |   |-- Linux_RHEL6-x86_64-gcc4.8.0
       |   |   |-- bin
       |   |   |-- include
       |   |   |-- lib
       |   |   `-- scripts
       |   `-- src
       |       |-- binsrc
       |       |-- examples
       |       |-- libsrc
       |       |   `-- cMsg2et -> .
       |       |-- scripts
       |       `-- test
       |-- doc
       |-- jar
       |-- Linux_RHEL6-x86_64-gcc4.8.0
       |   |-- bin
       |   |-- include
       |   |-- lib
       |   `-- scripts
       `-- SCONS


Build System

  • Based on SCONS and Python/Perl scripts (by Maurizio, Elliott and Dave L).
  • Allows for only one library per package, but allows multiple executables and test programs.
  • A package may just have a library or executables, or maybe just some include files and scripts.
  • System builds libsrc,binsrc and installs libsrc,binsrc,scripts into $INSTALL_DIR (default is package directory).
  • Copies include files from libsrc into include directory in $INSTALL_DIR.
  • Builds test area but only installs it locally (i.e. ignores INSTALL_DIR env var)
  • Ignores any other directories in src (e.g. examples dir).
  • Include statements MUST be qualified by package name (e.g. #include <cMsg2et/cMsg2et.h>) (thus the soft link in libsrc dir).


File structure for release area

  • Below is a proposed release directory structure.
  • Official release area is /gluex/builds.
  • Release area only writeable from hdsys account, read-only from all other accounts.
  • Package directories are what gets checked into SVN.
  • Packages can be checked in/out by anyone.
  • Anyone can build and install packages in their own area.
  • Only hdsys can release a package into official release area.
  • Notes:
    • Should SCONS dir be under packages? Should it be installed?
    • Need to develop scripts to check out and build everything in one command.


-- builds
   `-- devel
       |-- doc
       |-- jar
       |-- Linux_RHEL6-x86_64-gcc4.8.0
       |   |-- bin
       |   |-- include
       |   |-- lib
       |   `-- scripts
       |-- packages
       |   |-- aPackage
       |   |-- anotherPackage
       |   `-- cMsg2et
       |       |-- doc
       |       |-- java
       |           `-- org
       |               `-- jlab
       |                   `-- halld
       |       |-- jar
       |       |-- Linux_RHEL6-x86_64-gcc4.8.0
       |       |   |-- bin
       |       |   |-- include
       |       |   |-- lib
       |       |   `-- scripts
       |       `-- src
       |           |-- binsrc
       |           |-- examples
       |           |-- libsrc
       |           |   `-- cMsg2et -> .
       |           |-- scripts
       |           `-- test
       `-- SCONS


SCONS Scripts

  • Need one SConstruct file at the top of all packages.
  • SConstruct the same for ALL packages.
  • Need SConscript file in each libsrc,binsrc,scripts,test directory.
  • SConscript needed to define package dependencies (e.g. determine include paths for compiling).
  • Need one Python script per package to define dependencies, where to find header files and libs, etc.


#  SConscript for libsrc
#
#  to customize fill in package dependencies
#
#  ejw, 16-apr-2013
 

Import('*')
from init_env import modify_environment
from util import buildLib


#  set package dependencies
modify_environment(libEnv,'cmsg')



#  build the lib
buildLib(libEnv)


#  SConscript for binsrc
#
#  to customize fill in package dependencies
#
#  ejw, 16-apr-2013


Import('*')
from init_env import modify_environment
from util import buildBin


#  set package dependencies
modify_environment(binEnv,'codaobject cmsg evio et')


#  build programs
buildBin(binEnv)


loadcmsg.py

from util import check_if_dir_exist
import os
def loadcmsg(env) :

OSENV = os.environ CMSG = OSENV['CMSG'] check_if_dir_exist('CMSG') if env['SHOWENV'] == "1": print "Loading CMSG software from ", CMSG

cmsgincs = [] cmsgincs.append(CMSG + '/include') env.AppendUnique(CPPPATH=cmsgincs)

cmsgldir = [] cmsgldir.append(CMSG + '/lib') env.AppendUnique(LIBPATH = cmsgldir)

cmsglibs = [] cmsglibs.append('cmsgxx') cmsglibs.append('cmsg') cmsglibs.append('cmsgRegex') cmsglibs.append('pthread') cmsglibs.append('rt') cmsglibs.append('dl')

env.AppendUnique(LIBS = cmsglibs)