From fb1bc5af1ba7bfd98eea4c869a13d8fa0c080274 Mon Sep 17 00:00:00 2001 From: Etienne Gavazzi <98973824+egavazzi@users.noreply.github.com> Date: Thu, 26 Oct 2023 02:08:30 +0200 Subject: [PATCH] The segfault issue with MATLAB versions 2022/2023 is gone on Linux platforms (#215) * Update README.md warning about segfault issue * Update README.md Add info about updating the MATLAB release in case of segfault * add specific platform warnings regarding issues with R2022/2023 * clarify instructions on how to use different Matlab versions --- README.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 917b95a..634cd0b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ ## MATLAB +| ❗ Windows and MacOS platforms : MATLAB versions R2022 and R2023 do not work with `MATLAB.jl` ❗
You can use older versions as explained [further down](https://github.com/JuliaInterop/MATLAB.jl#changing_matlab_version). | +|:----:| -| :exclamation: ** MATLAB versions 2022 and 2023 trigger a segfault and do not work with `MATLAB.jl`. Maintainers are attempting to diagnose the cause and fix the issue. ** | -|-----------------------------------------| +| ❗ Linux platforms : If you experience problems when starting the MATLAB engine with versions R2022 or R2023, try to [update](https://se.mathworks.com/help/matlab/matlab_env/check-for-software-updates.html) your MATLAB release. | +|:----:| @@ -29,8 +31,6 @@ This package is composed of two aspects: **Important**: The procedure to setup this package consists of the following steps. -By default, `MATLAB.jl` uses the MATLAB installation with the greatest version number. To specify that a specific MATLAB installation should be used, set the environment variable `MATLAB_ROOT`. - ### Windows 1. For Matlab R2020a onwards, you should be able to go directly to step 2. If you encounter issues, run `matlab -batch "comserver('register')"` in the command prompt. For earlier versions of Matlab, start a command prompt as an administrator and enter `matlab /regserver`. @@ -60,6 +60,24 @@ By default, `MATLAB.jl` uses the MATLAB installation with the greatest version n 2. From Julia run: `Pkg.add("MATLAB")` +## Changing MATLAB version + +By default, `MATLAB.jl` is built using the MATLAB installation with the greatest version number. To specify that a specific MATLAB installation should be used, set the environment variable `MATLAB_ROOT`: +```julia +julia> ENV["MATLAB_ROOT"] = "/usr/local/MATLAB/R2021b" # example on a Linux machine +``` +```julia +julia> ENV["MATLAB_ROOT"] = raw"C:\Program Files\MATLAB\R2021b" # example on a Windows machine +``` +Replace the path string with the location of the MATLAB folder on your machine. You need to set the path to the `R20XX` folder, not the `matlab` binary. + +If you had the package `MATLAB.jl` already installed and built before changing the environment variable, you will need to rebuild it to apply the change: +```julia +julia> using Pkg; Pkg.build("MATLAB") +``` + + + ## Usage ### MxArray class