Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Simulink Real-Time™ Target Support Package installable via MPM #109

Open
sribasadhikary opened this issue Jun 14, 2024 · 13 comments
Open
Assignees
Labels
mpm MATLAB Package Manager related question Further information is requested

Comments

@sribasadhikary
Copy link

sribasadhikary commented Jun 14, 2024

No description provided.

@prabhakk-mw prabhakk-mw added the question Further information is requested label Jun 14, 2024
@prabhakk-mw prabhakk-mw added the mpm MATLAB Package Manager related label Jun 14, 2024
@sribasadhikary
Copy link
Author

na

@sbnicholas
Copy link
Member

Hi sribasadhikary. This functionality is in the next MPM release, MPM 2024.2, which will be available later this summer.

@davidtopham
Copy link

Can someone please explain how I do this? I can't see the Simulink Real-Time Target Support Package listed in the example mpm input files, so I've guessed at the product name.

The documentation on this page seems to be conflicting:

To download the unsupported support packages, use the Support Software Downloader. You can then install the support packages by following the instructions in the README included in the download. mpm does not support installing support packages downloaded using the Support Software Downloader.

I have tried passing the source folder argument for the package that I've downloaded with the Support Software Downloader but get this error:

Error: Invalid source folder. Specify a valid source folder containing extracted MathWorks product installation files

@prabhakk-mw
Copy link
Member

Looping in @mw-skardile for his thoughts

@prabhakk-mw prabhakk-mw reopened this Aug 8, 2024
@mw-wtripp
Copy link
Member

Hi, @davidtopham. I can confirm that mpm does not support downloading or installing Simulink Real-Time Target Support Package. Instead, follow these instructions:

  1. Download the latest Support Software Downloader for your platform.
  2. Run the downloader. Select your release, the support packages you want, and the folder to download them to.
  3. Once the download is complete, in the download folder, open the readme.txt file. Follow the instructions in that readme to install the support packages.

We will add these instructions to the mpm documentation.

@jannik-l
Copy link

Any update on direct support by mpm? Using mpm 2024.2.2 I receive the following error:
Error: These are not supported by mpm: Simulink_Real-Time_Target_Support_Package

@davidtopham
Copy link

Hi, @davidtopham. I can confirm that mpm does not support downloading or installing Simulink Real-Time Target Support Package. Instead, follow these instructions:

  1. Download the latest Support Software Downloader for your platform.
  2. Run the downloader. Select your release, the support packages you want, and the folder to download them to.
  3. Once the download is complete, in the download folder, open the readme.txt file. Follow the instructions in that readme to install the support packages.

We will add these instructions to the mpm documentation.

Hi @mw-wtripp,

I am trying to do this in a Dockerfile to be able to install the Simulink Real-Time Target Support Package in a Docker container. However, I get an error when building the docker container on the line that runs SupportSoftwareInstaller that there is no display available.

I don't want to have any display support in my container, so is there a way around this?

> [4/4] RUN /opt/matlab/R2023b/bin/glnxa64/SupportSoftwareInstaller -downloadfolder /MATLAB/SupportPackages/R2023b -inputfile /MATLAB/SupportPackages/R2023b/ssi_input.txt: 0.570 terminate called after throwing an instance of '(anonymous namespace)::DisplayError' 0.570 what(): No display available. 0.573 Aborted

@mw-wtripp
Copy link
Member

@davidtopham, at the moment we don't have a workaround for this. The display is required to show a license agreement that needs to be agreed to and can't be skipped. The development team is aware of this limitation and is investigating ways to remove it.

@gamlab-jlin
Copy link

Hi all,

I have played around with the SupportSoftwareInstaller and the Docker Hub MATLAB image.

I have noticed that xvfb is installed in the Docker Hub base image. It can also be seen in the Dockerfile:
matlab/Dockerfile

I had success with installing Simulink Real-Time Target Support Package without any interactive prompt by using xvfb-run and the SupportSoftwareInstaller.
(See the below Dockerfile for context.)

It could be interesting to explore if this would be suitable as a temporary workaround.

