Rüdiger
unread,Apr 15, 2020, 11:40:58 AM4/15/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MTEX
Hi all,
in case someone runs into trouble installing/using mtex on macOS (10.15
- although not sure if this partially applies also to 10.14) such as e.g.
Error:
Invalid MEX-file 'some path to
mtex/mtex-5.3/extern/nfft/nfsoftmex.mexmaci64': dlopen(some path to
mtex//mtex-5.3/extern/nfft/nfsoftmex.mexmaci64, 6): no suitable image
found. Did find:
some path to mtex/mtex-5.3/extern/nfft/nfsoftmex.mexmaci64: code
signature in (some path to
mtex/mtex-5.3/extern/nfft/nfsoftmex.mexmaci64) not valid for use in
process using Library Validation: library load disallowed by system policy
a) Either download mtex with a command line tool such as curl or wget,
or, if you have used a browser, use a terminal and:
sudo xattr -r -d com.apple.quarantine /path/to/mtexfolder
Error: unable to compile mex files during startup_mtex e.g.:
Checking mex files failed!
> Trying now to recompile mex files.
> In mex_install (line 15)
In check_installation>check_mex (line 69)
In check_installation (line 33)
In startup_mtex (line 66)
In startup (line 7)
... compiling S1Grid_find.c
Building with 'Xcode with Clang'.
Compiling some path to mtex/mtex-5.3/mex/S1Grid_find.c failed!
or/and
> MTEX: Couldn't get the mex files working!
> The original error message was:
> Invalid MEX-file
> 'some path to mtex/mtex-5.3/mex/SO3Grid_dist_region.mexmaci64':
> dlopen(some path to mtex/mtex-5.3/mex/SO3Grid_dist_region.mexmaci64,
> 6): Library not loaded: @loader_path/libmex.dylib
> Referenced from:
> some path to mtex/mtex-5.3/mex/SO3Grid_dist_region.mexmaci64
> Reason: image not found
> Contact author for help!
b) make sure after upgrading your system, to also upgrade xcode (via
appstore) and install the command line tools, accpt the licence
sudo xcodebuild -license accept
xcode-select --install
c) it might be that you need to modify the compiler options used by Matlab:
Get options path (example output) from within Matlab (you can also add
-v to the mex compile options and look for the line starting with
Options file: /):
m = mex.getCompilerConfigurations
m.MexOpt
ans =
/Users/rk/Library/Application
Support/MathWorks/MATLAB/R2019b/mex_C_maci64.xml
but it might also be (or elsewhere), for example:
/Applications/MATLAB_R2019a.app/bin/maci64/mexopts/clang_maci64.xml
within the file 'mex_C_maci64.xml'
change the line
<SDKVER>
<cmdReturns name="xcrun -sdk macosx
--show-sdk-version"/>
</SDKVER>
to
<SDKVER>
<cmdReturns name="xcrun -sdk macosx
--show-sdk-version | cut -c1-5"/>
</SDKVER>
and potentially do a
mex -setup C
from within Matlab.
Now startup_mtex.m will hopefully run without any trouble.
Rüdiger