Skip to content

Commit

Permalink
The segfault issue with MATLAB versions 2022/2023 is gone on Linux pl…
Browse files Browse the repository at this point in the history
…atforms (#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
  • Loading branch information
egavazzi authored Oct 26, 2023
1 parent bce2d0f commit fb1bc5a
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
## MATLAB

| ❗ Windows and MacOS platforms : MATLAB versions R2022 and R2023 do not work with `MATLAB.jl` ❗ <br/> 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. |
|:----:|



Expand All @@ -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`.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fb1bc5a

Please sign in to comment.