I am trying to run spm12 with matlab 2023b on my macOS but I got this error when I type spm and I have already installed xcode14 from App Store

298 次查看(过去 30 天)
>> spm
Error using spm_check_installation>check_basic
SPM uses a number of MEX files, which are compiled functions.
These need to be compiled for the various platforms on which SPM
is run. It seems that the compiled files for your computer platform
are missing or not compatible. See
https://en.wikibooks.org/wiki/SPM/Installation_on_64bit_Mac_OS_(Intel)
for information about how to compile MEX files for MACA64
in MATLAB 23.2.0.2391609 (R2023b) Update 2.
  11 个评论
Amir
Amir 2024-9-25,16:38
download the updated files from github (for apple silicon). copy & replace into your installation directory. then run spm12 in matlab. it works

请先登录,再进行评论。

回答(2 个)

Laurent Lamalle
Laurent Lamalle 2023-10-27
编辑:Laurent Lamalle 2023-10-27
Hello,
For SPM12, on my M2-based PowerBook Pro, I succeeded compiling mexmaca64 mex files using the following procedure:
  • In spm12/src, I edited "Makefile.var" and replaced "mexmaci64" with "mexmaca64" in the MacOS section:
  • ##### MacOS #####
  • ifeq (Darwin,$(PLATFORM))
  • MEXEXT = mexmaca64
  • ...
  • In spm12/src, I edited "Makefile" and added in the "Display Messages" section a line to handle mexmaca64:
  • verb.mexmaci64:
  • $(call verb, "MacOS compilation (Intel 64 bit)")
  • verb.mexmaca64:
  • $(call verb, "MacOS compilation (ARM 64 bit)")
  • After that, the commands "make" and "make install" both run successfully (current directory being spm12/src).
  • I edited spm12/external/src/geometry.c, to add:
  • #include "mex.h"
  • after #include "geometry.h".
  • Then, the command:
  • CFLAGS="-I/PathTo/MATLAB_R2023b.app//extern/include/" make external
  • succeeds, as well as
  • make external-install.
  • I further edited spm12/spm_platform.m to insert the line:
  • 'MACA64', 'unx', 0;...
  • after the line
  • 'MACI64', 'unx', 0;...
  • and changed
  • case {'MAC','MACI','MACI64'}
  • to
  • case {'MAC','MACI','MACI64','MACA64'}
  • in the switch comp cases.
It should be easy to further adapt so that both mexmaci64 and mexmaca64 could be compiled depending on the CPU architecture underlying the particular Darwin platform.
Now, it seems that the developer version of SPM (on github.com) includes already mexmaca64 files...
  4 个评论
Xiaoqing
Xiaoqing 2024-1-6
编辑:Walter Roberson 2024-1-6
hello, I met the same issue. I did as the steps mentioned above.
But at the step make && make install step, I got this message:
cp -f spm_sample_vol.mexmaca64 spm_slice_vol.mexmaca64 spm_brainwarp.mexmaca64 spm_conv_vol.mexmaca64 spm_render_vol.mexmaca64 spm_global.mexmaca64 spm_resels_vol.mexmaca64 spm_bsplinc.mexmaca64 spm_bsplins.mexmaca64 spm_unlink.mexmaca64 spm_existfile.mexmaca64 spm_gamrnd.mexmaca64 spm_hist.mexmaca64 spm_krutil.mexmaca64 spm_project.mexmaca64 spm_hist2.mexmaca64 spm_dilate_erode.mexmaca64 spm_bwlabel.mexmaca64 spm_get_lm.mexmaca64 spm_voronoi.mexmaca64 spm_mesh_dist.mexmaca64 spm_mesh_utils.mexmaca64 spm_mrf.mexmaca64 spm_diffeo.mexmaca64 spm_field.mexmaca64 spm_cat.mexmaca64 spm_jsonread.mexmaca64 spm_mesh_reduce.mexmaca64 spm_mesh_geodesic.mexmaca64 spm_mesh_ray_triangle.mexmaca64 spm_gmmlib.mexmaca64 ..
cp: spm_sample_vol.mexmaca64: No such file or directory
cp: spm_slice_vol.mexmaca64: No such file or directory
cp: spm_brainwarp.mexmaca64: No such file or directory
cp: spm_conv_vol.mexmaca64: No such file or directory
cp: spm_render_vol.mexmaca64: No such file or directory
cp: spm_global.mexmaca64: No such file or directory
cp: spm_resels_vol.mexmaca64: No such file or directory
cp: spm_bsplinc.mexmaca64: No such file or directory
cp: spm_bsplins.mexmaca64: No such file or directory
cp: spm_unlink.mexmaca64: No such file or directory
cp: spm_existfile.mexmaca64: No such file or directory
cp: spm_gamrnd.mexmaca64: No such file or directory
cp: spm_hist.mexmaca64: No such file or directory
cp: spm_krutil.mexmaca64: No such file or directory
cp: spm_project.mexmaca64: No such file or directory
cp: spm_hist2.mexmaca64: No such file or directory
cp: spm_dilate_erode.mexmaca64: No such file or directory
cp: spm_bwlabel.mexmaca64: No such file or directory
cp: spm_get_lm.mexmaca64: No such file or directory
cp: spm_voronoi.mexmaca64: No such file or directory
cp: spm_mesh_dist.mexmaca64: No such file or directory
cp: spm_mesh_utils.mexmaca64: No such file or directory
cp: spm_mrf.mexmaca64: No such file or directory
cp: spm_diffeo.mexmaca64: No such file or directory
cp: spm_field.mexmaca64: No such file or directory
cp: spm_cat.mexmaca64: No such file or directory
cp: spm_jsonread.mexmaca64: No such file or directory
cp: spm_mesh_reduce.mexmaca64: No such file or directory
cp: spm_mesh_geodesic.mexmaca64: No such file or directory
cp: spm_mesh_ray_triangle.mexmaca64: No such file or directory
cp: spm_gmmlib.mexmaca64: No such file or directory
make: *** [main-install] Error 1
I tried download the dev version spm again, but it still failed.
Do you have any suggestion, here is my system.
Apple M2 Sonoma
Stefan Möller
Stefan Möller 2024-1-29
编辑:Stefan Möller 2024-1-29
I had similar issues as NADA and Lorenzo. What worked for me was doing the changes to Makefile and Makefile.var as Laurent suggested. In Makefile.var I also changed MEXBIN to
MEXBIN = /Applications/MATLAB_R2023b.app/bin/mex
and in this line
MEXOPTS = -O -largeArrayDims
I changed the "-" because it might have gotten misread by the system. I don't know if that changed anythong though.
I then changed MACI64 to MACA64 in a few places in spm_platform to get SPM to start.

请先登录,再进行评论。


Amir Dehsarvi
Amir Dehsarvi 2024-4-9
Just install SPM12 the developers version.
  7 个评论
Walter Roberson
Walter Roberson 2024-8-24
出错 flip (32 )
[varargout{1:nargout}] = builtin(mfilename, varargin{:});
The error message is line 32 of flip. But I checked all of the flip.m I could find, and none of them have that line on line 32 -- none of them use builtin() at all.
This suggests that possibly you have a third-party flip.m that is interfering with the built-in functions.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

标签

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by