Linking issue with Matlab Coder....

조회 수: 3(최근 30일)
Arwel 2018년 3월 6일
답변: Anakin Zheng 2018년 7월 26일
Hi, I am trying to link to some existing precompiled libraries using Matlab Coder. Within my code I have the following.....
libPriority = '';
libPreCompiled = true;
libLinkOnly = true;
linkPath = '/home/arwel/Documents/coding/multinestEdits/eggboxOnly/MultiNest_v3.10_eggboxOnly/multinest_eggboxOnly/lib';
When i try to make the mex in Coder, it fails during the testing of the generated mex. However it will still make the mex.
If I try to run it I get the following error message...
>> multinestCaller_mex() Invalid MEX-file '<.......>/multinestTests/multinestCaller_mex.mexa64': cannot open shared object file: No such file or directory.
I have verified that both '' and '' are in the same directory. Why is it that it seems to find one library and not the other, given that they are both in the same place?
  댓글 수: 2
Arwel 2018년 7월 26일
Okay, I've returned to this now after a while away from it. Running ldd gives me the following... => (0x00007ffdcc6dc000) => not found => not found => not found => /lib64/ (0x00007fe95ca22000) => /lib64/ (0x00007fe95c719000) => not found
/usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95c38c000) => not found => not found => not found => not found => /lib64/ (0x00007fe95c174000) => /lib64/ (0x00007fe95bf58000) => /lib64/ (0x00007fe95bb94000)
/lib64/ (0x00005587bff37000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95b992000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95b668000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95b3a9000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95aff8000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95adf1000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95abe0000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95a9ca000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95a6ec000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95a3dc000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95a1c6000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe959fc2000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe959da1000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe959b83000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95819d000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe957e06000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95798c000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe95777e000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe957533000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe9572e1000) => /lib64/ (0x00007fe9570ca000) => /lib64/ (0x00007fe956ec6000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe956c9d000) => /lib64/ (0x00007fe956a95000) => /lib64/ (0x00007fe95685d000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe9565fd000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe9563de000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe956172000) => /usr/local/MATLAB/R2016b/bin/glnxa64/ (0x00007fe955d8f000) => /lib64/ (0x00007fe955b8b000)
So it's not finding the multinest library, but also a bunch of other (mex?) libraries. What should I do to remedy this?

댓글을 달려면 로그인하십시오.


Anakin Zheng
Anakin Zheng 2018년 7월 26일
Hi Arwel,
Can you check whether '/home/arwel/Documents/coding/multinestEdits/eggboxOnly/MultiNest_v3.10_eggboxOnly/multinest_eggboxOnly/lib' is on your LD_LIBRARY_PATH?


Find more on MATLAB Coder in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by