Invalid MEX-file MacOS

52 次查看(过去 30 天)
Jakob Ketterer
Jakob Ketterer 2020-11-9
Hi,
i want to install the biomechanical toolkit to matlab (2020b). I am using MacOs 10.15.7. However, i get this error about missing libraries:
Invalid MEX-file '/Users/jakobketterer/Documents/MATLAB/btk/btkReadAcquisition.mexmaci64':
dlopen(/Users/jakobketterer/Documents/MATLAB/btk/btkReadAcquisition.mexmaci64, 6): Library not loaded:
@loader_path/libmex.dylib
Referenced from: /Users/jakobketterer/Documents/MATLAB/btk/btkReadAcquisition.mexmaci64
Reason: image not found
When i copy the 'libmex.dylib' file from fullfile(matlabroot, 'bin/maci64/libmex.dylib') and place it in the folder of the toolbox, another error appears asking for the 'libeng.dylib' file. After copying this, the follwoing error is shown:
Invalid MEX-file '/Users/jakobketterer/Documents/MATLAB/btk/btkReadAcquisition.mexmaci64':
dlopen(/Users/jakobketterer/Documents/MATLAB/btk/btkReadAcquisition.mexmaci64, 6): Symbol not found:
__ZN8Mlm_file11get_aspectsERiS0_S0_RbS1_S1_
Referenced from: /Users/jakobketterer/Documents/MATLAB/btk/libmex.dylib
Expected in: /Applications/MATLAB_R2020b.app/bin/maci64/libmwm_dispatcher.dylib
in /Users/jakobketterer/Documents/MATLAB/btk/libmex.dylib

回答(1 个)

Rajat Tewari
Rajat Tewari 2020-11-12
  1 个评论
Walter Roberson
Walter Roberson 2020-11-12
MacOS Sierra and later have System Integrity Protection features that can prevent dll from being loaded for applications that live in /Applications unless the dll is put into /usr/lib . The security feature was only supposed to affect Apple supplied software but in practice most things in /Applications are affected. MacOs Catalina split the operating system and put major parts into a protected file system, which I suspect makes it more difficult for a user to modify /usr/lib .
It is Apple's intention that applications installed in /Applications should only be able to access system DLLs and DLLs provided with the application and signed with the Developer's certificate. It is explicitly intended that users will not be able to install DLLs for use by multiple programs, that the DLLs must be part of each application that they are used with. The claim is that this will prevent cross-program attacks, preventing a process from contaminating a DLL that is in use by another process.
This is a significant part of the reason that Nvidia will no longer support Apple. Apple declined to certify Nvidia drivers as part of the operating system, and now the Nvidia drivers would have to be supplied with each application individually.
I do not know how this will affect MATLAB's ability to call DLLs, but according to a few posts it has already made it necessary to install some DLLs into /usr/lib instead of in user directories.
This is not just a matter of ensuring that the LD_LIBRARY_PATH includes the DLLs: the security features are actively ignoring that for protected programs (and more things are protected than should be.)
The effect is similar in some ways to how LD_LIBRARY_PATH has always been ignored for suid and sguid executables.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by