본문 바로가기

Linux

Find python, cuda code with ctags, cscope

ctags & cscope install

$ sudo apt-get install ctags -y

$ sudo apt-get install cscope -y


ctags

$ ctags -R

$ ctags -R --fields=+l --languages=python --python-kinds=-iv -f /.tags ./ # When Permission denied, please use 'sudo'

 

# cscope @ your directory with 'tags' file

$ find . -name '*.py' > cscope.files

$ cscope -R

 

# with cuda codes

rm -rf cscope.files cscope.out tags

# or $ rm -rf cscope.*

ctags -R --extra=+f+q --langmap=C:.c.cu.cuh .

find . \( -name '*.c' -o -name '*.cu' -o -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -print > cscope.files

cscope -i cscope.files