import os import subprocess import SCons #import glob import re import sys from glob import glob from hdutil import * #=========================================================== # The original loadjana function here was replaced # with the one from SBMS. The orginal was renamed to # loadjana_old below. # # 3/18/2014 David L. #--------------------- # JANA #--------------------- def loadjana(env): jana_home = os.getenv('JANA_HOME', '/no/default/jana/path') JANA_CFLAGS = subprocess.Popen(["%s/bin/jana-config" % jana_home, "--cflags"], stdout=subprocess.PIPE).communicate()[0] JANA_LINKFLAGS = subprocess.Popen(["%s/bin/jana-config" % jana_home, "--libs"], stdout=subprocess.PIPE).communicate()[0] AddCompileFlags(env, JANA_CFLAGS) AddLinkFlags(env, JANA_LINKFLAGS) def loadjana_old(env) : OSENV = os.environ if(OSENV.has_key('JANA_HOME') and os.path.exists(OSENV['JANA_HOME'])==True): rootDir = OSENV['JANA_HOME'] else: print "?JANA_HOME env variable not set...using -DNO_JANA_HOME" env.Append(CPPDEFINES = {'NO_JANA_HOME':None}) return if env['SHOWENV'] == "1": print "Loading JANA software from ", rootDir # include files janaincs = [] janaincs.append(rootDir + '/include') env.AppendUnique(CPPPATH=janaincs) # lib directories and libs janalinkflags = os.popen('$JANA_HOME/bin/jana-config --libs').readline().strip().split() env.AppendUnique(LINKFLAGS = janalinkflags)