Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:17

0001 #!/bin/bash -l
0002 usage(){ cat << EOU
0003 sframe_test.sh
0004 ===============
0005 
0006 ::
0007 
0008     ~/o/sysrap/tests/sframe_test.sh
0009     ~/o/sysrap/tests/sframe_test.sh build_run 
0010 
0011 EOU
0012 }
0013 
0014 cd $(dirname $(realpath $BASH_SOURCE))
0015 
0016 name=sframe_test 
0017 export FOLD=${TMP:-/tmp/$USER/opticks}/$name 
0018 mkdir -p $FOLD
0019 bin=$FOLD/$name
0020 script=$name.py 
0021 
0022 defarg="build_run_ana"
0023 arg=${1:-$defarg}
0024 
0025 cuda_prefix=/usr/local/cuda
0026 CUDA_PREFIX=${CUDA_PREFIX:-$cuda_prefix}
0027 
0028 
0029 if [ "${arg/build}" != "$arg" ]; then 
0030    gcc $name.cc \
0031       -std=c++11 -lstdc++ -lm \
0032         -I.. \
0033         -I$CUDA_PREFIX/include \
0034         -I$OPTICKS_PREFIX/externals/glm/glm \
0035         -o $bin
0036    [ $? -ne 0 ] && echo $BASH_SOURCE compile error && exit 1
0037 fi 
0038 
0039 if [ "${arg/run}" != "$arg" ]; then 
0040     $bin 
0041     [ $? -ne 0 ] && echo $BASH_SOURCE run error && exit 2
0042 fi 
0043 
0044 if [ "${arg/dbg}" != "$arg" ]; then 
0045     dbg__ $bin 
0046     [ $? -ne 0 ] && echo $BASH_SOURCE dbg error && exit 3
0047 fi 
0048 
0049 if [ "${arg/ana}" != "$arg" ]; then 
0050     ${IPYTHON:-ipython} --pdb -i $script
0051     [ $? -ne 0 ] && echo $BASH_SOURCE ana error && exit 4
0052 fi
0053 
0054 exit 0 
0055 
0056