Notes:

  1. The SupportPackages.tar.gz archive contains the files downloaded using (Support Software Downloader)[https://www.mathworks.com/support/install/support-software-downloader.html]
  2. The SupportSoftwareInstaller when using sudo, seems to install the Support Package under root's home directory.
# To specify which MATLAB release to install in the container, edit the value of the MATLAB_VERSION argument.
ARG MATLAB_VERSION=2024b

# Specify the extra products to install into the image. These products can either be toolboxes or support packages.
ARG ADDITIONAL_PRODUCTS="Simulink Simulink_Real-Time"

# Declare the global argument to use at the current build stage
FROM mathworks/matlab:r$MATLAB_VERSION
ARG MATLAB_VERSION
ARG ADDITIONAL_PRODUCTS

# By default, the MATLAB container runs as user "matlab". To install mpm dependencies, switch to root.
USER root
# Install mpm dependencies and other tools
RUN export DEBIAN_FRONTEND=noninteractive \
    && apt-get update \
    && apt-get install --no-install-recommends --yes \
    wget \
    unzip \
    git \
    ca-certificates \
    && apt-get clean \
    && apt-get autoremove \
    && rm -rf /var/lib/apt/lists/*

# Switch to user matlab, and pass in $HOME variable to mpm,
# so that mpm can set the correct root folder for the support packages.
USER matlab
WORKDIR /tmp
RUN wget -q https://www.mathworks.com/mpm/glnxa64/mpm \
    && chmod +x mpm \
    && EXISTING_MATLAB_LOCATION=$(dirname $(dirname $(readlink -f $(which matlab)))) \
    && sudo HOME=${HOME} ./mpm install \
    --destination=${EXISTING_MATLAB_LOCATION} \
    --release=R${MATLAB_VERSION} \
    --products ${ADDITIONAL_PRODUCTS} \
    || (echo "MPM Installation Failure. See below for more information:" && cat /tmp/mathworks_root.log && false) \
    && sudo rm -f mpm /tmp/mathworks_root.log

# Install Support Package ("Simulink Real-Time Target Support Package")
# COPY in the support package files to be installed and run the installation
# We use xvfb-run when running the SupportSoftwareInstaller under matlabroot
WORKDIR /tmp/slrt
COPY ./SupportPackages.tar.gz /tmp/slrt
RUN tar -xzf SupportPackages.tar.gz \
    && sudo HOME=${HOME} xvfb-run /opt/matlab/R${MATLAB_VERSION}/bin/glnxa64/SupportSoftwareInstaller -downloadfolder ./SupportPackages/R${MATLAB_VERSION} -inputFile ./SupportPackages/R${MATLAB_VERSION}/ssi_input.txt \
    || (echo "Support Package Installation Failure. See below for more information:" && cat /tmp/mathworks_root.log && false) \
    && sudo rm -rf /tmp/mathworks_root.log /tmp/slrt

# COPY over the support package folder from root to matlab user home directory.
# The SupportSoftwareInstaller places the installed support package under root.
RUN sudo cp -a /root/Documents/MATLAB/SupportPackages/. /home/matlab/Documents/MATLAB/SupportPackages/

# Set user and work directory
USER matlab
WORKDIR /home/matlab/

# Set entrypoint and command
ENTRYPOINT [ "tail", "-f", "/dev/null" ]
CMD [ "" ]

Cheers!

@davidtopham
Copy link

Thanks a lot @gamlab-jlin, that helped me narrow it down to some of the dependencies from the MathWorks container-images Dockerfile to allow xvfb-run to work with the SupportSoftwareInstaller.

I've managed to get it to install in my Docker container now, but it seems like there are some files missing from the archives downloaded via the the Support Software Downloader. It looks like it's missing the QNX compiler (which should end up in SupportPackages/R2023b/toolbox/slrealtime/target/supportpackage/qnx710) in the zip files that are downloaded using that method. @mw-wtripp do you know if this is expected?

This means when I try to build a Simulink Real-Time model, it fails at the compilation stage as the compiler can't be found.

Installing this support package through the MATLAB Add-on manager on my Windows desktop installs everything I need.

@mw-wtripp
Copy link
Member

Hi, @davidtopham. The issue you're seeing is not expected. If you're still having trouble, I recommend creating a support case at https://www.mathworks.com/support/contact_us.html. Someone from our team can help you resolve this.

@jannik-l
Copy link

Hi @davidtopham, have you been able to install the support package in the meantime?

@gamlab-jlin
Copy link

gamlab-jlin commented Nov 2, 2024

Hi! I have done a quick test on Windows as well. It seems like the silent installation mode with SupportSoftwareInstaller installer does not install the QNX compiler. However, the interactive installation with install_supportsoftware installer does install QNX compiler, which means the downloaded files contain the necessary files. (I assume this has something to do with the QNX licenses not being properly accepted with the silent mode.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mpm MATLAB Package Manager related question Further information is requested
Projects
None yet
Development

No branches or pull requests

8 participants