diff --git a/README_evio.md b/README_evio.md deleted file mode 100644 index b3fd5c8826b267357785c1b51a7e58aec20a322f..0000000000000000000000000000000000000000 --- a/README_evio.md +++ /dev/null @@ -1,67 +0,0 @@ -hcana with externally built evio libraries -============================================ - -As of PODD version 1.6, EVIO is built as an external library from the official JLAB -DAQ group source code. As of this writing, the official release is version 4.4.5. -In order to compile hcana with PODD version 1.6, one must download, install, and define -appropriate environment variables for the evio libraries. - -Downloading ------------ - -On your local system, retrieve and unpack the EVIO source distribution: - - $ wget --no-check-certificate https://coda.jlab.org/drupal/system/files/coda/evio/evio-4.4/evio-4.4.5.tgz - $ tar -xvzf evio-4.4.5.tgz - $ cd evio-4.4.5 - -This will unpack the EVIO source code in a directory called evio-4.4.5, and take you -into that new directory. - -Compiling ---------- - -You can now compile the EVIO libraries with: - - $ scons - $ scons install --prefix=. - -This will install the libaries in a subdirectory of the current source directory according to the operating system that you are using. - -Environment ------------ - -The final step is to define the environment variables necessary to tell hcana where your EVIO libraries are installed. I include here excerpts from a my .cshrc file on the JLab systems (where the SHELL is tcsh), and also from my .bash_profile file on a Mac OS X system (where the SHELL is bash). This should give you enough of a guide to be able to modify your environment variable definition appropriately. - -.cshrc - - setenv HCANALYZER /home/brash/analysis/hcana - setenv ANALYZER /home/brash/analysis/hcana/podd - setenv INSTALL_DIR /home/brash/evio-4.4.5 - setenv KERNEL_NAME `uname -s` - setenv MACHINE_NAME `uname -m` - setenv EVIO_SUBDIR $KERNEL_NAME-$MACHINE_NAME - setenv EVIO_BINDIR $INSTALL_DIR/$EVIO_SUBDIR/bin - setenv EVIO_LIBDIR $INSTALL_DIR/$EVIO_SUBDIR/lib - setenv EVIO_INCDIR $INSTALL_DIR/$EVIO_SUBDIR/include - setenv LD_LIBRARY_PATH "${HCANALYZER}:${ANALYZER}/src:${ANALYZER}/hana_decode:${ANALYZER}/hana_scaler:${EVIO_LIBDIR}:${ANALYZER}" - setenv DB_DIR $ANALYZER/DB - set path = ( $ANALYZER/bin $HCANALYZER/bin $EVIO_BINDIR $path ) - -.bash_profile - - export HCANALYZER=/Users/brash/Dropbox/Research/analysis/hcana - export ANALYZER=/Users/brash/Dropbox/Research/analysis/hcana/podd - export INSTALL_DIR=/Users/brash/Dropbox/Research/analyzer-evio/evio-4.4.5 - export KERNEL_NAME=`uname -s` - export MACHINE_NAME=`uname -m` - export EVIO_SUBDIR=$KERNEL_NAME-$MACHINE_NAME - export EVIO_BINDIR=$INSTALL_DIR/$EVIO_SUBDIR/bin - export EVIO_LIBDIR=$INSTALL_DIR/$EVIO_SUBDIR/lib - export EVIO_INCDIR=$INSTALL_DIR/$EVIO_SUBDIR/include - export PATH=$HCANALYZER/bin:$ANALYZER/bin:$EVIO_BINDIR:$PATH - export DYLD_LIBRARY_PATH=$HCANALYZER:$ANALYZER:$EVIO_LIBDIR:$DYLD_LIBRARY_PATH - export LD_LIBRARY_PATH=$HCANALYZER:$ANALYZER:$EVIO_LIBDIR:$LD_LIBRARY_PATH - - - diff --git a/SConscript.py b/SConscript.py deleted file mode 100644 index c8f4ccd2eb1bcf9a15947594684d152be4f15c1c..0000000000000000000000000000000000000000 --- a/SConscript.py +++ /dev/null @@ -1,120 +0,0 @@ -###### Hall C Software Main SConscript File ##### -###### Author: Edward Brash (brash@jlab.org) June 2013 - -import os -import re -import sys -import subprocess -import platform -import time -import SCons.Util -Import ('pbaseenv') - -######## ROOT Dictionaries ######### - -roothcdict = pbaseenv.subst('$HC_DIR')+'/HallCDict.C' -roothcobj = pbaseenv.subst('$HC_SRC')+'/HallCDict.so' - -hcheadersbase = Glob('src/*.h',exclude=['src/THcGlobals.h','src/HallC_LinkDef.h']) - -cmd = "cat src/HallC_LinkDef.h_preamble > src/HallC_LinkDef.h" -os.system(cmd) - -for hcheaderfile in hcheadersbase: - filename = '%s' % hcheaderfile - basefilename = filename.rsplit('.',1) - newbasefilename = basefilename[0].rsplit('/',1) - # Assume filenames beginning with Scaler are decoder classes - if newbasefilename[1] == 'hc_compiledata': - continue - if newbasefilename[1][:6] == 'Scaler' or newbasefilename[1] == "TIBlobModule": - cmd1 = "echo '#pragma link C++ class Decoder::%s+;' >> src/HallC_LinkDef.h" % newbasefilename[1] - else: - cmd1 = "echo '#pragma link C++ class %s+;' >> src/HallC_LinkDef.h" % newbasefilename[1] - os.system(cmd1) - -cmd = "cat src/HallC_LinkDef.h_postamble >> src/HallC_LinkDef.h" -os.system(cmd) - -hcheaders = Glob('src/*.h',exclude=['src/HallC_LinkDef.h','src/hc_compiledata.h'])+Glob('src/HallC_LinkDef.h') - -pbaseenv.RootCint(roothcdict,hcheaders) -pbaseenv.Clean(roothcdict,re.sub(r'\.C\Z','_rdict.pcm',roothcdict)) -pbaseenv.SharedObject(target = roothcobj, source = roothcdict) - -####### write src/hc_compiledata.h header file ###### - -if sys.version_info >= (2, 7): - try: - cmd = "git rev-parse HEAD 2>/dev/null" - gitrev = subprocess.check_output(cmd, shell=True).rstrip() - except: - gitrev = '' - try: - cmd = pbaseenv.subst('$CXX') + " --version 2>/dev/null | head -1" - cxxver = subprocess.check_output(cmd, shell=True).rstrip() - except: - cxxver = '' - # subprocess gives us byte string literals in Python 3, but we'd like - # Unicode strings - if sys.version_info >= (3, 0): - gitrev = gitrev.decode() - cxxver = cxxver.decode() -else: - FNULL = open(os.devnull, 'w') - try: - gitrev = subprocess.Popen(['git', 'rev-parse', 'HEAD', '2>dev/null'],\ - stdout=subprocess.PIPE, stderr=FNULL).communicate()[0].rstrip() - except: - gitrev ='' - try: - outp = subprocess.Popen([pbaseenv.subst('$CXX'), '--version'],\ - stdout=subprocess.PIPE, stderr=FNULL).communicate()[0] - lines = outp.splitlines() - cxxver = lines[0] - except: - cxxver = '' - -compiledata = 'src/hc_compiledata.h' -f=open(compiledata,'w') -f.write('#ifndef HCANA_COMPILEDATA_H\n') -f.write('#define HCANA_COMPILEDATA_H\n') -f.write('\n') -f.write('#define HC_INCLUDEPATH "%s"\n' % (pbaseenv.subst('$HC_SRC'))) -f.write('#define HC_VERSION "%s"\n' % pbaseenv.subst('$HC_VERSION')) -f.write('#define HC_DATE "%s"\n' % time.strftime("%b %d %Y")) -f.write('#define HC_DATETIME "%s"\n' % time.strftime("%a %b %d %Y")) -#f.write('#define HC_DATETIME "%s"\n' % time.strftime("%a %b %d %H:%M:%S %Z %Y")) -f.write('#define HC_PLATFORM "%s"\n' % platform.platform()) -f.write('#define HC_BUILDNODE "%s"\n' % platform.node()) -f.write('#define HC_BUILDDIR "%s"\n' % os.getcwd()) -try: - builduser = pbaseenv['ENV']['LOGNAME'] -except: - builduser = '' -f.write('#define HC_BUILDUSER "%s"\n' % builduser) -f.write('#define HC_GITVERS "%s"\n' % gitrev[:7]) -f.write('#define HC_CXXVERS "%s"\n' % cxxver) -f.write('#define HC_ROOTVERS "%s"\n' % pbaseenv.subst('$ROOTVERS')) -f.write('#define HCANA_VERSION_CODE %s\n' % pbaseenv.subst('$VERCODE')) -f.write('#define HCANA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))\n') -f.write('\n') -f.write('#endif\n') -f.close() - -####### Start of main SConscript ########### - -print ('LIBS = %s\n' % pbaseenv.subst('$LIBS')) - -# SCons seems to ignore $RPATH on macOS... sigh -if pbaseenv['PLATFORM'] == 'darwin': - try: - for rp in pbaseenv['RPATH']: - pbaseenv.Append(LINKFLAGS = ['-Wl,-rpath,'+rp]) - except KeyError: - pass - -analyzer = pbaseenv.Program(target = 'hcana', source = 'src/main.o') -pbaseenv.Install('./bin',analyzer) -pbaseenv.Alias('install',['./bin']) -#pbaseenv.Clean(analyzer,) diff --git a/SConstruct b/SConstruct deleted file mode 100644 index d5651fe480d86023c153c110bbdeeefa785c5c79..0000000000000000000000000000000000000000 --- a/SConstruct +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python -###### Hall C Software Main SConstruct Build File ##### -###### Author: Edward Brash (brash@jlab.org) June 2013 - -import os -import sys -#import platform -#import commands -import SCons -import subprocess - -####### Check SCons version ################## -print('!!! Building the Hall C analyzer and libraries with SCons requires') -print('!!! SCons version 2.5.0 or newer.') -EnsureSConsVersion(2,5,0) - -baseenv = Environment(ENV = os.environ,tools=["default","rootcint"],toolpath=['podd/site_scons']) - -####### Hall A Build Environment ############# -# -baseenv.Append(HEAD_DIR= Dir('.').abspath) -baseenv.Append(HC_DIR= baseenv.subst('$HEAD_DIR')) -baseenv.Append(HC_SRC= baseenv.subst('$HC_DIR')+'/src') -baseenv.Append(HA_DIR= baseenv.subst('$HC_DIR')+'/podd') -baseenv.Append(MAIN_DIR= baseenv.subst('$HEAD_DIR')) -baseenv.Append(HA_Podd = os.path.join(baseenv.subst('$HA_DIR'),'Podd')) -baseenv.Append(HA_DC = os.path.join(baseenv.subst('$HA_DIR'),'hana_decode')) -baseenv.Append(MAJORVERSION = '0') -baseenv.Append(MINORVERSION = '90') -baseenv.Append(PATCH = '0') -baseenv.Append(SOVERSION = baseenv.subst('$MAJORVERSION')+'.'+baseenv.subst('$MINORVERSION')) -baseenv.Append(VERSION = baseenv.subst('$SOVERSION')+'.'+baseenv.subst('$PATCH')) -baseenv.Append(EXTVERS = '') -baseenv.Append(HC_VERSION = baseenv.subst('$VERSION')+baseenv.subst('$EXTVERS')) -print ("Hall C Main Directory = %s" % baseenv.subst('$HC_DIR')) -print ("Hall C Source Directory = %s" % baseenv.subst('$HC_SRC')) -print ("Hall A Main Directory = %s" % baseenv.subst('$HA_DIR')) -print ("Software Version = %s" % baseenv.subst('$VERSION')) -ivercode = 65536*int(float(baseenv.subst('$SOVERSION')))+ 256*int(10*(float(baseenv.subst('$SOVERSION'))-int(float(baseenv.subst('$SOVERSION')))))+ int(float(baseenv.subst('$PATCH'))) -baseenv.Append(VERCODE = ivercode) -baseenv.Append(CPPPATH = ['$HC_SRC','$HA_Podd','$HA_DC']) - -sys.path.insert(1,baseenv.subst('$HA_DIR'+'/site_scons')) -import configure - -configure.FindROOT(baseenv) - -######## cppcheck ########################### - -proceed = "1" or "y" or "yes" or "Yes" or "Y" -if baseenv.subst('$CPPCHECK')==proceed: - is_cppcheck = which('cppcheck') - print ("Path to cppcheck is %s\n" % is_cppcheck) - - if(is_cppcheck == None): - print('!!! cppcheck not found on this system. Check if cppcheck is installed and in your PATH.') - Exit(1) - else: - cppcheck_command = baseenv.Command('cppcheck_report.txt',[],"cppcheck --quiet --enable=all src/ 2> $TARGET") - baseenv.AlwaysBuild(cppcheck_command) - -######## Configure Section ####### - -if not (baseenv.GetOption('clean') or baseenv.GetOption('help')): - - configure.config(baseenv,ARGUMENTS) - - conf = Configure(baseenv) - if not conf.CheckCXX(): - print('!!! Your compiler and/or environment is not correctly configured.') - Exit(1) - # if not conf.CheckFunc('printf'): - # print('!!! Your compiler and/or environment is not correctly configured.') - # Exit(1) - if conf.CheckCXXHeader('sstream'): - conf.env.Append(CPPDEFINES = 'HAS_SSTREAM') - baseenv = conf.Finish() - -Export('baseenv') - -#print (baseenv.Dump()) -#print ('CXXFLAGS = ', baseenv['CXXFLAGS']) -#print ('LINKFLAGS = ', baseenv['LINKFLAGS']) -#print ('SHLINKFLAGS = ', baseenv['SHLINKFLAGS']) - -####### Start of main SConstruct ############ - -hallclib = 'HallC' -poddlib = 'Podd' -dclib = 'dc' - -baseenv.Append(LIBPATH=['$HC_DIR','$HC_SRC','$HA_Podd','$HA_DC']) -baseenv.Append(RPATH=['$HC_DIR','$HA_Podd','$HA_DC']) -baseenv.Replace(SHLIBSUFFIX = '.so') -baseenv.Replace(SOSUFFIX = baseenv.subst('$SHLIBSUFFIX')) -#baseenv.Replace(SHLIBSUFFIX = '.so') -baseenv.Append(SHLIBSUFFIX = '.'+baseenv.subst('$VERSION')) - -pbaseenv=baseenv.Clone() -pbaseenv.Prepend(LIBS=[hallclib,poddlib,dclib]) -baseenv.Prepend(LIBS=[poddlib,dclib]) -Export('pbaseenv') - -if pbaseenv['CXX'] == 'g++': - gxxVersion = [int(i) for i in pbaseenv['CXXVERSION'].split('.')] - if (gxxVersion[0] < 4) or (gxxVersion[0] == 4 and gxxVersion[1] < 4): - print('Error: g++ version too old! Need at least g++ 4.4!') - Exit(1) - -##directorylist = ['./','src','podd','podd/src','podd/hana_decode'] -##SConscript('podd/SConstruct') - -if baseenv.GetOption('clean'): - subprocess.call(['echo', '!!!!!! Cleaning Podd Directory !!!!!! ']) - podd_command_scons = "cd %s; scons -c" % baseenv.subst('$HA_DIR') -else: - subprocess.call(['echo', '!!!!!! Building Podd !!!!!! ']) - podd_command_scons = "cd %s; scons" % baseenv.subst('$HA_DIR') - if baseenv.GetOption('num_jobs'): - podd_command_scons += " -j%s" % (GetOption('num_jobs')) - if baseenv.GetOption('silent'): - podd_command_scons += " -s" - for key,value in ARGLIST: - podd_command_scons += " %s=%s" % (key,value) - -print ("podd_command_scons = %s" % podd_command_scons) - -os.system(podd_command_scons) - -directorylist = ['./','src'] -SConscript(dirs = directorylist,name='SConscript.py',exports='baseenv') - -####### End of SConstruct ######### - -# Local Variables: -# mode: python -# End: