Target "torch_cuda_linalg" links to target "CUDA::cusolver" but the target was not found

Mall_Villiers: <p>Hi，<br>
when I run" python setup.py develop " to build pytorch from source for linux system,there are some errors:</p>
<p>–     CUDA flags          :  -Xfatbin -compress-all -DONNX_NAMESPACE=onnx_torch -gencode arch=compute_75,code=sm_75 -Xcudafe --diag_suppress=cc_clobber_ignored,–diag_suppress=integer_sign_change,–diag_suppress=useless_using_declaration,–diag_suppress=set_but_not_used,–diag_suppress=field_without_dll_interface,–diag_suppress=base_class_has_different_dll_interface,–diag_suppress=dll_interface_conflict_none_assumed,–diag_suppress=dll_interface_conflict_dllexport_assumed,–diag_suppress=implicit_return_from_non_void_function,–diag_suppress=unsigned_compare_with_zero,–diag_suppress=declared_but_not_referenced,–diag_suppress=bad_friend_decl --expt-relaxed-constexpr --expt-extended-lambda  -Wno-deprecated-gpu-targets --expt-extended-lambda -DCUB_WRAPPED_NAMESPACE=at_cuda_detail -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__<br>
–     CUDA host compiler  :<br>
–     CUDA --device-c     : OFF<br>
–     USE_TENSORRT        : OFF<br>
–   USE_ROCM              : OFF<br>
–   BUILD_NVFUSER         : ON<br>
–   USE_EIGEN_FOR_BLAS    :<br>
–   USE_FBGEMM            : ON<br>
–     USE_FAKELOWP          : OFF<br>
–   USE_KINETO            : ON<br>
–   USE_FFMPEG            : OFF<br>
–   USE_GFLAGS            : OFF<br>
–   USE_GLOG              : OFF<br>
–   USE_LEVELDB           : OFF<br>
–   USE_LITE_PROTO        : OFF<br>
–   USE_LMDB              : OFF<br>
–   USE_METAL             : OFF<br>
–   USE_PYTORCH_METAL     : OFF<br>
–   USE_PYTORCH_METAL_EXPORT     : OFF<br>
–   USE_MPS               : OFF<br>
–   USE_FFTW              : OFF<br>
–   USE_MKL               : ON<br>
–   USE_MKLDNN            : ON<br>
–   USE_MKLDNN_ACL        : OFF<br>
–   USE_MKLDNN_CBLAS      : OFF<br>
–   USE_UCC               : OFF<br>
–   USE_ITT               : ON<br>
–   USE_NCCL              : ON<br>
–     USE_SYSTEM_NCCL     : OFF<br>
–     USE_NCCL_WITH_UCC   : OFF<br>
–   USE_NNPACK            : ON<br>
–   USE_NUMPY             : ON<br>
–   USE_OBSERVERS         : ON<br>
–   USE_OPENCL            : OFF<br>
–   USE_OPENCV            : OFF<br>
–   USE_OPENMP            : ON<br>
–   USE_TBB               : OFF<br>
–   USE_VULKAN            : OFF<br>
–   USE_PROF              : OFF<br>
–   USE_QNNPACK           : ON<br>
–   USE_PYTORCH_QNNPACK   : ON<br>
–   USE_XNNPACK           : ON<br>
–   USE_REDIS             : OFF<br>
–   USE_ROCKSDB           : OFF<br>
–   USE_ZMQ               : OFF<br>
–   USE_DISTRIBUTED       : ON<br>
–     USE_MPI               : ON<br>
–     USE_GLOO              : ON<br>
–     USE_GLOO_WITH_OPENSSL : OFF<br>
–     USE_TENSORPIPE        : ON<br>
–   Public Dependencies  : caffe2::mkl<br>
–   Private Dependencies : Threads::Threads;pthreadpool;cpuinfo;qnnpack;pytorch_qnnpack;nnpack;XNNPACK;fbgemm;/usr/lib/x86_64-linux-gnu/libnuma.so;ittnotify;fp16;/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so;/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so;caffe2::openmp;tensorpipe;gloo;foxi_loader;rt;fmt::fmt-header-only;kineto;gcc_s;gcc;dl<br>
–   Public CUDA Deps.    : caffe2::cufft;caffe2::curand;caffe2::cublas<br>
–   Private CUDA Deps.   : torch::cudnn;__caffe2_nccl;tensorpipe_cuda;gloo_cuda;/home/qiqi/anaconda3/envs/trt/lib/libcudart.so;CUDA::cusparse;CUDA::curand;CUDA::cufft;ATEN_CUDA_FILES_GEN_LIB<br>
–   USE_COREML_DELEGATE     : OFF<br>
–   BUILD_LAZY_TS_BACKEND   : ON<br>
–   TORCH_DISABLE_GPU_ASSERTS : ON<br>
– Configuring done<br>
CMake Error at caffe2/CMakeLists.txt:936 (add_library):<br>
Target “torch_cuda_linalg” links to target “CUDA::cusolver” but the target<br>
was not found.  Perhaps a find_package() call is missing for an IMPORTED<br>
target, or an ALIAS target is missing?</p>
<p>CMake Warning at caffe2/CMakeLists.txt:807 (add_library):<br>
Cannot generate a safe runtime search path for target torch_cpu because<br>
files in some directories may conflict with libraries in implicit<br>
directories:</p>
<pre><code>runtime library [libgomp.so.1] in /usr/lib/gcc/x86_64-linux-gnu/7 may be hidden by files in:
  /home/xxx/anaconda3/envs/trt/lib
</code></pre>
<p>Some of these libraries may not be found correctly.</p>
<p>how to fix it ? Thanks!</p>