{"action":"created","issue":{"url":"https://api.github.com/repos/vlfeat/matconvnet/issues/93","labels_url":"https://api.github.com/repos/vlfeat/matconvnet/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/vlfeat/matconvnet/issues/93/comments","events_url":"https://api.github.com/repos/vlfeat/matconvnet/issues/93/events","html_url":"https://github.com/vlfeat/matconvnet/issues/93","id":60789658,"number":93,"title":"Matconvnet 0.9 GPU issue","user":{"login":"SeByDocKy","id":6464595,"avatar_url":"https://avatars.githubusercontent.com/u/6464595?v=3","gravatar_id":"","url":"https://api.github.com/users/SeByDocKy","html_url":"https://github.com/SeByDocKy","followers_url":"https://api.github.com/users/SeByDocKy/followers","following_url":"https://api.github.com/users/SeByDocKy/following{/other_user}","gists_url":"https://api.github.com/users/SeByDocKy/gists{/gist_id}","starred_url":"https://api.github.com/users/SeByDocKy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeByDocKy/subscriptions","organizations_url":"https://api.github.com/users/SeByDocKy/orgs","repos_url":"https://api.github.com/users/SeByDocKy/repos","events_url":"https://api.github.com/users/SeByDocKy/events{/privacy}","received_events_url":"https://api.github.com/users/SeByDocKy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-12T09:12:45Z","updated_at":"2015-03-12T11:03:12Z","closed_at":null,"body":"Hi,\r\n\r\nFirst of all, I tried to use the vl_compilenn.m to compile my Windows Platform : W7 pro 64, MSVC 10, Matlab R14b, CUDA 6.5 and also Intel CPP 13. There are some error in the compilation scripts (path to lib_src not correct, '-cxx' flag not supported). At the end, I was tired and copy all files into a unique one, change all #include and it's compiling fine for CPU (both MSVC & Intel CPP 13) with such command\r\n\r\nmex -v -DNDEBUG vl_nnconv.cpp data.cpp datamex.cpp nnconv.cpp nnfullyconnected.cpp nnsubsample.cpp nnpooling.cpp  nnnormalize.cpp im2row_cpu.cpp pooling_cpu.cpp copy_cpu.cpp subsample_cpu.cpp normalize_cpu.cpp \"C:\\Program Files (x86)\\Intel\\Composer XE 2013\\mkl\\lib\\intel64\\mkl_core.lib\" \"C:\\Program Files (x86)\\Intel\\Composer XE 2013\\mkl\\lib\\intel64\\mkl_intel_lp64.lib\" \"C:\\Program Files (x86)\\Intel\\Composer XE 2013\\mkl\\lib\\intel64\\mkl_intel_thread.lib\" -largeArrayDims\r\n\r\nFor GPU.... I got the following error with nvmex\r\n\r\nnvmex -v -DNDEBUG -DENABLE_GPU -f nvmexopts.bat vl_nnconv.cu data.cu datacu.cu datamex.cu nnconv.cu nnfullyconnected.cu nnsubsample.cu nnpooling.cu nnnormalize.cu im2row_gpu.cu pooling_gpu.cu copy_gpu.cu subsample_gpu.cu normalize_gpu.cu  \"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v6.5\\lib\\x64\\cudart.lib\" \"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v6.5\\lib\\x64\\cublas.lib\" \"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v6.5\\lib\\x64\\cublas.lib\" \"C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v6.5\\lib\\x64\\nvblas.lib\" \"C:\\Program Files\\MATLAB\\R2014b\\extern\\lib\\win64\\microsoft\\gpu.lib\" \"C:\\Program Files\\MATLAB\\R2014b\\extern\\lib\\win64\\microsoft\\libmwblas.lib\"  -largeArrayDims \r\n\r\nwhere my nvmex.bat is a little bit modified (-arch sm_20 )\r\nset COMPFLAGS= -m64 -g -arch sm_20 -c -Xcompiler \"/c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD\"\r\n\r\nI got the following link's errors\r\n\r\nxilink: executing 'link' \r\n   Creating library C:\\Users\\SeBy\\AppData\\Local\\Temp\\mex_WYvUpB\\templib.x and object C:\\Users\\SeBy\\AppData\\Local\\Temp\\mex_WYvUpB\\templib.exp \r\nnnconv.obj : error LNK2019: unresolved external symbol \"enum vl::Error __cdecl vl::impl::im2row<0,float>(class vl::Context &,float *,float const *,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64)\" (??$im2row@$0A@M@impl@vl@@YA?AW4Error@1@AEAVContext@1@PEAMPEBM_K3333333333@Z) referenced in function \"enum vl::Error __cdecl vl::impl::nnconv_forward_blas<0,float>(class vl::Context &,class vl::Tensor,class vl::Tensor,class vl::Tensor,class vl::Tensor,int,int,int,int,int,int)\" (??$nnconv_forward_blas@$0A@M@impl@vl@@YA?AW4Error@1@AEAVContext@1@VTensor@1@111HHHHHH@Z) \r\nnnconv.obj : error LNK2019: unresolved external symbol \"enum vl::Error __cdecl vl::impl::row2im<0,float>(class vl::Context &,float *,float const *,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64)\" (??$row2im@$0A@M@impl@vl@@YA?AW4Error@1@AEAVContext@1@PEAMPEBM_K3333333333@Z) referenced in function \"enum vl::Error __cdecl vl::impl::nnconv_backward_blas<0,float>(class vl::Context &,class vl::Tensor,class vl::Tensor,class vl::Tensor,class vl::Tensor,class vl::Tensor,class vl::Tensor,int,int,int,int,int,int)\" (??$nnconv_backward_blas@$0A@M@impl@vl@@YA?AW4Error@1@AEAVContext@1@VTensor@1@11111HHHHHH@Z) \r\nnnfullyconnected.obj : error LNK2019: unresolved external symbol \"enum vl::Error __cdecl vl::impl::copy<0,float>(float *,float const *,unsigned __int64)\" (??$copy@$0A@M@impl@vl@@YA?AW4Error@1@PEAMPEBM_K@Z) referenced in function \"enum vl::Error __cdecl nnfullyconnected_forward_impl<0,float>(class vl::Context &,class vl::Tensor,class vl::Tensor,class vl::Tensor,class vl::Tensor)\" (??$nnfullyconnected_forward_impl@$0A@M@@YA?AW4Error@vl@@AEAVContext@1@VTensor@1@111@Z) \r\nnnsubsample.obj : error LNK2019: unresolved external symbol \"enum vl::Error __cdecl vl::impl::subsample_forward<0,float>(class vl::Context &,float *,float const *,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64)\" (??$subsample_forward@$0A@M@impl@vl@@YA?AW4Error@1@AEAVContext@1@PEAMPEBM_K33333333@Z) referenced in function \"enum vl::Error __cdecl nnsubsample_forward_impl<0,float>(class vl::Context &,class vl::Tensor,class vl::Tensor,class vl::Tensor,int,int,int,int,int,int)\" (??$nnsubsample_forward_impl@$0A@M@@YA?AW4Error@vl@@AEAVContext@1@VTensor@1@11HHHHHH@Z) \r\nnnsubsample.obj : error LNK2019: unresolved external symbol \"enum vl::Error __cdecl vl::impl::subsample_backward<0,float>(class vl::Context &,float *,float const *,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64)\" (??$subsample_backward@$0A@M@impl@vl@@YA?AW4Error@1@AEAVContext@1@PEAMPEBM_K33333333@Z) referenced in function \"enum vl::Error __cdecl nnsubsample_backward_impl<0,float>(class vl::Context &,class vl::Tensor,class vl::Tensor,class vl::Tensor,int,int,int,int,int,int)\" (??$nnsubsample_backward_impl@$0A@M@@YA?AW4Error@vl@@AEAVContext@1@VTensor@1@11HHHHHH@Z) \r\nnnpooling.obj : error LNK2019: unresolved external symbol \"enum vl::Error __cdecl vl::impl::pooling_max_forward<0,float>(float *,float const *,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64)\" (??$pooling_max_forward@$0A@M@impl@vl@@YA?AW4Error@1@PEAMPEBM_K2222222222@Z) referenced in function \"enum vl::Error __cdecl vl::nnpooling_forward(class vl::Context &,class vl::Tensor,class vl::Tensor,enum vl::PoolingMethod,int,int,int,int,int,int,int,int)\" (?nnpooling_forward@vl@@YA?AW4Error@1@AEAVContext@1@VTensor@1@1W4PoolingMethod@1@HHHHHHHH@Z) \r\nnnpooling.obj : error LNK2019: unresolved external symbol \"enum vl::Error __cdecl vl::impl::pooling_average_forward<0,float>(float *,float const *,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64)\" (??$pooling_average_forward@$0A@M@impl@vl@@YA?AW4Error@1@PEAMPEBM_K2222222222@Z) referenced in function \"enum vl::Error __cdecl vl::nnpooling_forward(class vl::Context &,class vl::Tensor,class vl::Tensor,enum vl::PoolingMethod,int,int,int,int,int,int,int,int)\" (?nnpooling_forward@vl@@YA?AW4Error@1@AEAVContext@1@VTensor@1@1W4PoolingMethod@1@HHHHHHHH@Z) \r\nnnpooling.obj : error LNK2019: unresolved external symbol \"enum vl::Error __cdecl vl::impl::pooling_max_backward<0,float>(float *,float const *,float const *,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64)\" (??$pooling_max_backward@$0A@M@impl@vl@@YA?AW4Error@1@PEAMPEBM1_K2222222222@Z) referenced in function \"enum vl::Error __cdecl vl::nnpooling_backward(class vl::Context &,class vl::Tensor,class vl::Tensor,class vl::Tensor,enum vl::PoolingMethod,int,int,int,int,int,int,int,int)\" (?nnpooling_backward@vl@@YA?AW4Error@1@AEAVContext@1@VTensor@1@11W4PoolingMethod@1@HHHHHHHH@Z) \r\nnnpooling.obj : error LNK2019: unresolved external symbol \"enum vl::Error __cdecl vl::impl::pooling_average_backward<0,float>(float *,float const *,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64)\" (??$pooling_average_backward@$0A@M@impl@vl@@YA?AW4Error@1@PEAMPEBM_K2222222222@Z) referenced in function \"enum vl::Error __cdecl vl::nnpooling_backward(class vl::Context &,class vl::Tensor,class vl::Tensor,class vl::Tensor,enum vl::PoolingMethod,int,int,int,int,int,int,int,int)\" (?nnpooling_backward@vl@@YA?AW4Error@1@AEAVContext@1@VTensor@1@11W4PoolingMethod@1@HHHHHHHH@Z) \r\nnnnormalize.obj : error LNK2019: unresolved external symbol \"enum vl::Error __cdecl vl::impl::normalize_forward<0,float>(float *,float const *,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,double,double,double)\" (??$normalize_forward@$0A@M@impl@vl@@YA?AW4Error@1@PEAMPEBM_K2222NNN@Z) referenced in function \"enum vl::Error __cdecl vl::nnnormalize_forward(class vl::Context &,class vl::Tensor,class vl::Tensor,unsigned __int64,double,double,double)\" (?nnnormalize_forward@vl@@YA?AW4Error@1@AEAVContext@1@VTensor@1@1_KNNN@Z) \r\nnnnormalize.obj : error LNK2019: unresolved external symbol \"enum vl::Error __cdecl vl::impl::normalize_backward<0,float>(float *,float const *,float const *,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,double,double,double)\" (??$normalize_backward@$0A@M@impl@vl@@YA?AW4Error@1@PEAMPEBM1_K2222NNN@Z) referenced in function \"enum vl::Error __cdecl vl::nnnormalize_backward(class vl::Context &,class vl::Tensor,class vl::Tensor,class vl::Tensor,unsigned __int64,double,double,double)\" (?nnnormalize_backward@vl@@YA?AW4Error@1@AEAVContext@1@VTensor@1@11_KNNN@Z) \r\nvl_nnconv.mexw64 : fatal error LNK1120: 11 unresolved externals \r\n\r\n\r\n\r\n\r\nIt's frustrating coz, the CUDA part seems correctly linked.. seems the switch between CPU & GPU Template is not properly done. I tried with the MSVC link or the Intel same error\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/vlfeat/matconvnet/issues/comments/78460113","html_url":"https://github.com/vlfeat/matconvnet/issues/93#issuecomment-78460113","issue_url":"https://api.github.com/repos/vlfeat/matconvnet/issues/93","id":78460113,"user":{"login":"lenck","id":1554197,"avatar_url":"https://avatars.githubusercontent.com/u/1554197?v=3","gravatar_id":"","url":"https://api.github.com/users/lenck","html_url":"https://github.com/lenck","followers_url":"https://api.github.com/users/lenck/followers","following_url":"https://api.github.com/users/lenck/following{/other_user}","gists_url":"https://api.github.com/users/lenck/gists{/gist_id}","starred_url":"https://api.github.com/users/lenck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lenck/subscriptions","organizations_url":"https://api.github.com/users/lenck/orgs","repos_url":"https://api.github.com/users/lenck/repos","events_url":"https://api.github.com/users/lenck/events{/privacy}","received_events_url":"https://api.github.com/users/lenck/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T11:03:12Z","updated_at":"2015-03-12T11:03:12Z","body":"Hi, sorry for the bugs, it is really sometimes a nightmare to make the compilation work everywhere... (especially as Matlab on other architectures supports the -cxx argument, and in fact it does not work without this argument on Mac OSX). \r\nSo, to be honest, with your modified code it is even harder to help, plus I have no experience with nvmex. So all in all, I have no clue what can your error be. To me it seems that maybe a wrong order of the object files for the linker? (but I'm not even sure if Microsoft compiler cares about it that much as gcc linker)"}}