diff --git a/.gitignore b/.gitignore index 82e8a6444..a5a9becfc 100644 --- a/.gitignore +++ b/.gitignore @@ -83,6 +83,7 @@ doc/internals/ltxpng *.mexmaca64 *.mexmaci *.mexmaci64 +*.mexmaca64 /mex/matlab/ /mex/octave/ diff --git a/README.md b/README.md index 36ea89126..7c0dfc5dd 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/doc/manual/source/running-dynare.rst b/doc/manual/source/running-dynare.rst index 0e0bc4839..6e2b90647 100644 --- a/doc/manual/source/running-dynare.rst +++ b/doc/manual/source/running-dynare.rst @@ -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`. diff --git a/m4/ax_matlab_arch.m4 b/m4/ax_matlab_arch.m4 index e37bd5228..c9902b3ad 100644 --- a/m4/ax_matlab_arch.m4 +++ b/m4/ax_matlab_arch.m4 @@ -57,6 +57,9 @@ else *mexmaci64) ax_cv_matlab_arch=maci64 ;; + *mexmaca64) + ax_cv_matlab_arch=maca64 + ;; *) ax_cv_matlab_arch=unknown ;; diff --git a/m4/ax_mexopts.m4 b/m4/ax_mexopts.m4 index 52c750581..5e3e9ad84 100644 --- a/m4/ax_mexopts.m4 +++ b/m4/ax_mexopts.m4 @@ -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" ;; diff --git a/matlab/add_path_to_mex_files.m b/matlab/add_path_to_mex_files.m index 2a352d82f..24ccaf15e 100644 --- a/matlab/add_path_to_mex_files.m +++ b/matlab/add_path_to_mex_files.m @@ -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