Below is the content with the final error of the log file from the GPU coder in Matlab.
Could someone help me in letting me know why nvcc cannot find -lcublas as written at the end of the log file?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[1/13] nvcc -rdc=true -Xcompiler -fPIC,-ansi,-fexceptions,-fno-omit-frame-pointer,-pthread -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler -fvisibility=hidden -Xcompiler -std=c++11 -I "." -I "/home/kireeti/KLens/video_related_files" -I "./interface" -I "/usr/local/MATLAB/R2020a/extern/include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=PF_mother_mex -DMW_NEEDS_VERSION_H -c -arch sm_35 -I "/usr/local/MATLAB/R2020a/simulink/include" -I "/usr/local/MATLAB/R2020a/toolbox/shared/simtargets" cpp_mexapi_version.cpp -o build/glnxa64/cpp_mexapi_version.o
[2/13] nvcc -rdc=true -Xcompiler -fPIC,-ansi,-fexceptions,-fno-omit-frame-pointer,-pthread -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler -fvisibility=hidden -Xcompiler -std=c++11 -I "." -I "/home/kireeti/KLens/video_related_files" -I "./interface" -I "/usr/local/MATLAB/R2020a/extern/include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=PF_mother_mex -DMW_NEEDS_VERSION_H -c -arch sm_35 -I "/usr/local/MATLAB/R2020a/simulink/include" -I "/usr/local/MATLAB/R2020a/toolbox/shared/simtargets" rt_nonfinite.cpp -o build/glnxa64/rt_nonfinite.o
[3/13] nvcc -rdc=true -Xcompiler -fPIC,-ansi,-fexceptions,-fno-omit-frame-pointer,-pthread -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler -fvisibility=hidden -Xcompiler -std=c++11 -I "." -I "/home/kireeti/KLens/video_related_files" -I "./interface" -I "/usr/local/MATLAB/R2020a/extern/include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=PF_mother_mex -DMW_NEEDS_VERSION_H -c -arch sm_35 -I "/usr/local/MATLAB/R2020a/simulink/include" -I "/usr/local/MATLAB/R2020a/toolbox/shared/simtargets" PF_mother_terminate.cu -o build/glnxa64/PF_mother_terminate.o
[4/13] nvcc -rdc=true -Xcompiler -fPIC,-ansi,-fexceptions,-fno-omit-frame-pointer,-pthread -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler -fvisibility=hidden -Xcompiler -std=c++11 -I "." -I "/home/kireeti/KLens/video_related_files" -I "./interface" -I "/usr/local/MATLAB/R2020a/extern/include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=PF_mother_mex -DMW_NEEDS_VERSION_H -c -arch sm_35 -I "/usr/local/MATLAB/R2020a/simulink/include" -I "/usr/local/MATLAB/R2020a/toolbox/shared/simtargets" PF_mother_initialize.cu -o build/glnxa64/PF_mother_initialize.o
[5/13] nvcc -rdc=true -Xcompiler -fPIC,-ansi,-fexceptions,-fno-omit-frame-pointer,-pthread -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler -fvisibility=hidden -Xcompiler -std=c++11 -I "." -I "/home/kireeti/KLens/video_related_files" -I "./interface" -I "/usr/local/MATLAB/R2020a/extern/include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=PF_mother_mex -DMW_NEEDS_VERSION_H -c -arch sm_35 -I "/usr/local/MATLAB/R2020a/simulink/include" -I "/usr/local/MATLAB/R2020a/toolbox/shared/simtargets" PF_mother_emxutil.cu -o build/glnxa64/PF_mother_emxutil.o
[6/13] nvcc -rdc=true -Xcompiler -fPIC,-ansi,-fexceptions,-fno-omit-frame-pointer,-pthread -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler -fvisibility=hidden -Xcompiler -std=c++11 -I "." -I "/home/kireeti/KLens/video_related_files" -I "./interface" -I "/usr/local/MATLAB/R2020a/extern/include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=PF_mother_mex -DMW_NEEDS_VERSION_H -c -arch sm_35 -I "/usr/local/MATLAB/R2020a/simulink/include" -I "/usr/local/MATLAB/R2020a/toolbox/shared/simtargets" MWCudaDimUtility.cu -o build/glnxa64/MWCudaDimUtility.o
[7/13] nvcc -rdc=true -Xcompiler -fPIC,-ansi,-fexceptions,-fno-omit-frame-pointer,-pthread -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler -fvisibility=hidden -Xcompiler -std=c++11 -I "." -I "/home/kireeti/KLens/video_related_files" -I "./interface" -I "/usr/local/MATLAB/R2020a/extern/include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=PF_mother_mex -DMW_NEEDS_VERSION_H -c -arch sm_35 -I "/usr/local/MATLAB/R2020a/simulink/include" -I "/usr/local/MATLAB/R2020a/toolbox/shared/simtargets" interface/_coder_PF_mother_info.cu -o build/glnxa64/_coder_PF_mother_info.o
[8/13] nvcc -rdc=true -Xcompiler -fPIC,-ansi,-fexceptions,-fno-omit-frame-pointer,-pthread -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler -fvisibility=hidden -Xcompiler -std=c++11 -I "." -I "/home/kireeti/KLens/video_related_files" -I "./interface" -I "/usr/local/MATLAB/R2020a/extern/include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=PF_mother_mex -DMW_NEEDS_VERSION_H -c -arch sm_35 -I "/usr/local/MATLAB/R2020a/simulink/include" -I "/usr/local/MATLAB/R2020a/toolbox/shared/simtargets" PF_mother_data.cu -o build/glnxa64/PF_mother_data.o
[9/13] nvcc -rdc=true -Xcompiler -fPIC,-ansi,-fexceptions,-fno-omit-frame-pointer,-pthread -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler -fvisibility=hidden -Xcompiler -std=c++11 -I "." -I "/home/kireeti/KLens/video_related_files" -I "./interface" -I "/usr/local/MATLAB/R2020a/extern/include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=PF_mother_mex -DMW_NEEDS_VERSION_H -c -arch sm_35 -I "/usr/local/MATLAB/R2020a/simulink/include" -I "/usr/local/MATLAB/R2020a/toolbox/shared/simtargets" interface/_coder_PF_mother_mex.cu -o build/glnxa64/_coder_PF_mother_mex.o
[10/13] nvcc -rdc=true -Xcompiler -fPIC,-ansi,-fexceptions,-fno-omit-frame-pointer,-pthread -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler -fvisibility=hidden -Xcompiler -std=c++11 -I "." -I "/home/kireeti/KLens/video_related_files" -I "./interface" -I "/usr/local/MATLAB/R2020a/extern/include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=PF_mother_mex -DMW_NEEDS_VERSION_H -c -arch sm_35 -I "/usr/local/MATLAB/R2020a/simulink/include" -I "/usr/local/MATLAB/R2020a/toolbox/shared/simtargets" interface/_coder_PF_mother_api.cu -o build/glnxa64/_coder_PF_mother_api.o
[11/13] nvcc -rdc=true -Xcompiler -fPIC,-ansi,-fexceptions,-fno-omit-frame-pointer,-pthread -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler -fvisibility=hidden -Xcompiler -std=c++11 -I "." -I "/home/kireeti/KLens/video_related_files" -I "./interface" -I "/usr/local/MATLAB/R2020a/extern/include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=PF_mother_mex -DMW_NEEDS_VERSION_H -c -arch sm_35 -I "/usr/local/MATLAB/R2020a/simulink/include" -I "/usr/local/MATLAB/R2020a/toolbox/shared/simtargets" MWLaunchParametersUtilities.cu -o build/glnxa64/MWLaunchParametersUtilities.o
[12/13] nvcc -rdc=true -Xcompiler -fPIC,-ansi,-fexceptions,-fno-omit-frame-pointer,-pthread -Xcudafe "--display_error_number --diag_suppress=2381 --diag_suppress=unsigned_compare_with_zero --diag_suppress=useless_type_qualifier_on_return_type" -D_GNU_SOURCE -DMATLAB_MEX_FILE -Xcompiler -fvisibility=hidden -Xcompiler -std=c++11 -I "." -I "/home/kireeti/KLens/video_related_files" -I "./interface" -I "/usr/local/MATLAB/R2020a/extern/include" -I "." -DMW_CUDA_ARCH=350 -DMODEL=PF_mother_mex -DMW_NEEDS_VERSION_H -c -arch sm_35 -I "/usr/local/MATLAB/R2020a/simulink/include" -I "/usr/local/MATLAB/R2020a/toolbox/shared/simtargets" PF_mother.cu -o build/glnxa64/PF_mother.o
[13/13] nvcc build/glnxa64/rt_nonfinite.o build/glnxa64/PF_mother_data.o build/glnxa64/PF_mother_initialize.o build/glnxa64/PF_mother_terminate.o build/glnxa64/PF_mother.o build/glnxa64/_coder_PF_mother_api.o build/glnxa64/_coder_PF_mother_mex.o build/glnxa64/PF_mother_emxutil.o build/glnxa64/_coder_PF_mother_info.o build/glnxa64/MWCudaDimUtility.o build/glnxa64/MWLaunchParametersUtilities.o build/glnxa64/cpp_mexapi_version.o -Xlinker --no-undefined -shared -Xlinker --as-needed -Xlinker -rpath-link,/usr/local/MATLAB/R2020a/bin/glnxa64 -L"/usr/local/MATLAB/R2020a/bin/glnxa64" -Xlinker -rpath-link,/usr/local/MATLAB/R2020a/extern/bin/glnxa64 -L"/usr/local/MATLAB/R2020a/extern/bin/glnxa64" -lMatlabDataArray -lmx -lmex -lmat -lm -lstdc++ -o PF_mother_mex.mexa64 -lemlrt -lcovrt -lut -lmwmathutil -arch sm_35 -lcudart -lcublas -lcusolver -lcufft -lcuda -lc -Xnvlink -w -Wno-deprecated-gpu-targets
FAILED: PF_mother_mex.mexa64
nvcc build/glnxa64/rt_nonfinite.o build/glnxa64/PF_mother_data.o build/glnxa64/PF_mother_initialize.o build/glnxa64/PF_mother_terminate.o build/glnxa64/PF_mother.o build/glnxa64/_coder_PF_mother_api.o build/glnxa64/_coder_PF_mother_mex.o build/glnxa64/PF_mother_emxutil.o build/glnxa64/_coder_PF_mother_info.o build/glnxa64/MWCudaDimUtility.o build/glnxa64/MWLaunchParametersUtilities.o build/glnxa64/cpp_mexapi_version.o -Xlinker --no-undefined -shared -Xlinker --as-needed -Xlinker -rpath-link,/usr/local/MATLAB/R2020a/bin/glnxa64 -L"/usr/local/MATLAB/R2020a/bin/glnxa64" -Xlinker -rpath-link,/usr/local/MATLAB/R2020a/extern/bin/glnxa64 -L"/usr/local/MATLAB/R2020a/extern/bin/glnxa64" -lMatlabDataArray -lmx -lmex -lmat -lm -lstdc++ -o PF_mother_mex.mexa64 -lemlrt -lcovrt -lut -lmwmathutil -arch sm_35 -lcudart -lcublas -lcusolver -lcufft -lcuda -lc -Xnvlink -w -Wno-deprecated-gpu-targets
/usr/bin/ld: cannot find -lcublas
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.