Avoid using the built-in libs
显示 更早的评论
Hello
I've the following problem. I use a library which needs a different lapack version than the built-in matlab lapack (matlab has 3.1, I need 3.3). So I linked against the newer version which I've installed on my system and ldd showed me that the resulting .mexa64 linked correctly against it. But at runtime, the internal matlab lapack is used.
I compiled it with mex test.cpp -L<pathToMyLapack> -llapack and added the path to the LD_LIBRARY_PATH environment before starting matlab.
So my question is, how can I tell matlab to use my lapack and prevent it to use it's internal mllapack? The same problem appears with different versions of boost, std, ....
Regards
Juergen
回答(3 个)
Kaustubha Govind
2011-10-17
0 个投票
Note that MEX files are actually DLLs (with a slightly different extension). AFAIK, the standard behavior on Windows machines is that if the OS finds that the executable (in this case, MATLAB.exe) has already loaded the required DLL (LAPACK or other libraries), then it will attempt to use the one that is already in memory. So I guess the only alternatives are to:
- See if a newer version of MATLAB uses v3.3 and upgrade.
- Force MATLAB itself to use v3.3 (I don't know if this is possible, but you could contact MathWorks Tech Support to see what they recommend).
- Create an executable or some kind of out-of-process server to perform operations that call into your desired versions of libraries, and call into that from your MEX file.
Jan
2011-10-17
0 个投票
Juergen Wiest
2011-10-17
0 个投票
1 个评论
Kaustubha Govind
2011-10-18
Juergen: I'm not sure what kind of issues switching the lapack version would cause. Again, Tech Support may be able to advise better.
类别
在 帮助中心 和 File Exchange 中查找有关 Call C/C++ from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!