Install and Configure the MATLAB Runtime

Download the MATLAB Runtime Installer

Download the MATLAB® Runtime from the website at http://www.mathworks.com/products/compiler/mcr.

Install the MATLAB Runtime Interactively

To install the MATLAB® Runtime:

  1. Start the MATLAB Runtime installer.

    ComputerSteps
    Windows®Double-click the compiled MATLAB code package self-extracting archive file, typically named my_program_pkg.exe, where my_program is the name of the MATLAB code. This extracts the MATLAB Runtime installer from the archive, along with all the files that make up the MATLAB Runtime. Once all the files have been extracted, the MATLAB Runtime installer starts automatically.
    Linux®

    Extract the contents of the compiled package, which is a Zip file on Linux systems, typically named, my_program_pkg.zip, where my_program is the name of the compiled MATLAB code. Use the unzip command to extract the files from the package.

    unzip MCRInstaller.zip

    Run the MATLAB Runtime installer script, from the directory where you unzipped the package file, by entering:

    ./install
    For example, if you unzipped the package and MATLAB Runtime installer in \home\USER, you run the ./install from \home\USER.

      Note:   On Mac systems, you may need to enter an administrator username and password after you run ./install.

    Mac

  2. When the MATLAB Runtime installer starts, it displays a dialog box. Read the information and then click Next to proceed with the installation.

  3. Specify the folder in which you want to install the MATLAB Runtime in the Folder Selection dialog box.

      Note:   On Windows systems, you can have multiple versions of the MATLAB Runtime on your computer but only one installation for any particular version. If you already have an existing installation, the MATLAB Runtime installer does not display the Folder Selection dialog box because you can only overwrite the existing installation in the same folder.

  4. Confirm your choices and click Next.

    The MATLAB Runtime installer starts copying files into the installation folder.

  5. On Linux and Mac systems, after copying files to your disk, the MATLAB Runtime installer displays the Product Configuration Notes dialog box. This dialog box contains information necessary for setting your path environment variables. Copy the path information from this dialog box and then click Next.

  6. Click Finish to exit the installer.

Install the MATLAB Runtime Non-Interactively

To install the MATLAB Runtime without having to interact with the installer dialog boxes, use one of the MATLAB Runtime installer's non-interactive modes:

  • silent—the installer runs as a background task and does not display any dialog boxes

  • automated—the installer displays the dialog boxes but does not wait for user interaction

When run in silent or automated mode, the MATLAB Runtime installer uses default values for installation options. You can override these defaults by using MATLAB Runtime installer command-line options or an installer control file.

    Note:   When running in silent or automated mode, the installer overwrites the default installation location.

Running the Installer in Silent Mode

To install the MATLAB Runtime in silent mode:

  1. Extract the contents of the MATLAB Runtime installer file to a temporary folder, called $temp in this documentation.

      Note:   On Windows systems, manually extract the contents of the installer file.

  2. Run the MATLAB Runtime installer, specifying the -mode option and -agreeToLicense yes on the command line.

      Note:   On most platforms, the installer is located at the root of the folder into which the archive was extracted. On Windows 64, the installer is located in the archives bin folder.

    PlatformCommand
    Windowssetup -mode silent -agreeToLicense yes
    Linux./install -mode silent -agreeToLicense yes
    Mac OS X./install -mode silent -agreeToLicense yes

      Note:   If you do not include the -agreeToLicense yes the installer will not install the MATLAB Runtime.

  3. View a log of the installation.

    On Windows systems, the MATLAB Runtime installer creates a log file, named mathworks_username.log, where username is your Windows log-in name, in the location defined by your TEMP environment variable.

    On Linux and Mac systems, the MATLAB Runtime installer displays the log information at the command prompt, unless you redirect it to a file.

Customizing a Non-Interactive Installation

When run in one of the non-interactive modes, the installer will use the default values unless told to do otherwise. Like the MATLAB installer, the MATLAB Runtime installer accepts a number of command line options that modify the default installation properties.

