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
8 changes: 7 additions & 1 deletion @STL_Formula/private/src/robusthom/CompileRobusthom.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ function CompileRobusthom()
' av_robustness' obj_ext ...
];

MEX = 'mex ';
% Workaround for recent Apple linker on macOS arm64 (maca64):
% force classic linker for MEX to avoid undefined mex* adapter symbols.
if ismac && strcmp(computer('arch'),'maca64')
MEX = 'mex ''LDFLAGS=\$LDFLAGS -ld_classic'' ';
else
MEX = 'mex ';
end
FLAGS = ' ';

if isfield(BreachGlobOpt, 'disable_robust_linear_interpolation')
Expand Down
14 changes: 11 additions & 3 deletions Core/CompileSystem.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,19 @@ function CompileSystem(Sys)
qwrap([obj_out_dir filesep 'breach' obj_ext ]) ...
];

if ismac && strcmp(computer('arch'),'maca64')
% Workaround for recent Apple linker on macOS arm64 (maca64):
% force classic linker for MEX to avoid undefined mex* adapter symbols.
mex_cmd = 'mex ''LDFLAGS=\$LDFLAGS -ld_classic'' ';
else
mex_cmd = 'mex ';
end

% compile commands

compile_cvodes_cmd = ['mex -c -outdir ' qwrap(cv_obj_out_dir) ' ' compile_flags ' ' inc_flags ' ' cvodesTB_src_files ];
compile_obj_cmd = ['mex -c -outdir ' qwrap(obj_out_dir) ' ' compile_flags ' ' inc_flags ' ' src_files ];
compile_cvm_cmd = ['mex -output cvm ' compile_flags obj_files cv_obj_files qwrap(blitz_lib) ];
compile_cvodes_cmd = [mex_cmd '-c -outdir ' qwrap(cv_obj_out_dir) ' ' compile_flags ' ' inc_flags ' ' cvodesTB_src_files ];
compile_obj_cmd = [mex_cmd '-c -outdir ' qwrap(obj_out_dir) ' ' compile_flags ' ' inc_flags ' ' src_files ];
compile_cvm_cmd = [mex_cmd '-output cvm ' compile_flags obj_files cv_obj_files qwrap(blitz_lib) ];

% execute commands

Expand Down
8 changes: 7 additions & 1 deletion Ext/Toolboxes/blitz/CompileBlitzLib.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
function CompileBlitzLib()

MEX = 'mex ';
if ismac && strcmp(computer('arch'),'maca64')
% Workaround for recent Apple linker on macOS arm64 (maca64):
% force classic linker for MEX to avoid undefined mex* adapter symbols.
MEX = 'mex ''LDFLAGS=\$LDFLAGS -ld_classic'' ';
else
MEX = 'mex ';
end
INCLUDE = [ '-I.' filesep 'include '];
FLAGS = ' -c ';
src_file = ['.' filesep 'src' filesep 'libblitz.cpp '];
Expand Down
6 changes: 6 additions & 0 deletions Ext/Toolboxes/sundials/sundialsTB/cvodes/cvm/src/setup.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
mexopts = '' ;
mexflags = '-O' ;

if ismac && strcmp(computer('arch'),'maca64')
% Workaround for recent Apple linker on macOS arm64 (maca64):
% force classic linker for MEX to avoid undefined mex* adapter symbols.
mexflags = sprintf('%s ''LDFLAGS=\$LDFLAGS -ld_classic''', mexflags);
end

cc = 'cc' ;
mpicc = '' ;
mpi_incdir = '' ;
Expand Down
8 changes: 7 additions & 1 deletion InstallBreach.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ function InstallBreach(varargin)
% Johan fix
silent = 0;

MEX = 'mex ';
% Workaround for recent Apple linker on macOS arm64 (maca64):
% force classic linker for MEX to avoid undefined mex* adapter symbols.
if ismac && strcmp(computer('arch'),'maca64')
MEX = 'mex ''LDFLAGS=\$LDFLAGS -ld_classic'' ';
else
MEX = 'mex ';
end
FLAGS = ' ';
if silent
FLAGS = [FLAGS ' -silent '];
Expand Down
8 changes: 7 additions & 1 deletion Online/m_src/compile_stl_mex.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ function compile_stl_mex(recomp, debug_level)
cxxflags = '-DIS_PC';
end

if ismac && strcmp(computer('arch'),'maca64')
% Workaround for recent Apple linker on macOS arm64 (maca64):
% force classic linker for MEX to avoid undefined mex* adapter symbols.
cxxflags = [cxxflags ' ''LDFLAGS=\$LDFLAGS -ld_classic'' '];
end


if ispc
obj_ext = 'obj';
Expand Down Expand Up @@ -104,4 +110,4 @@ function compile_stl_mex(recomp, debug_level)
cmd_simulink = sprintf('mex %s %s %s%s %s -outdir %s', cxxflags, includes,prefix_m,src_s_function , objs, bin_dir);
eval(cmd_simulink)
end
end
end