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

From GlueXWiki
Jump to: navigation, search
m
m
Line 14: Line 14:
 
   
 
   
 
* '''Important Note'''
 
* '''Important Note'''
** I have not considered parallel builds of the entire online software system, and am not sure if SCONS can take care of this.  It may require a custom script that partially parallelizes the full build.
+
** I have not considered parallel builds of the entire online software system, and am not sure if SCONS can take care of this.  It may require a custom script that partially parallelizes the full build.  My goal so far was to get everything working at the package level so developers could start creating new packages.
  
  

Revision as of 11:26, 7 May 2013

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 (except jar and Linux dirs).
  • Packages can be checked in/out by anyone (but not from hdops account).
  • Anyone can build and install packages in their own area.
  • Only hdsys can release a package into official release area.
  • Using osrelease.pl (from offline) to define architecture/compiler directory names.
  • Notes:
    • Should SCONS dir be under packages? Should it be installed?
    • Need make_online_package script to set up dirs for new package.
  • Important Note
    • I have not considered parallel builds of the entire online software system, and am not sure if SCONS can take care of this. It may require a custom script that partially parallelizes the full build. My goal so far was to get everything working at the package level so developers could start creating new packages.


-- /gluex/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 in top directory of every package.
  • 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 system-level Python script per package to define dependencies, where to find header files and libs, etc.
  • Define package root dirs via env vars $PACKAGE or $PACKAGE_ROOT (e.g. $EVIO_ROOT).


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

Import('libEnv')
from halld_lib import define_dependencies, buildLib


#  define dependencies on other packages
define_dependencies(libEnv,'cmsg')



#  build the lib
buildLib(libEnv)


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


Import('binEnv')
from halld_lib import define_dependencies, buildBin


#  define dependencies on other packages
define_dependencies(binEnv,'codaobject cmsg evio et')


#  build programs
buildBin(binEnv)


Python script to define cMsg dependencies:

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)