Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #!/bin/bash -l 
0002 usage(){ cat << EOU
0003 stree_create_test.sh 
0004 ======================
0005 
0006 ::
0007 
0008    ~/o/sysrap/tests/stree_create_test.sh  
0009 
0010 build
0011     standalone compile 
0012 run
0013     create geometry from scratch and compares query results with expectations
0014     then persists the geometry to file
0015 ana 
0016     ipython loads the geometry for examination 
0017 
0018 EOU
0019 }
0020 
0021 cd $(dirname $(realpath $BASH_SOURCE))
0022 
0023 defarg="build_run_ana"
0024 arg=${1:-$defarg}
0025 
0026 name=stree_create_test 
0027 
0028 export FOLD=/tmp/$name
0029 bin=$FOLD/$name
0030 
0031 cuda_prefix=/usr/local/cuda
0032 CUDA_PREFIX=${CUDA_PREFIX:-$cuda_prefix}
0033 
0034 
0035 if [ "${arg/build}" != "$arg" ]; then 
0036     mkdir -p $FOLD
0037     gcc $name.cc \
0038           ../sn.cc \
0039           ../s_bb.cc \
0040           ../s_pa.cc \
0041           ../s_tv.cc \
0042           ../s_csg.cc \
0043           -std=c++11 -lstdc++ \
0044           -I.. \
0045           -DWITH_CHILD \
0046           -I$CUDA_PREFIX/include \
0047           -I$OPTICKS_PREFIX/externals/glm/glm \
0048           -o $bin 
0049     [ $? -ne 0 ] && echo $BASH_SOURCE build error && exit 1 
0050 fi 
0051 
0052 if [ "${arg/run}" != "$arg" ]; then 
0053     $bin
0054     [ $? -ne 0 ] && echo $BASH_SOURCE run error && exit 2 
0055 fi 
0056 
0057 if [ "${arg/ana}" != "$arg" ]; then 
0058     ${IPYTHON:-ipython} --pdb -i $name.py 
0059     [ $? -ne 0 ] && echo $BASH_SOURCE ana error && exit 2 
0060 fi 
0061 
0062 exit 0 
0063