|  | 
| 14 | 14 | this_dir = os.path.dirname(os.path.realpath(__file__)) | 
| 15 | 15 | torch_dir = os.path.dirname(torch.__file__) | 
| 16 | 16 | conda_include_dir = '/'.join(torch_dir.split('/')[:-4]) + '/include' | 
|  | 17 | +conda_lib_dir = os.environ["CONDA_PREFIX"] +  '/lib/' | 
| 17 | 18 | 
 | 
| 18 | 19 | extra = {'cxx': ['-std=c++11', '-fopenmp'], 'nvcc': ['-std=c++11', '-Xcompiler', '-fopenmp']} | 
|  | 20 | +extra_link = ['-ltbb', '-ltbbmalloc'] | 
| 19 | 21 | 
 | 
| 20 | 22 | setup( | 
| 21 | 23 |     name='sparseconvnet', | 
|  | 
| 29 | 31 |       CUDAExtension('sparseconvnet.SCN', | 
| 30 | 32 |         [ | 
| 31 | 33 |          'sparseconvnet/SCN/cuda.cu', 'sparseconvnet/SCN/sparseconvnet_cuda.cpp', 'sparseconvnet/SCN/pybind.cpp'], | 
| 32 |  | -        include_dirs=[conda_include_dir, this_dir+'/sparseconvnet/SCN/'], | 
|  | 34 | +        include_dirs=[conda_include_dir, this_dir+'/sparseconvnet/SCN/', conda_lib_dir], | 
| 33 | 35 |         extra_compile_args=extra) | 
| 34 |  | -      if torch.cuda.is_available()  else | 
|  | 36 | +      if torch.cuda.is_available() else | 
| 35 | 37 |       CppExtension('sparseconvnet.SCN', | 
| 36 | 38 |         ['sparseconvnet/SCN/pybind.cpp', 'sparseconvnet/SCN/sparseconvnet_cpu.cpp'], | 
| 37 | 39 |         include_dirs=[conda_include_dir, this_dir+'/sparseconvnet/SCN/'], | 
| 38 |  | -        extra_compile_args=extra['cxx'])], | 
|  | 40 | +        extra_compile_args=extra['cxx'],  | 
|  | 41 | +        extra_link_args=extra_link)], | 
| 39 | 42 |     cmdclass={'build_ext': BuildExtension}, | 
| 40 | 43 |     zip_safe=False, | 
| 41 | 44 | ) | 
0 commit comments