Commit 847feb17 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

fix mex compilation commands for Matlab R2016b on macOS. Closes #1288

parent 4a1ad807
......@@ -67,7 +67,7 @@ if ~exist('OCTAVE_VERSION')
error(['When using the USE_DLL option, you must give either ' ...
'''cygwin'', ''mingw'' or ''msvc'' option to the ''dynare'' command'])
end
elseif isunix
elseif isunix && ~ismac
% MATLAB/Linux
if matlab_ver_less_than('8.3')
eval(['mex -O LDFLAGS=''-pthread -shared -Wl,--no-undefined'' ' ...
......@@ -83,31 +83,30 @@ if ~exist('OCTAVE_VERSION')
end
elseif ismac
% MATLAB/MacOS
if matlab_ver_less_than('8.3')
if matlab_ver_less_than('8.1')
eval(['mex -O LDFLAGS=''-Wl,-twolevel_namespace -undefined ' ...
'error -arch $ARCHS -Wl,-syslibroot,$SDKROOT ' ...
'-mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle'' ' ...
basename '_dynamic.c ' basename '_dynamic_mex.c'])
eval(['mex -O LDFLAGS=''-Wl,-twolevel_namespace -undefined ' ...
'error -arch $ARCHS -Wl,-syslibroot,$SDKROOT ' ...
'-mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle'' ' ...
basename '_static.c ' basename '_static_mex.c'])
else
eval(['mex -O LDFLAGS=''-Wl,-twolevel_namespace -undefined ' ...
'error -arch $ARCHS -Wl,-syslibroot,$MW_SDKROOT ' ...
'-mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle'' ' ...
basename '_dynamic.c ' basename '_dynamic_mex.c'])
eval(['mex -O LDFLAGS=''-Wl,-twolevel_namespace -undefined ' ...
'error -arch $ARCHS -Wl,-syslibroot,$MW_SDKROOT ' ...
'-mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle'' ' ...
basename '_static.c ' basename '_static_mex.c'])
end
if matlab_ver_less_than('8.1')
eval(['mex -O LDFLAGS=''-Wl,-twolevel_namespace -undefined ' ...
'error -arch $ARCHS -Wl,-syslibroot,$SDKROOT ' ...
'-mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle'' ' ...
basename '_dynamic.c ' basename '_dynamic_mex.c'])
eval(['mex -O LDFLAGS=''-Wl,-twolevel_namespace -undefined ' ...
'error -arch $ARCHS -Wl,-syslibroot,$SDKROOT ' ...
'-mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle'' ' ...
basename '_static.c ' basename '_static_mex.c'])
elseif matlab_ver_less_than('8.3')
eval(['mex -O LDFLAGS=''-Wl,-twolevel_namespace -undefined ' ...
'error -arch $ARCHS -Wl,-syslibroot,$MW_SDKROOT ' ...
'-mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle'' ' ...
basename '_dynamic.c ' basename '_dynamic_mex.c'])
eval(['mex -O LDFLAGS=''-Wl,-twolevel_namespace -undefined ' ...
'error -arch $ARCHS -Wl,-syslibroot,$MW_SDKROOT ' ...
'-mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle'' ' ...
basename '_static.c ' basename '_static_mex.c'])
elseif matlab_ver_less_than('9.1')
eval(['mex -O LINKEXPORT='''' ' basename '_dynamic.c ' basename '_dynamic_mex.c'])
eval(['mex -O LINKEXPORT='''' ' basename '_static.c ' basename '_static_mex.c'])
else
eval(['mex -O LINKEXPORT='''' ' basename '_dynamic.c ' ...
basename '_dynamic_mex.c'])
eval(['mex -O LINKEXPORT='''' ' basename '_static.c ' basename ...
'_static_mex.c'])
eval(['mex -O LINKEXPORT='''' LINKEXPORTVER='''' ' basename '_dynamic.c ' basename '_dynamic_mex.c'])
eval(['mex -O LINKEXPORT='''' LINKEXPORTVER='''' ' basename '_static.c ' basename '_static_mex.c'])
end
end
else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment