diff --git a/docs/getchunkie.rst b/docs/getchunkie.rst index 6ee8a0c..30dcc7f 100644 --- a/docs/getchunkie.rst +++ b/docs/getchunkie.rst @@ -58,6 +58,29 @@ Troubleshooting - "CHUNKIE STARTUP: unable to find a suitable compiler for FMM2D." fmm2d mex installation depends on gfortran. In case a compiler is not found, the installation will be skipped. To install dependencies follow the procedure below based on your OS +- "mex" redirects to LaTeX compilation. This can happen on either MacOS or Linux, and in both situations the path + to mex is not correctly set. We recommend doing a manual install in the fmm2d folder. + Find your MATLAB installation directory using ``${MATLABROOT}`` on linux, + and on MacOS, typically MATLAB is installed at ``/Applications/MATLAB_R(version number)/``. + The mex executable can then be found in the ``bin`` directory. Navigate to chunkie/fmm2d. + Create a make.inc file by copying one of the template files (make.inc.*) into make.inc. For example, + on MacOS you might do + + .. code:: bash + + cp make.inc.macos.gnu make.inc + + There are other make.inc templates for special situations; see the fmm2d folder. + Then add the following to a new line at the end of make.inc: ``MEX=``. Note: you + should use the absolute path, not a relative path. Then, run + + .. code:: bash + + make matlab + +- On MacOS, if you open MATLAB using spotlight, the MATLAB path fails to find the gfortran compiler. In order to + avoid this issue, we recommend starting MATLAB from the command line, by finding its executable in + the ``bin`` directory of your MATLAB installation. * MacOS diff --git a/startup.m b/startup.m index 0844dfe..000fed4 100644 --- a/startup.m +++ b/startup.m @@ -60,8 +60,12 @@ function startup(opts) path1 = [path1 cmdout2]; setenv('PATH', path1); if ismac - fprintf('Here\n'); - !cp -f make.inc.macos.gnu make.inc; + [~, result] = system('uname -m'); + if strcmpi(result, 'x86_64') + !cp -f make.inc.macos.gnu make.inc; + else + !cp -f make.inc.macos_arm64.gnu make.inc; + end end if fmmrecompile !make clean