-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from ASML-Labs/make-linux-compatible
Add Linux support
- Loading branch information
Showing
9 changed files
with
74 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
function bjlname = getmatfrostjuliacall(bindir) | ||
function mjlname = getmatfrostjuliacall(juliaexe) | ||
% Get the name of the compiled mex file. If MEX file does not exist, it will compile. | ||
% | ||
bjlname = matfrostjuliacallname(bindir); | ||
if ~exist(bjlname, "file") | ||
mexdir = matfrostmexdir(); | ||
matfrostmake(bindir, fullfile(mexdir, bjlname + ".mexw64")); | ||
mjlname = matfrostjuliacallname(juliaexe); | ||
if ~exist(mjlname, "file") | ||
mexdir = matfrostmexdir(juliaexe); | ||
matfrostmake(juliaexe, mexdir, mjlname); | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
function bjlname = matfrostjuliacallname(bindir) | ||
function bjlname = matfrostjuliacallname(juliaexe) | ||
|
||
bjlname = "matfrostjuliacall_" + mlreportgen.utils.hash(string(version) + juliaversion(bindir) + matfrostversion()); | ||
bjlname = "matfrostjuliacall_" + mlreportgen.utils.hash(string(version) + juliaversion(juliaexe) + matfrostversion()); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
function matfrostmake(bindir, outmex) | ||
function matfrostmake(juliaexe, mexdir, mjlname) | ||
% NOTE: MinGW-w64 should be installed separately. | ||
% Environment variable: "MW_MINGW64_LOC" should point to the MinGW installation directory. | ||
% | ||
% Or see https://mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html | ||
|
||
arguments | ||
bindir (1,1) string {mustBeFolder} | ||
outmex (1,1) string %= fullfile(fileparts(mfilename('fullpath')), 'bin'); | ||
juliaexe (1,1) string | ||
mexdir (1,1) string | ||
mjlname (1,1) string | ||
end | ||
if ~isfolder(fileparts(outmex)) | ||
mkdir(fileparts(outmex)) | ||
if ~isfolder(mexdir) | ||
mkdir(mexdir) | ||
end | ||
|
||
julia_dir = fileparts(bindir); | ||
|
||
mex('-v', ... | ||
strcat('-I"', fullfile(julia_dir, 'include', 'julia'), '"'), ... | ||
strcat('"', fullfile(julia_dir, 'lib', 'libjulia.dll.a'), '"'), ... | ||
strcat('"', fullfile(julia_dir, 'lib', 'libopenlibm.dll.a'), '"'), ... | ||
'-output', outmex, ... | ||
fullfile(fileparts(fileparts(fileparts(mfilename('fullpath')))), 'matfrostjuliacall', 'matfrostjuliacall.cpp')); | ||
julia_dir = fileparts(fileparts(juliaexe)); | ||
if ispc | ||
mex('-v', ... | ||
strcat('-I"', fullfile(julia_dir, 'include', 'julia'), '"'), ... | ||
strcat('"', fullfile(julia_dir, 'lib', 'libjulia.dll.a'), '"'), ... | ||
strcat('"', fullfile(julia_dir, 'lib', 'libopenlibm.dll.a'), '"'), ... | ||
'-output', fullfile(mexdir, mjlname + ".mexw64"), ... | ||
fullfile(fileparts(fileparts(fileparts(mfilename('fullpath')))), 'matfrostjuliacall', 'matfrostjuliacall.cpp')); | ||
elseif isunix | ||
mex('-v', ... | ||
strcat('-I"', fullfile(julia_dir, 'include', 'julia'), '"'), ... | ||
strcat('"', fullfile(julia_dir, 'lib', 'libjulia.so'), '"'), ... | ||
'-output', fullfile(mexdir, mjlname + ".mexa64"), ... | ||
fullfile(fileparts(fileparts(fileparts(mfilename('fullpath')))), 'matfrostjuliacall', 'matfrostjuliacall.cpp')); | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters