Provisions to detect Apple Silicon architecture (maca64 and mexmaca64)

Works only with MATLAB R2022a beta (ARM)

(cherry picked from commit 1317a39b371a952da9a50b2fbe4580ec11ba0009)
silicon-new-samplers
Willi Mutschler 2022-05-31 11:48:00 +02:00 committed by Stéphane Adjemian (Argos)
parent 7d9e07279b
commit 6ded657545
Signed by: stepan
GPG Key ID: A6D44CB9C64CE77B
6 changed files with 22 additions and 5 deletions

1
.gitignore vendored
View File

@ -83,6 +83,7 @@ doc/internals/ltxpng
*.mexmaca64
*.mexmaci
*.mexmaci64
*.mexmaca64
/mex/matlab/
/mex/octave/

View File

@ -45,8 +45,8 @@ determine the type of your MATLAB/Octave installation, type:
```matlab
>> computer
```
at the MATLAB/Octave prompt. Under MATLAB, if it returns `PCWIN64`, `GLNX64` or
`MACI64`, then it is a 64-bit MATLAB; if it returns `PCWIN`, `MACI` or `GLNX`,
at the MATLAB/Octave prompt. Under MATLAB, if it returns `PCWIN64`, `GLNX64`,
`MACA64` or `MACI64`, then it is a 64-bit MATLAB; if it returns `PCWIN`, `MACI` or `GLNX`,
then it is a 32-bit MATLAB. Under Octave, if it returns a string that begins
with `x86_64`, it is a 64-bit Octave; if the strings begins with `i686`, it is
a 32-bit Octave.

View File

@ -315,7 +315,7 @@ by the ``dynare`` command.
Prevent Dynare from printing the output of the steps leading up to the
preprocessor as well as the preprocessor output itself.
.. option:: mexext=mex|mexw32|mexw64|mexmaci64|mexa64
.. option:: mexext=mex|mexw32|mexw64|mexmaca64|mexmaci64|mexa64
The mex extension associated with your platform to be used
when compiling output associated with :opt:`use_dll`.

View File

@ -57,6 +57,9 @@ else
*mexmaci64)
ax_cv_matlab_arch=maci64
;;
*mexmaca64)
ax_cv_matlab_arch=maca64
;;
*)
ax_cv_matlab_arch=unknown
;;

View File

@ -79,6 +79,19 @@ case ${MATLAB_ARCH} in
MATLAB_LIBS="-L$MATLAB/bin/maci64 -lmx -lmex -lmat -lmwlapack -lmwblas"
ax_mexopts_ok="yes"
;;
maca64)
MATLAB_DEFS="-DNDEBUG"
MATLAB_CFLAGS="-fno-common -fexceptions"
MATLAB_CXXFLAGS="-fno-common -fexceptions"
MATLAB_FCFLAGS="-fexceptions -fbackslash"
MATLAB_LDFLAGS_NOMAP="-Wl,-twolevel_namespace -undefined error -bundle"
MATLAB_LDFLAGS="$MATLAB_LDFLAGS_NOMAP -Wl,-exported_symbols_list,\$(abs_top_srcdir)/mexFunction-MacOSX.map"
# This -L flag is put here, hence later on the linker command line, so as
# to avoid linking against the HDF5 shipped by MATLAB (which would
# otherwise override the HDF5 from Homebrew)
MATLAB_LIBS="-L$MATLAB/bin/maca64 -lmx -lmex -lmat -lmwlapack -lmwblas"
ax_mexopts_ok="yes"
;;
*)
ax_mexopts_ok="no"
;;

View File

@ -70,9 +70,9 @@ else
end
end
% Add macOS paths for Dynare Mac package
if strcmp(computer, 'MACI64')
if strcmp(computer, 'MACI64') || strcmp(computer, 'MACA64')
if matlab_ver_less_than('9.4')
tmp = [dynareroot '../mex/matlab/maci64-8.3-9.3/'];
tmp = [dynareroot '../mex/matlab/' lower(computer) '-8.3-9.3/'];
if exist(tmp, 'dir')
mexpath = tmp;
if modifypath