Linking issue with Matlab Coder....
이전 댓글 표시
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';
coder.updateBuildInfo('addLinkObjects','libmultinest.so',linkPath,libPriority,libPreCompiled,libLinkOnly);
coder.updateBuildInfo('addLinkObjects','libmultinest.so.3.10',linkPath,libPriority,libPreCompiled,libLinkOnly);
coder.ceval('mainRoutine',0,[]);
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': libmultinest.so.3.10: cannot open shared object file: No such file or directory.
I have verified that both 'libmultinest.so' and 'libmultinest.so.3.10' 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
Sumit Ghosh
2018년 3월 23일
편집: Sumit Ghosh
2018년 3월 23일
You may try using ldd on the mex file to figure out what .so file libmultinest.so is being resolved to. Once you verify that, you can try to put libmultinest.so.3.10 in the same path or put a symlink to libmultinest.so.3.10.
Arwel
2018년 7월 26일
답변 (1개)
Anakin Zheng
2018년 7월 26일
0 개 추천
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?
Anakin
카테고리
도움말 센터 및 File Exchange에서 MATLAB Coder에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!