Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/runTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2023a
release: R2023b
products: Parallel_Computing_Toolbox
- name: Build Mex and Run Tests
uses: matlab-actions/run-command@v2
Expand Down
7 changes: 6 additions & 1 deletion compile/customWrapper/wrapperMexBuild.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
if isunix
args = {'-ldl'};
end

flags = '';
if ismac && strcmp(computer('arch'), 'maca64')
flags = 'LDFLAGS=$LDFLAGS -ld_classic';
end
includeDirs = getappdata(0,'includeDirs');
includes = strcat(repmat({'-I'}, 1,length(includeDirs)), includeDirs);
mex(includes{:}, "wrapperMex.cpp", args{:});
mex(includes{:}, flags, "wrapperMex.cpp", args{:});
disp("wrapperMex compiled successfully");
2 changes: 1 addition & 1 deletion compile/fullCompile/generateCpps.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[compilePath, ~, ~] = fileparts(mfilename("fullpath"));

cd(compilePath);
ratMainMexBuild;
ratMainMexBuild(true);
ratMainCodeGen;
cppDeploy;

Expand Down
4 changes: 3 additions & 1 deletion compile/fullCompile/generateMexFromCpp.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
main_file = [mex_interface_path, '_coder_RATMain_mex.cpp'];
if ismac
if strcmp(computer('arch'), 'maci64')
flags = '';
ompLib = {['-L', fullfile(matlabroot, 'sys', 'os', 'maci64')], '-liomp5'};
else
flags = 'LDFLAGS=$LDFLAGS -ld_classic';
ompLib = {['-L', fullfile(matlabroot, 'toolbox', 'eml', 'externalDependency', 'omp', 'maca64', 'lib')], '-lomp'};
end
includes{end+1} = ['-I', fullfile(matlabroot, 'toolbox', 'eml', 'externalDependency', 'omp', computer('arch'), 'include')];
mex(includes{:}, 'CXXFLAGS=$CXXFLAGS -fPIC -Xpreprocessor -fopenmp -fvisibility=default -ffp-contract=off -std=c++11 -stdlib=libc++', main_file, sources{:}, '-output', 'RATMain_mex', '-v', '-lemlrt', '-lmwmathutil', '-lmwblas', '-lmwlapack', ompLib{:})
mex(includes{:}, flags, 'CXXFLAGS=$CXXFLAGS -fPIC -Xpreprocessor -fopenmp -fvisibility=default -ffp-contract=off -std=c++11 -stdlib=libc++', main_file, sources{:}, '-output', 'RATMain_mex', '-v', '-lemlrt', '-lmwmathutil', '-lmwblas', '-lmwlapack', ompLib{:})
elseif isunix
mex(includes{:}, 'CXXFLAGS=$CXXFLAGS -fopenmp -fvisibility=default -std=c++11', main_file, sources{:}, '-output', 'RATMain_mex', '-v', '-lemlrt', '-lmwmathutil', '-lmwblas', '-lmwlapack', ['-L"', matlabroot, '/sys/os/glnxa64"'], '-liomp5')
else
Expand Down
8 changes: 7 additions & 1 deletion compile/fullCompile/ratMainMexBuild.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
function ratMainMexBuild(codeOnly)
% ratMainMexBuild
%
% Generates MEX-function (RATMain_mex) from RATMain.

arguments
codeOnly {logical} = false
end
% Create configuration object of class 'coder.MexCodeConfig'.
cfg = coder.config('mex');
cfg.GenerateReport = true;
cfg.GenCodeOnly = codeOnly;
cfg.EnableJIT = false;
cfg.EnableOpenMP = true;
cfg.TargetLang = 'C++';
cfg.SIMDAcceleration = 'None';

% Define the input argument types..
ARGS = makeCompileArgsFull();
Expand All @@ -18,3 +23,4 @@
includes(1:2:end) = {'-I'};
includes(2:2:end) = includeDirs;
codegen('RATMain', '-config', cfg, '-args', ARGS{1}, includes{:});
end
Loading