setup-matlab
setup-matlab copied to clipboard
Planned support for Windows?
Hello,
This repo is awesome! I'm using it to test MATLAB support for pandoc-plot, but at this time only Linux machines are supported. Any plans to support Windows for Github-hosted runners?
Thanks!
Hi Laurent,
Great to hear the MATLAB actions are working well for you! Yes, we would like to support Windows as soon as we can figure out an effective delivery method to get MATLAB on Windows GitHub-hosted runners. We're working on it now.
Best, Mark
@mcafaro Happy to know Windows support is planned! Just found out about MATLAB Actions and it will save me a lot of time in the future.
If you allow me an uninformed suggestion, maybe packaging MATLAB as a VHD/VHDX and mounting that to a folder could work.
Any update on the Windows support, @mcafaro ? Would be a great feature, and desperately needed for a project I am involved in.
@andreped Nothing to share yet. In the meantime, are you aware of GitHub self-hosted runners? That could be a decent stopgap if you need to test against Windows ASAP.
@andreped Nothing to share yet. In the meantime, are you aware of GitHub self-hosted runners? That could be a decent stopgap if you need to test against Windows ASAP.
Hmm, interesting, @mcafaro. Will probably look into this to have some temporary support for Windows for my application.
Perhaps my use-case it ouside the scope of this issue, but what I want to do might not be supported either. What I want to do is to be able to build a standalone application of some software my team is developing. We wish to support the three different operating systems: Windows, macOSX, and Ubuntu Linux.
I am able to do this for both C++ and Python programs, without any issues, I have actually built softwares and made installers for both before using GitHub Actions. However, I am not sure whether this is possible to do using GitHub Actions with MATLAB, as of now.
Do you have any thoughts regarding what is required on your end to make this possible? Or perhaps, maybe this is already possible to do for Ubuntu Linux/macOSX and I am just being silly? Anyways, I am currently attempting to set this up, so any information regarding this issue would be much appreciated! :] In advance, thanks!
@andreped When you say a "standalone application", are you talking about a standalone application built via MATLAB Compiler (i.e. an application that does not require the target machine to have MATLAB installed in order to run)?
@andreped When you say a "standalone application", are you talking about a standalone application built via MATLAB Compiler (i.e. an application that does not require the target machine to have MATLAB installed in order to run)?
Yes.
@andreped The setup-matlab action does not currently license MATLAB Compiler, so even with Windows support you will not be able to produce a standalone application without using a self-hosted runner.
@mcafaro I see... I was hoping that it was possible, or at least in the near future, to be able to use our own MATLAB license when doing CI with GitHub Actions. That should be possible, as licenses can be stored encrypted using GitHub Secrets.
However, perhaps there are other challenges regarding using licensed MATLAB versions on the cloud, that I am not aware of. Same for building standalone applications. Any thoughts on that? And are you planning to make support for such a workflow in the near future? I guess this requires that it is possible to use the MATLAB Compiler on the cloud, which requires a MATLAB license, right?
@andreped MATLAB licenses are typically tied to a machine, which makes it tricky to use them with ephemeral agents, like GitHub-hosted agents, without running a licensing server. We are working on a bring-your-own-license approach where you store a token linked to your license in a secret env variable, but I do not have a timeline to share on that.
At the moment, setup-matlab automatically licenses MATLAB, Simulink, and most add-on products for public projects. The exceptions include coder and compiler products like MATLAB Compiler.
Hi folks,
matlab-actions/[email protected] contains limited, undocumented, support for Windows and macOS GitHub-hosted runners. On these platforms, only MATLAB and Simulink are installed (no toolboxes) and only releases R2021a and above are available.
We hope to provide greater support for Windows and macOS in the future but this early access should be particularly useful for folks that need to compile MEX files across all platforms.
Best regards, Mark
P.S. There is a known issue on Windows where MATLAB will print a "thread_monitor::launch: _beginthreadex failed" message while exiting. It should not affect the results of your run.
Great ! Is the mex compiler currently available as well for Windows and MacOS X ?
Great ! Is the
mexcompiler currently available as well for Windows and MacOS X ?
Yes it is.
@mcafaro
On these platforms, only MATLAB and Simulink are installed (no toolboxes) and only releases R2021a and above are available.
Actually regarding MacOSX, R2020a and above are supported (I discovered that after inserting a typo in the release name 2020b instead of R2020b)
An error occurred during installation: available releases for maci64: [R2021b R2021a R2020b R2020a]
The header file mclcppclass.h seems to be missing on the MacOSX installation, whatever the MATLAB version used.
And the header file mclcppclass.h seems to be also missing on the Windows installation.
Would it be possible to include this header file in matlab-actions/[email protected] for both MacOSX and Windows ?
Thanks.
@bcoconni Yes that is true. macOS goes back to R2020a. Windows goes back to R2021a. Thanks for clarifying.
mclcppclass.h is part of MATLAB Compiler. Only MATLAB and Simulink are installed on these platforms at the moment. No toolboxes.
How are you making use of mclcppclass.h? I can discuss it with the team.
mclcppclass.his part of MATLAB Compiler. Only MATLAB and Simulink are installed on these platforms at the moment. No toolboxes.
Well, since we are not using the MATLAB Compiler your statement made me think that we might not need to include mclmppclass.h actually and, after removing #include "mclmppclass.h", our S-Function now compiles on MacOSX and Windows ! :+1: :tada:
Thanks for the tip @mcafaro :smile:
How are you making use of
mclcppclass.h? I can discuss it with the team.
The problem was that as I am not the author of the C++ file that included mclmppclass.h, I was struggling ~a lot~ a bit !
@mcafaro this is great, thank you!
Is the intent to include MATLAB toolboxes in the future? I have a number of tests that depend on the Control System Toolbox and having that toolbox accessible would be very helpful.
@mfry-ll yes but it likely won't be until v2.
We have not come up with a system that can deliver MATLAB + all toolboxes to Windows and macOS as efficiently as we can to Linux. So in v2, we may have folks explicitly specify the toolboxes they want available on setup-matlab. How would you feel about that?
@mcafaro, we'd be very happy with that solution.
@mcafaro Yes, that would work great
Is there any progress on adding toolboxes to the Windows and macOS runners? I have a package I am working on where I need the half type, so it needs the Fixed point designer toolbox to run, which works on the Linux-based runners, but not Windows or macOS.
Hi @imciner2, there's a good amount of behind-the-scenes work to do before we can add toolboxes to Windows and macOS. I think we're still a few months out. It will almost certainly require a move from v1 to v2 setup-matlab.
Thanks for all of this @mcafaro. I call mexext on Linux and macOS but it doesn't seem to be available from Windows. If that's indeed the case, could it be added?
@gllmflndn mexext should be available on Windows. I just ran a build to confirm and it worked. Can you show me a build with the issue?
@mcafaro Thanks for the quick response and sorry for not being precise enough. I want to use mex and mexext from bash, outside of run-command. Compilation takes place through a Makefile so I call mex from outside MATLAB and I would also would like to be able to call mexext. The following works from Linux and macOS but not Windows:
- name: Get MEX extension
run: echo "MEXEXT=$(mexext)" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: mex-${{matrix.os}}-${{matrix.version}}
path: ./**/*.${{env.MEXEXT}}
retention-days: 1
@gllmflndn Depending on the shell you're using for run, you may need to include the .bat extension to call mexext (and mex) on Windows.
- name: Get MEX extension on Windows
run: echo "MEXEXT=$(mexext.bat)" >> $GITHUB_ENV
I think bash will require the extension, where PowerShell and cmd will not.
Thanks @mcafaro! Your tests in the mexext repo confirm that mexext is indeed available and can be called with mexext or mexext.bat from PowerShell in a run.
From a PowerShell terminal on my local machine, echo "MEXEXT=$(mexext)" and echo "MEXEXT=$(mexext.bat)" both return MEXEXT=mexw64 as expected but not from run in GitHub Actions (that uses PowerShell by default).
This is not an issue with setup-matlab so I will not hijack this thread further!
EDIT: I was looking at the wrong place: the issue is with $GITHUB_ENV - on Windows, one needs to use $env:GITHUB_ENV instead.
Hi all,
matlab-actions/setup-matlab@v2-beta supports using toolboxes on Windows and Linux runners. In order to use this feature, it is required that you list the additional products needed for your build, as specified in the README. Coder and compiler products, like MATLAB Compiler, can be installed, but a license must be provided for these products.
Please note that this feature is in beta. We hope to provide Mac support and a consistent API in a stable v2 release of setup-matlab in the future.
Feel free to create issues if something comes up while trying out the v2-beta release.
Best, David