cannot find -lmwgpu!

While compiling a mex file with GPU support, I am getting the following error
Error using mex
/usr/bin/ld: cannot find -lmwgpu
collect2: error: ld returned 1 exit status
Any idea how to resolve this issue.

3 Comments

More information needed. What version of MATLAB do you have, and what are you entering at the command line to get this error.
I also have this error.
MATLAB 2016b
Ubuntu 14.04 (4.4.0)
Full call:
user@host:~/caffe$ make matcaffe
MEX matlab/+caffe/private/caffe_.cpp
Building with 'g++'.
/usr/bin/ld: cannot find -lmwgpu
collect2: error: ld returned 1 exit status
make: *** [matlab/+caffe/private/caffe_.mexa64] Error 255
This occurs when adding an include and a link for Matlab (abbreviated):
MATLAB_INCLUDE := -I$(MATLAB_DIR)/toolbox/distcomp/gpu/extern/include
MATLAB_LIBS := -lmwgpu
More specifically change the Makefile: Caffe Master Makefile line 519
CXXFLAGS="\$$CXXFLAGS $(MATLAB_CXXFLAGS) -I$(MATLAB_DIR)/toolbox/distcomp/gpu/extern/include"\
CXXLIBS="\$$CXXLIBS $(STATIC_LINK_COMMAND) $(LDFLAGS) -lmwgpu" -output $@
(I inherited this Makefile from another colleague)
Hi, have you solved this problem? I have the same error when I use mexcuda function as follow:
mexcuda mexGPUExample.cu
Then I get
Building with 'nvcc'.
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
Error using mex
/usr/bin/ld: cannot find -lmwgpu
collect2: error: ld returned 1 exit status
Error in mexcuda (line 157)
[varargout{1:nargout}] = mex(mexArguments{:});

Sign in to comment.

Answers (0)

Categories

Find more on Get Started with GPU Coder in Help Center and File Exchange

Asked:

on 11 Jul 2016

Commented:

on 4 Aug 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!