Clear Filters
Clear Filters

Linking issue with Matlab Coder....

3 views (last 30 days)
Arwel on 6 Mar 2018
Answered: Anakin Zheng on 26 Jul 2018
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?
Sumit Ghosh
Sumit Ghosh on 23 Mar 2018
Edited: Sumit Ghosh on 23 Mar 2018
You may try using ldd on the mex file to figure out what .so file is being resolved to. Once you verify that, you can try to put in the same path or put a symlink to
Arwel on 26 Jul 2018
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?

Sign in to comment.

Answers (1)

Anakin Zheng
Anakin Zheng on 26 Jul 2018
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!