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

MEX.jl with Julia 1.10.1 #19

Open
rgelleschus opened this issue Feb 27, 2024 · 0 comments
Open

MEX.jl with Julia 1.10.1 #19

rgelleschus opened this issue Feb 27, 2024 · 0 comments

Comments

@rgelleschus
Copy link

Sadly, Mex.jl doesn't seem to work with Julia 1.10.1.

After some trial (by me) and error (by Matlab) yesterday I installed Julia's long term support version 1.6.7, installed MATLAB.jl and Mex.jl and it worked fine with my installation of Matlab R2021b. However, the actual Julia package I want to use installs an old version on Julia 1.6.7 which hasn't all the functionality that I will need, so it's not an option for me to use that old Julia version to get Mex.jl to work.

In theory I might be able to find some Julia version in between 1.6.7 and 1.10.1 where both packages work but that doesn't sound like a long term solution. Here's the output of a REPL session with a completely new Julia installation:

(@v1.10) pkg> add MATLAB
  Installing known registries into `C:\Users\Ronny\.julia`
    Updating registry at `C:\Users\Ronny\.julia\registries\General.toml`
   Resolving package versions...
   Installed MATLAB ─ v0.8.4
    Updating `C:\Users\Ronny\.julia\environments\v1.10\Project.toml`
  [10e44e05] + MATLAB v0.8.4
    Updating `C:\Users\Ronny\.julia\environments\v1.10\Manifest.toml`
  [10e44e05] + MATLAB v0.8.4
  [56f22d72] + Artifacts
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [2f01184e] + SparseArrays v1.10.0
  [e66e0078] + CompilerSupportLibraries_jll v1.1.0+0
  [4536629a] + OpenBLAS_jll v0.3.23+4
  [bea87d4a] + SuiteSparse_jll v7.2.1+1
  [8e850b90] + libblastrampoline_jll v5.8.0+1
    Building MATLAB → `C:\Users\Ronny\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\f640678d27790992e2a697f60e6afb1be3ebb7fc\build.log`
Precompiling project...
  2 dependencies successfully precompiled in 3 seconds. 2 already precompiled.

(@v1.10) pkg> test MATLAB
     Testing MATLAB
      Status `C:\Users\Ronny\AppData\Local\Temp\jl_0zgNbg\Project.toml`
  [2f01184e] SparseArrays v1.10.0
  [8dfed614] Test
      Status `C:\Users\Ronny\AppData\Local\Temp\jl_0zgNbg\Manifest.toml`
  [10e44e05] MATLAB v0.8.4
  [56f22d72] Artifacts
  [b77e0a4c] InteractiveUtils
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [9a3f8284] Random
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization
  [2f01184e] SparseArrays v1.10.0
  [8dfed614] Test
  [e66e0078] CompilerSupportLibraries_jll v1.1.0+0
  [4536629a] OpenBLAS_jll v0.3.23+4
  [bea87d4a] SuiteSparse_jll v7.2.1+1
  [8e850b90] libblastrampoline_jll v5.8.0+1
Precompiling project...
  2 dependencies successfully precompiled in 3 seconds. 3 already precompiled.
     Testing Running tests...
     Testing MATLAB tests passed

(@v1.10) pkg> add Mex
   Resolving package versions...
   Installed Reexport ─ v1.2.2
   Installed Mex ────── v0.1.1
    Updating `C:\Users\Ronny\.julia\environments\v1.10\Project.toml`
  [5e29dd5e] + Mex v0.1.1
    Updating `C:\Users\Ronny\.julia\environments\v1.10\Manifest.toml`
  [5e29dd5e] + Mex v0.1.1
  [189a3867] + Reexport v1.2.2
    Building Mex → `C:\Users\Ronny\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\2e99a552c9b0f56718ed54e9427c4789f122f4af\build.log`
Precompiling project...
  2 dependencies successfully precompiled in 2 seconds. 4 already precompiled.

(@v1.10) pkg> test Mex
     Testing Mex
      Status `C:\Users\Ronny\AppData\Local\Temp\jl_nvUX8O\Project.toml`
  [10e44e05] MATLAB v0.8.4
  [5e29dd5e] Mex v0.1.1
  [8dfed614] Test
      Status `C:\Users\Ronny\AppData\Local\Temp\jl_nvUX8O\Manifest.toml`
  [10e44e05] MATLAB v0.8.4
  [5e29dd5e] Mex v0.1.1
  [189a3867] Reexport v1.2.2
  [56f22d72] Artifacts
  [2a0f44e3] Base64
  [b77e0a4c] InteractiveUtils
  [8f399da3] Libdl
  [37e2e46d] LinearAlgebra
  [56ddb016] Logging
  [d6f4376e] Markdown
  [9a3f8284] Random
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization
  [2f01184e] SparseArrays v1.10.0
  [8dfed614] Test
  [e66e0078] CompilerSupportLibraries_jll v1.1.0+0
  [4536629a] OpenBLAS_jll v0.3.23+4
  [bea87d4a] SuiteSparse_jll v7.2.1+1
  [8e850b90] libblastrampoline_jll v5.8.0+1
Precompiling project...
  2 dependencies successfully precompiled in 3 seconds. 5 already precompiled.
     Testing Running tests...
jl.eval: Error During Test at C:\Users\Ronny\.julia\packages\Mex\qcSLo\test\runtests.jl:7
  Got exception outside of a @test
  MATLAB.MEngineError("invalid engine session (err = 1)")
  Stacktrace:
    [1] eval_string(session::MSession, stmt::String)
      @ MATLAB C:\Users\Ronny\.julia\packages\MATLAB\xBhSu\src\engine.jl:135
    [2] eval_string(stmt::String)
      @ MATLAB C:\Users\Ronny\.julia\packages\MATLAB\xBhSu\src\engine.jl:147
    [3] macro expansion
      @ C:\Users\Ronny\.julia\packages\MATLAB\xBhSu\src\matstr.jl:161 [inlined]
    [4] macro expansion
      @ C:\Users\Ronny\.julia\packages\Mex\qcSLo\test\runtests.jl:9 [inlined]
    [5] macro expansion
      @ C:\Users\Ronny\AppData\Local\Programs\Julia-1.10.1\share\julia\stdlib\v1.10\Test\src\Test.jl:1577 [inlined]
    [6] top-level scope
      @ C:\Users\Ronny\.julia\packages\Mex\qcSLo\test\runtests.jl:9
    [7] include(fname::String)
      @ Base.MainInclude .\client.jl:489
    [8] top-level scope
      @ none:6
    [9] eval
      @ .\boot.jl:385 [inlined]
   [10] exec_options(opts::Base.JLOptions)
      @ Base .\client.jl:291
   [11] _start()
      @ Base .\client.jl:552
Test Summary: | Error  Total   Time
jl.eval       |     1      1  16.7s
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at C:\Users\Ronny\.julia\packages\Mex\qcSLo\test\runtests.jl:5
ERROR: Package Mex errored during testing

If I hadn't done the test and instead tried to use Mex.jl from MATLAB, the result would be MATLAB crashing and closing without error whenever I use jl.eval().

I don't know what that "invalid engine session" error is trying to tell me, especially since it works with the same MATLAB installation and just an older Julia one. Did something vital change in MATLAB.jl or in Julia's C API? Maybe it's an easy fix for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant