필터 지우기
필터 지우기

Mex does not accept -g?

조회 수: 3 (최근 30일)
Erik Keever
Erik Keever 2020년 4월 7일
Hello, I have suddenly collided with a rather frightening problem. I have a code that is about an even split between a compiled/gpu-accelerated core and matlab high level stuff. The flow to creating the mex files goes as (ignoring most of the compiler options ofc):
nvcc -g -cuda foo1.cu % creates cuda fatbins in .cpp files
g++ -fPIC -g -c foo1.cpp % compile cpp to object code
(...)
mex -g -c interface.cpp % compile interface
mex -cxx foo1.o foo2.o fooN.o interface.o -output bar % link
And this rewards me with:
'/home/erik-k/code/bar.mexa64' is not a MEX file. For more information, see <a href="matlab: helpview([docroot '/matlab/helptargets.map'],'ENOTMEX')">File is not a MEX file</a>.
make: *** [Makefile:77: bar] Error 255
After some frustration and bisection, I eventually found that removing -g from the interface.cpp compile "fixes" the problem. The biggest thing I cannot understand is, the output from nm shows that the mexFunction symbol IS PRESENT in the "bad" mex file. Does -g break the little hidden "version info" object file that mex makes/links with the input code?
I noticed this began after I upgraded from matlab 2018b to 2019b.

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by