Matlab中无效的glmnet Mex文件 [英] Invalid glmnet Mex file in matlab

查看:184
本文介绍了Matlab中无效的glmnet Mex文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在macOS 10.14中的MATLAB 2019a上运行 glmnet 程序包.5.我还在笔记本电脑中安装了Xcode.

I am running glmnet package on MATLAB 2019a in macOS 10.14.5. I have also installed Xcode in my laptop.

我收到如下错误:

Invalid MEX-file '/Users/Desktop/Research/Paper Code/glmnet/glmnetMex.mexmaci64' : dlopen(/Users/Desktop/Research/Paper Code/glmnet/glmnetMex.mexmaci64,
6): Library not loaded: @loader_path/libmex.dylib
  Referenced from: /Users/Desktop/Research/Paper Code/glmnet/glmnetMex.mexmaci64

我尝试了代码mex -setup并得到了

MEX configured to use 'Xcode with Clang' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. 
In the near future you will be required to update your code to utilize the new API. 
You can find more information about this at:  http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.

我从

I've found some advice from mathworks specific to mex but I am not sure whether this can solve my problem. I stopped here since I am not sure if I should follow this answer to delete something.

有什么想法吗?

推荐答案

Glmnet下载中包含的glmnetMex MEX文件在新版本的macOS上看起来像是疯了,因为它是在旧版本的macOS上编译的(

The glmnetMex MEX file included with the Glmnet download looks busticated on newer versions of macOS because it was compiled on a much older version of macOS (OS X 10.8, according to their website), and the DLL library loading mechanism has changed since then. (It should be using @rpath instead of @loader_path.) You will need to rebuild the MEX file yourself, or contact the Glmnet maintainers and ask them to provide a new build.

要重建MEX文件,请执行以下操作:

To rebuild the MEX file:

  1. 使用mex -setup设置Matlab,以使用可以编译Fortran MEX文件的编译器. (我实际上不知道该怎么做.)
  2. 在Matlab中,cdglmnet_matlab目录!rm glmnetMex.mexmaci64,然后运行mex glmnetMex.F
  1. Set up Matlab with mex -setup to use a compiler that can compile Fortran MEX files. (I don't actually know how to do this.)
  2. In Matlab, cd to the glmnet_matlab directory, !rm glmnetMex.mexmaci64, and then run mex glmnetMex.F

我认为这是Glmnet发行版中的错误;我已经将其报告给了Glmnet维护者.

I would consider this a bug in the Glmnet distribution; I have reported it upstream to the Glmnet maintainers.

(我也可以在运行Matlab R2019a的macOS 10.14.6机器上重新下载Glmnet来重现此问题.)

(I can reproduce this issue with a fresh download of Glmnet on my macOS 10.14.6 box running Matlab R2019a, too.)

这是另一个Matlab库的预构建MEX文件的类似问题:

Here's a similar problem with another Matlab library's pre-built MEX file: Library not loaded: @loader_path/libmex.dylib in matlab. Next time try Googling for various parts of your error message; searching for "Library not loaded: @loader_path/libmex.dylib" will pull up that question.

这篇关于Matlab中无效的glmnet Mex文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