필터 지우기
필터 지우기

Mex Out of Process with MinGW/MSYS2 and GSL

조회 수: 8 (최근 30일)
Kristen Bruchko
Kristen Bruchko 2020년 6월 23일
댓글: Kristen Bruchko 2021년 6월 1일
I am trying to use the new mex out of process feature but my mex file only says "Invalid C++ MEX-file" when tried to run with the mexhost. I am compiling a cpp file with 'MinGW64 C++ Compiler' and using GSL-2.6 libraries. I think the second mexhost process cannot access the libraries needed to run the GSL section of my code.
I have the GSL dlls and libraries needed already linked to my PATH user environment variable, I have tried adding the DLLs directly to where my mex function is trying to run, and I have already ran dependency walker and nothing seems to be missing except for the API and EXE dlls which I've come to understand means those aren't missing, but something else is.
How can I make the second mexhost process have the same access to the dlls and libs as the main process? The purpose I am trying to do this for is to prevent Matlab from closing when the mex function errors out, I'd rather have that second process end and be able to debug the reason than have to go into a Matlab crash report. I am using 2019b and 2020a on two computers, both have the same issue.
  댓글 수: 2
Evangelos Paradas
Evangelos Paradas 2021년 5월 31일
I have the same problem.
I also tried with the dependency walker and nothing is missing.
Strangely, if I try to run my MEX outside of the mexhost (without the feval) it runs.
Any ideas?
Kristen Bruchko
Kristen Bruchko 2021년 6월 1일
My problem ended up being the API I was using. I still had my mex file setup with the C Matrix API (with the mxArray data structure), but the out-of-process only works with the new C++ Mex API. You can find more details about the C++ API here. Hopefully your issue is that simple of a fix as well.

댓글을 달려면 로그인하십시오.

답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by