Skip to content

Commit

Permalink
use reexport to reexport MATLAB.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
taylormcd committed Oct 25, 2021
1 parent 0aa5a43 commit b58f495
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ version = "0.1.0"
[deps]
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
MATLAB = "10e44e05-a98a-55b3-a45b-ba969058deb6"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[compat]
julia = "1.0 - 1.5"
MATLAB = "0.8.2"
julia = "1.0 - 1.5"
13 changes: 4 additions & 9 deletions mexjulia/jl.m
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ function init()
% load runtime settings from matfile
jldict = load('jldict', 'julia_home', 'sys_image', 'lib_path');

% make sure MATLAB_HOME points to _this_ version of MATLAB.
setenv('MATLAB_HOME', jl.matlab_dir);

if ispc % cd to Julia dir so that the mexfunction can find DLLs
old_dir = pwd;
cd(jldict.julia_home);
end

% make sure MATLAB_HOME points to _this_ version of MATLAB.
setenv('MATLAB_HOME', jl.matlab_dir);

% basic runtime initialization
mexjulia(false, jldict.julia_home, jldict.sys_image, jldict.lib_path);
Expand All @@ -141,14 +141,9 @@ function init()
' isfile(startupfile) && Base.JLOptions().startupfile != 2 && Base.include(Main, startupfile) ',...
'end '));

mexjulia(true, 'using Pkg')

% load Mex.jl
mexjulia(true, 'using Mex')

mexjulia(true, 'Pkg.add("MATLAB")');

mexjulia(true, 'using MATLAB')

% restore the path
if ispc
cd(old_dir);
Expand Down
5 changes: 4 additions & 1 deletion src/Mex.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module Mex

using MATLAB, Libdl
using Libdl, Reexport

using Reexport
@reexport using MATLAB

export jl_mex, input, call_matlab, is_interrupt_pending, check_for_interrupt

Expand Down

0 comments on commit b58f495

Please sign in to comment.