Why is MEX function not defined when run in a Docker microservice container?

조회 수: 3 (최근 30일)

I would like to deploy my MATLAB R2024b function to a Docker microservice using the "compiler.package.microserviceDockerImage" workflow. I am compiling on Windows, and the resulting container is running Ubuntu. The function works as intended on Windows and Ubuntu machines, but throws the following error when run in the container:

Method '<METHOD_NAME>' is not defined for class '<NAMESPACE_NAME>' or is removed from MATLAB's search path.
For context, "<METHOD_NAME>" is a custom MEX function within a namespace called "<NAMESPACE_NAME>". I have compiled MEX files for Windows and Linux, and they are both on my MATLAB path at the appropriate namespace location. I have also manually included the Linux MEX file in the container using the "AdditionalFiles" argument, as I realize the Windows MEX file will not work on Linux. How can I resolve this?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2025년 3월 13일
Unfortunately, functions that make use of MEX files must be deployed on the same operating system as the target container. Thus, please recompile your Docker microservice image on a Linux machine using the same steps you described above.
Once you build your Docker image on Linux, however, you should be able to run it on Windows machines without issue.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by