mtex on macOS (catalina)

123 views
Skip to first unread message

Rüdiger

unread,
Apr 15, 2020, 11:40:58 AM4/15/20
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

Brady McBride

unread,
Nov 2, 2020, 6:49:36 PM11/2/20
to MTEX
Hello Rüdiger, 

I seem to be having these problems but cannot find a solution. I have done all steps as listed here until I get to "mex -setup C". 

When I do this in MATLAB I get the following:

"Error using mex
No supported compiler was found."

Do compliers need to be installed separately to the main MATLAB install? I'm running MATLAB R2019A on MacOS 10.15.7.

Thanks!

Grafulha Morales Luiz

unread,
Nov 3, 2020, 2:48:54 AM11/3/20
to MTEX

Hi Brady



could you please use the new forum at 


Ralf will close this forum soon

cheers


Luiz


PS - are you sure you have xcode installed properly, together with command line tools?




Luiz F. G. Morales
ScopeM & Structural Geology and Tectonics Group
ETH Zürich

From: mtex...@googlegroups.com <mtex...@googlegroups.com> on behalf of Brady McBride <bmcb...@mymail.mines.edu>
Sent: 03 November 2020 00:49:35
To: MTEX
Subject: {MTEX} Re: mtex on macOS (catalina)
 
--
If you want to reduce the number of emails you get through this forum login to https://groups.google.com/forum/?fromgroups=#!forum/mtexmail, click "My membership" and select "Don't send me email updates". You can still get emails on selected topics by staring them.
---
You received this message because you are subscribed to the Google Groups "MTEX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mtexmail+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mtexmail/5dd3a3c3-2141-4917-a1b2-dd25cb1e5b06n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages