#NEWLINE# def get_compiler_setting( ) : #NEWLINE# #INDENT# nvcc_path = utils . search_on_path ( ( 'nvcc' , 'nvcc.exe' ) ) #NEWLINE# cuda_path_default = None #NEWLINE# if ( nvcc_path is None ) : #NEWLINE# #INDENT# utils . print_warning ( 'nvcc not in path.' , 'Please set path to nvcc.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cuda_path_default = os . path . normpath ( os . path . join ( os . path . dirname ( nvcc_path ) , '..' ) ) #NEWLINE# #UNINDENT# cuda_path = os . environ . get ( 'CUDA_PATH' , '' ) #NEWLINE# if ( ( len ( cuda_path ) > 0 ) and ( cuda_path != cuda_path_default ) ) : #NEWLINE# #INDENT# utils . print_warning ( 'nvcc path != CUDA_PATH' , ( 'nvcc path: %s' % cuda_path_default ) , ( 'CUDA_PATH: %s' % cuda_path ) ) #NEWLINE# #UNINDENT# if ( not os . path . exists ( cuda_path ) ) : #NEWLINE# #INDENT# cuda_path = cuda_path_default #NEWLINE# #UNINDENT# if ( ( not cuda_path ) and os . path . exists ( '/usr/local/cuda' ) ) : #NEWLINE# #INDENT# cuda_path = '/usr/local/cuda' #NEWLINE# #UNINDENT# include_dirs = [ ] #NEWLINE# library_dirs = [ ] #NEWLINE# define_macros = [ ] #NEWLINE# if cuda_path : #NEWLINE# #INDENT# include_dirs . append ( os . path . join ( cuda_path , 'include' ) ) #NEWLINE# if ( sys . platform == 'win32' ) : #NEWLINE# #INDENT# library_dirs . append ( os . path . join ( cuda_path , 'bin' ) ) #NEWLINE# library_dirs . append ( os . path . join ( cuda_path , 'lib' , 'x64' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# library_dirs . append ( os . path . join ( cuda_path , 'lib64' ) ) #NEWLINE# library_dirs . append ( os . path . join ( cuda_path , 'lib' ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( sys . platform == 'darwin' ) : #NEWLINE# #INDENT# library_dirs . append ( '/usr/local/cuda/lib' ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'include_dirs' : include_dirs , #NEWLINE# 'library_dirs' : library_dirs , #NEWLINE# 'define_macros' : cuda_path_default , #NEWLINE# 'language' : 'c++' , #NEWLINE# #UNINDENT# }