Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:48:54

0001 #!/bin/bash 
0002 usage(){ cat << EOU
0003 intersect_prim_test.sh 
0004 =============================
0005 
0006 ::
0007 
0008     ~/opticks/CSG/tests/intersect_prim_test.sh
0009 
0010 
0011 
0012 
0013 Despite not being used presence of SCU.h in SysRap is requiring 
0014 linking with cudart ? 
0015 
0016     /cvmfs/juno.ihep.ac.cn/centos7_amd64_gcc1120/contrib/binutils/2.36/bin/ld: /tmp/ccjA3IEx.o: in function `void SCU::DownloadVec<float>(std::vector<float, std::allocator<float> >&, float const*, unsigned int)':
0017     intersect_prim_test.cc:(.text._ZN3SCU11DownloadVecIfEEvRSt6vectorIT_SaIS2_EEPKS2_j[_ZN3SCU11DownloadVecIfEEvRSt6vectorIT_SaIS2_EEPKS2_j]+0x7d): undefined reference to `cudaMemcpy'
0018     /cvmfs/juno.ihep.ac.cn/centos7_amd64_gcc1120/contrib/binutils/2.36/bin/ld: intersect_prim_test.cc:(.text._ZN3SCU11DownloadVecIfEEvRSt6vectorIT_SaIS2_EEPKS2_j[_ZN3SCU11DownloadVecIfEEvRSt6vectorIT_SaIS2_EEPKS2_j]+0xd8): undefined reference to `cudaGetErrorString'
0019 
0020 Coming in via SCSGPrimSpec.h ? But thats not in any .cc ?  
0021 
0022 
0023 
0024 EOU
0025 }
0026 
0027 cd $(dirname $BASH_SOURCE)
0028 name=intersect_prim_test
0029 
0030 export FOLD=/tmp/$name
0031 mkdir -p $FOLD
0032 bin=$FOLD/$name
0033 script=$name.py 
0034 
0035 cuda_prefix=/usr/local/cuda
0036 CUDA_PREFIX=${CUDA_PREFIX:-$cuda_prefix}
0037 
0038 defarg="info_build_run"
0039 arg=${1:-$defarg}
0040 
0041 vars="BASH_SOURCE name FOLD bin CUDA_PREFIX arg script"
0042 
0043 if [ "${arg/info}" != "$arg" ]; then 
0044    for var in $vars ; do printf "%20s : %s \n" "$var" "${!var}" ; done 
0045 fi
0046 
0047 if [ "${arg/build}" != "$arg" ]; then 
0048     gcc $name.cc \
0049        ../CSGNode.cc \
0050        -I..  \
0051        -std=c++11 -lstdc++ -lm \
0052        -I${OPTICKS_PREFIX}/externals/plog/include \
0053        -I${OPTICKS_PREFIX}/include/OKConf \
0054        -I${OPTICKS_PREFIX}/include/SysRap \
0055        -L${OPTICKS_PREFIX}/lib64 \
0056        -lOKConf -lSysRap \
0057        -L${CUDA_PREFIX}/lib64 -lcudart \
0058        -I${CUDA_PREFIX}/include \
0059        -o $bin
0060 
0061     [ $? -ne 0 ] && echo $BASH_SOURCE : build error && exit 1 
0062 fi
0063 
0064 if [ "${arg/run}" != "$arg" ]; then 
0065     $bin
0066     [ $? -ne 0 ] && echo $BASH_SOURCE : run error && exit 2
0067 fi
0068 
0069 if [ "${arg/ana}" != "$arg" ]; then 
0070     ${IPYTHON:-ipython} --pdb -i $script
0071     [ $? -ne 0 ] && echo $BASH_SOURCE : run error && exit 3
0072 fi
0073 
0074 exit 0 
0075