setup-matlab icon indicating copy to clipboard operation
setup-matlab copied to clipboard

Cannot build MATLAB Engine for Python

Open ghost opened this issue 4 years ago • 9 comments

I do not know what I am doing at this point, but here is my YML: https://github.com/apommel/vscode-matlab-interactive-terminal/blob/84219db/.github/workflows/ci.yml

It appears I am trying to "build a wheel from code stored in a mounted storage account". I'd be making a temp directory, copy things over and that would get the build working: https://stackoverflow.com/questions/63243930/

Maybe there needs to be an action for building MATLAB Engine for Python that handles the VM issue?

ghost avatar Aug 30 '21 21:08 ghost

hi there, thanks for trying these actions. You may be able to build the engine by building and installing in non-default locations.

However, even if you can build and install it you may run into licensing issue similar to this issue when you try to run the engine. Do you find yourself in the same situation?

acampbel avatar Aug 30 '21 21:08 acampbel

You can workaround this issue by specifying the --build-base option as shown:

    - name: Install MATLAB Engine for Python
      run: |
        cd /usr/local/MATLAB/R2021a/extern/engines/python
        python setup.py build --build-base=$(mktemp -d) install --user

Note that you will not be able to call matlab.engine.start_matlab() however (it will fail with a licensing error) as our cloud based licensing currently occurs upon MATLAB startup and the MATLAB engine for Python does not yet support this licensing scheme.

mcafaro avatar Aug 30 '21 21:08 mcafaro

Argh crap. Any hope of creating a license secret and supporting it in MATLAB? Something for R2021b perhaps?

ghost avatar Aug 30 '21 22:08 ghost

I submitted a service request (05045850) and I hope this ships with R2021b or R2022a

ghost avatar Aug 31 '21 17:08 ghost

Thanks. We're discussing how we might support this use-case. I'll post on here with any updates.

mcafaro avatar Sep 01 '21 12:09 mcafaro

Did R2022a fix this? 🤔

ghost avatar Mar 11 '22 06:03 ghost

Hi @SNDST00M,

A fix for this won't necessarily be tied to a release. We need to figure out a licensing approach that can support this workflow first. That may take some time if we can get it approved.

In the meantime, using a self-hosted runner where you have pre-installed and licensed MATLAB is a potential workaround.

Best, Mark

mcafaro avatar Mar 18 '22 12:03 mcafaro

Hi @mcafaro ,

Is MATLAB Engine for Python available now if I use GitHub-hosted runners?

Thank you.

Zaikun

zaikunzhang avatar Apr 26 '24 02:04 zaikunzhang

Hi @zaikunzhang,

MATLAB Engine for Python is available but starting MATLAB from Python is not supported with our automatic licensing approach for public repositories. Using a self-hosted runner with a pre-installed and licensed version of MATLAB is still the best workaround available.

-Mark

mcafaro avatar Apr 26 '24 14:04 mcafaro