I’m trying to write a C++ version of maskrcnn based on libtorch, then when compiling my project, I got an error like this. I have seen this kind of error when compiling Caffe. However, that solution can not be used when talking about libtorch. Is there anyone have cues? thank you in advance.
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda-10.1 (found version "10.1") 
-- Caffe2: CUDA detected: 10.1
-- Caffe2: CUDA nvcc is: /usr/local/cuda-10.1/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda-10.1
-- Caffe2: Header version is: 10.1
-- Found CUDNN: /usr/lib/x86_64-linux-gnu/libcudnn.so  
-- Found cuDNN: v7.6.4  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)
-- Autodetected CUDA architecture(s):  5.2 5.2
-- Added CUDA NVCC flags for: -gencode;arch=compute_52,code=sm_52
-- Found torch: /home/tengfeihan/maskrcnn_benchmark.cpp/lib/libtorch/lib/libtorch.so  
-- Found OpenCV: /usr/local (found version "3.4.2") 
CUDA FOUND
-- The CUDA compiler identification is NVIDIA 10.1.243
-- Check for working CUDA compiler: /usr/local/cuda-10.1/bin/nvcc
-- Check for working CUDA compiler: /usr/local/cuda-10.1/bin/nvcc -- works
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Found PythonInterp: /home/tengfeihan/anaconda3/bin/python (found version "3.7.4") 
-- Found GTest: /home/tengfeihan/maskrcnn_benchmark.cpp/lib/libtorch/lib/libgtest.a  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tengfeihan/maskrcnn_benchmark.cpp/build
(base) ┌─[tengfeihan@tengfeihan-X10SRA-F] - [~/maskrcnn_benchmark.cpp/build] - [Sat Mar 14, 19:06]
└─[$] <git:(master*)> make
Scanning dependencies of target layers
[  1%] Building CUDA object source/rcnn/layers/CMakeFiles/layers.dir/cuda/ROIAlign_cuda.cu.o
In file included from /home/tengfeihan/maskrcnn_benchmark.cpp/source/rcnn/layers/cuda/ROIAlign_cuda.cu:3:0:
/home/tengfeihan/maskrcnn_benchmark.cpp/lib/libtorch/include/ATen/cuda/CUDAContext.h:7:10: fatal error: cublas_v2.h: No such file or directory
 #include <cublas_v2.h>
          ^~~~~~~~~~~~~
compilation terminated.
source/rcnn/layers/CMakeFiles/layers.dir/build.make:62: recipe for target 'source/rcnn/layers/CMakeFiles/layers.dir/cuda/ROIAlign_cuda.cu.o' failed
make[2]: *** [source/rcnn/layers/CMakeFiles/layers.dir/cuda/ROIAlign_cuda.cu.o] Error 1
CMakeFiles/Makefile2:337: recipe for target 'source/rcnn/layers/CMakeFiles/layers.dir/all' failed
make[1]: *** [source/rcnn/layers/CMakeFiles/layers.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2