OptionDescription
-destinationFolderSpecifies where the MATLAB Runtime will be installed.
-outputFileSpecifies where the installation log file is written.
-automatedModeTimeoutSpecifies how long, in milliseconds, that the dialog boxes are displayed when run in automatic mode.
-inputFileSpecifies an installer control file with the values for all of the above options.

    Note:   The MATLAB Runtime installer archive includes an example installer control file called installer_input.txt. This file contains all of the options available for a full MATLAB installation. Only the options listed in this section are valid for the MATLAB Runtime installer.

Multiple MATLAB Runtime Versions on Single Machine

MCRInstaller supports the installation of multiple versions of the MATLAB Runtime on a target machine. This allows applications compiled with different versions of the MATLAB Runtime to execute side by side on the same machine.

If you do not want multiple MATLAB Runtime versions on the target machine, you can remove the unwanted ones. On Windows, run Add or Remove Programs from the Control Panel to remove any of the previous versions. On UNIX®, you manually delete the unwanted MATLAB Runtime. You can remove unwanted versions before or after installation of a more recent version of the MATLAB Runtime, as versions can be installed or removed in any order.

MATLAB and MATLAB Runtime on Same Machine

You do not need to install MATLAB Runtime on your machine if your machine has MATLAB installed. The version of MATLAB should be the same as the version of MATLAB that was used to create the compiled MATLAB code. Also, to act as the MATLAB Runtime replacement, the MATLAB installation must include MATLAB Compiler™.

You can, however, install the MATLAB Runtime for debugging purposes.

Modifying the Path

If you install MATLAB Runtime on a machine that already has MATLAB on it, you must adjust the library path according to your needs.

  • Windows

    To run deployed MATLAB code against MATLAB Runtime install, mcr_root\ver\runtime\win32|win64 must appear on your system path before matlabroot\runtime\win32|win64.

    If mcr_root\ver\runtime\arch appears first on the compiled application path, the application uses the files in the MATLAB Runtime install area.

    If matlabroot\runtime\arch appears first on the compiled application path, the application uses the files in the MATLAB installation area.

  • UNIX

    To run deployed MATLAB code against MATLAB Runtime on Linux, Linux x86-64, or the <mcr_root>/runtime/<arch> folder must appear on your LD_LIBRARY_PATH before matlabroot/runtime/<arch>.

    To run deployed MATLAB code on Mac OS X, the <mcr_root>/runtime folder must appear on your DYLD_LIBRARY_PATH before matlabroot/runtime/<arch>.

    To run MATLAB on Mac OS X or Intel® Mac, matlabroot/runtime/<arch> must appear on your DYLD_LIBRARY_PATH before the <mcr_root>/bin folder.

Uninstall MATLAB Runtime

The method you use to uninstall MATLAB Runtime from your computer varies depending on the type of computer.

Windows

  1. Start the uninstaller.

    From the Windows Start menu, search for the Add or Remove Programs control panel, and double-click MATLAB Runtime in the list.

    You can also launch the MATLAB Runtime uninstaller from the mcr_root\uninstall\bin\arch folder, where mcr_root is your MATLAB Runtime installation folder and arch is an architecture-specific folder, such as win64.

  2. Select the MATLAB Runtime from the list of products in the Uninstall Products dialog box and

  3. Click Next.

  4. Click Finish.

Linux

  1. Exit the application.

  2. Enter this command at the Linux prompt:

    rm -rf mcr_root

    where mcr_root represents the name of your top-level MATLAB installation folder.

Mac

  1. Exit the application.

  2. Navigate to your MATLAB Runtime installation folder. For example, the installation folder might be named MATLAB_Compiler_Runtime.app in your Applications folder.

  3. Drag your MATLAB Runtime installation folder to the trash, and then select Empty Trash from the Finder menu.

Was this topic helpful?