Back to home page

EIC code displayed by LXR

 
 

    


Warning, /jana2/src/python/plugins/janapy/SConscript is written in an unsupported language. File is not indexed.

0001 
0002 
0003 import sbms
0004 import subprocess
0005 
0006 # get env object and clone it
0007 Import('*')
0008 env = env.Clone()
0009 
0010 try:
0011         PYTHON_CFLAGS = subprocess.Popen(["python3-config", "--cflags"], stdout=subprocess.PIPE).communicate()[0].strip()
0012         PYTHON_PREFIX = subprocess.Popen(["python3-config", "--prefix"], stdout=subprocess.PIPE).communicate()[0].strip()
0013         PYTHON_LINKFLAGS = subprocess.Popen(["python3-config", "--libs"], stdout=subprocess.PIPE).communicate()[0].strip()
0014         
0015         # address temporary issue with JLab /apps/python/3.4.3 build which adds an
0016         # extra "/u" to the front of paths returned from python3-config
0017         PYTHON_CFLAGS    = PYTHON_CFLAGS.replace('/u/u/', '/u/')
0018         PYTHON_PREFIX    = PYTHON_PREFIX.replace('/u/u/', '/u/')
0019         PYTHON_LINKFLAGS = PYTHON_LINKFLAGS.replace('/u/u/', '/u/')
0020 
0021         sbms.AddCompileFlags(env, PYTHON_CFLAGS)
0022         sbms.AddLinkFlags(env, PYTHON_LINKFLAGS + " -L"+PYTHON_PREFIX+"/lib")
0023 
0024     # Install pybind headers
0025     installdir = env.subst('$INSTALLDIR')
0026     includedir = "%s/%s" %(env.subst('$INCDIR'), 'janapy')
0027                 pluginsdir = env.subst('$PLUGINSDIR')
0028 
0029                 # Install targets
0030                 installed = env.Install(pluginsdir, myplugin)
0031                 env.Install(includedir, env.Glob('*.h*'))
0032 
0033 
0034         sbms.AddJANA(env)
0035         sbms.plugin(env)
0036 except:
0037         print('--- WARNING:  Problem building janapy plugin.                         ---')
0038         print('--- Python support will be unavailable. If you want python support    ---')
0039         print('---  then make sure python3-config is in your PATH and try rebuilding ---')
0040