Hello,
In windows 7 64 bit , ı used visual studio 2010 and matlab 2012a. Now , I am responsble to use knn search algorithm with cuda codes. However , while compiling, i face with some problem which i could not find any solutions.
Until now, try :
1 Create nvccbat.bat by means of nvcc function.
2 nvcc knn_cuda_without_indexes.cu -lcuda -Ilibmx.lib -D_CRT_SECURE_NO_DEPRECATE
3 and get following error …
C:\Program Files\MATLAB\R2012a\extern\include>echo off
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
knn_cuda_without_indexes.cu
tmpxft_00000d7c_00000000-5_knn_cuda_without_indexes.cudafe1.gpu
tmpxft_00000d7c_00000000-10_knn_cuda_without_indexes.cudafe2.gpu
knn_cuda_without_indexes.cu
tmpxft_00000d7c_00000000-5_knn_cuda_without_indexes.cudafe1.cpp
tmpxft_00000d7c_00000000-15_knn_cuda_without_indexes.ii
tmpxft_00000d7c_00000000-16_knn_cuda_without_indexes.obj : error LNK2019: unresolved external symbol mexPrintf referenced in function “void __cdecl printErrorMessage(enum cudaError,int)” (?printErrorMessage@@YAXW4cudaError@@H@Z)
tmpxft_00000d7c_00000000-16_knn_cuda_without_indexes.obj : error LNK2019: unresolved external symbol mxGetPr referenced in function mexFunction
tmpxft_00000d7c_00000000-16_knn_cuda_without_indexes.obj : error LNK2019: unresolved external symbol mxCreateNumericMatrix_730 referenced in function mexFunction
tmpxft_00000d7c_00000000-16_knn_cuda_without_indexes.obj : error LNK2019: unresolved external symbol mexErrMsgTxt referenced in function mexFunction
tmpxft_00000d7c_00000000-16_knn_cuda_without_indexes.obj : error LNK2019: unresolved external symbol mxGetScalar referenced in function mexFunction
tmpxft_00000d7c_00000000-16_knn_cuda_without_indexes.obj : error LNK2019: unresolved external symbol mxGetN referenced in function mexFunction
tmpxft_00000d7c_00000000-16_knn_cuda_without_indexes.obj : error LNK2019: unresolved external symbol mxGetM referenced in function mexFunction
tmpxft_00000d7c_00000000-16_knn_cuda_without_indexes.obj : error LNK2019: unresolved external symbol mxGetData referenced in function mexFunction
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup
a.exe : fatal error LNK1120: 9 unresolved externals
I thought that these problems are related to libraries but ı could not solve the problem.
Then , I decided to use nvmex downloaded with knn search codes.
Firstly ,
nvmex -f nvmexopts64.bat knn_cuda_with_indexes.cu -I’C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include’ -L’C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\lib\x64’ -lcufft -lcudart -lcuda -D_CRT_SECURE_NO_DEPRECATE
Compiler gives an error about min function in knn_cuda_with_indexes.cu so I use macro and change two variables types from unsigned int to size_t called memory_total , memory_free. Then, I get following error, (unfortunately)
knn_cuda_without_indexes.cu
knn_cuda_without_indexes.cu
tmpxft_00001480_00000000-11_knn_cuda_without_indexes.compute_20.cudafe1.gpu
tmpxft_00001480_00000000-17_knn_cuda_without_indexes.compute_20.cudafe2.gpu
knn_cuda_without_indexes.cu
tmpxft_00001480_00000000-8_knn_cuda_without_indexes.compute_10.cudafe1.gpu
tmpxft_00001480_00000000-21_knn_cuda_without_indexes.compute_10.cudafe2.gpu
tmpxft_00001480_00000000-5_knn_cuda_without_indexes.compute_13.cudafe1.gpu
tmpxft_00001480_00000000-24_knn_cuda_without_indexes.compute_13.cudafe2.gpu
knn_cuda_without_indexes.cu
knn_cuda_without_indexes.cu
knn_cuda_without_indexes.cu
tmpxft_00001480_00000000-11_knn_cuda_without_indexes.compute_20.cudafe1.cpp
Could Not Find C:\Program Files\MATLAB\R2012a\extern\include\knn_cuda_without_indexes.mexw64.manifest
it creates a .mexw64 file but when call it, it gives a internal problem and closed itself.
I have read and tried to codes lots of suggestion for two days. However, I could not pass over these two errors.
If you can help me about one of two errors , please explain what solution is and how I can solve this problem.
Thanks in advance.