I currently can compile the sample code in MATLAB with VS2005 as the compiler.
I installed VS2008, verified it worked separately, and updated the nvmexopts.bat file to call VS2008. However, when I try to compile using the nvmex command in MATLAB, it produces the following linker error:
Szeta.obj
LINK : fatal error LNK1181: cannot open input file ‘kernel32.lib’
C:\PROGRA~1\MATLAB\R2009A\BIN\NVMEX.PL: Error: Link of ‘Szeta.mexw64’ failed.
??? Error using ==> nvmex at 206
Unable to complete successfully.
Any suggestions?
I have attached the nvmex.pl and nvmexopts.bat files I am using. The set with _9 in the name is the one I am trying to use with VS2008. The other set works great for VS2005 and my setup in case anyone else is looking for these files.
System:
Vista Business x64
Matlab 2009a x64 (CUDA plug in 1.1)
Visual Studio 2008 (VS Vizard 2.0 used for setup)
CUDA version 2.2
TESLA c1060 nvmexopts.bat.txt (3.05 KB) nvmex.pl.txt (106 KB) nvmexopts_9.bat.txt (3.05 KB)
I had the same problem(s) when I tried to compile the sample codes using nvmex. After some digging, I found out that VS2008 installed a few things in different locations. For example, (for me at least) %VCINSTALLDIR%\PlatformSDK\lib\AMD64 and %VSINSTALLDIR%\SDK\v2.0\lib\AMD64 are either empty or nonexistent.
Usually the libraries can be found in C:\Program Files\Microsoft SDKs\Windows\v6.0A. So if you add this path in the nvmexopts.bat file and replace all the %VCINSTALLDIR%\PlatformSDK with that path, it should work for you.
I have attached both nvmex.pl and nvmexopts.bat files that I use to compile the sample correctly.
I don’t know how you guys got this to run. On my computer it crashes complaining about $ARCH=UNKNOWN. I looked at your nvmex.pl script and the original one too, both have the same bug on line 157
($main::matlabroot = $main::cmd_name) =~ s%\bin\mex.pl$%%;
This needs to be adapted to
($main::matlabroot = $main::cmd_name) =~ s%\bin\nvmex.pl$%%;
otherwise the grep doesn’t work, matlabroot is wrong, the script doesn’t find the matlab.exe downstream and can’t deduct the architecture.
Attached is the corrected version.
Hi…because this post is bit older now, so if anyone has still any issue regarding running Matlab plugin, u may let me know…I have Windows7 installed on my machine, with matlab 2008a and CUDA toolkit 2.2(2.3 also ave no issues)…I have really worked on batch and pearl files to make them work for me and the giving matlab example is successfully working now…i needed to update the batch file.peral file is the one Edited by Adelalizahiand its working fine, i am grateful to that gentle man…for 64bit computing there r also some batch files needed to be copied to make VS2008 working.