stereolabs / zed-matlab

ZED SDK interface sample for Matlab

Home Page:https://www.stereolabs.com/docs/matlab/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot find dependent shared libraries.

RSKothari opened this issue · comments

Invalid MEX-file '/home/rakshit/zed-matlab/matlab/mexZED.mexa64': Missing dependent shared libraries:
'libsl_core.so' required by
'/usr/local/zed/lib/libsl_calibration.so->/usr/local/zed/lib/libsl_zed.so->/home/rakshit/zed-matlab/matlab/mexZED.mexa64'

I will update this question with more details as I keep hacking at a solution.

Hi, I have similar problems. I think I have successfully created mexZED.mexa64 according to the tutorial. Below are the info shown on my Terminal in Ubuntu 16.04

zeliang@l009:/Gitdocs/Codes/ZEDcam/zed-matlab$ mkdir build
zeliang@l009:
/Gitdocs/Codes/ZEDcam/zed-matlab$ cd build
zeliang@l009:/Gitdocs/Codes/ZEDcam/zed-matlab/build$ cmake ../src
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- MATLAB_ROOT: /usr/local/MATLAB/R2017a
-- Matlab libraries will be used
-- MATLAB Found, MATLAB MEX will be compiled.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CUDA: /usr/local/cuda-9.2 (found suitable exact version "9.2")
-- Found CUDA: /usr/local/cuda-9.2 (found version "9.2")
-- Found OpenCV: /usr/local (found version "3.4.2") found components: core highgui imgproc
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zeliang/Gitdocs/Codes/ZEDcam/zed-matlab/build
zeliang@l009:
/Gitdocs/Codes/ZEDcam/zed-matlab/build$ make
Scanning dependencies of target mexZED
[ 50%] Building CXX object mex/CMakeFiles/mexZED.dir/mexZED.cpp.o
/home/zeliang/Gitdocs/Codes/ZEDcam/zed-matlab/src/mex/mexZED.cpp: In function ‘void mexFunction(int, mxArray**, int, const mxArray**)’:
/home/zeliang/Gitdocs/Codes/ZEDcam/zed-matlab/src/mex/mexZED.cpp:545:37: warning: ‘void sl::Camera::setCameraFPS(int)’ is deprecated [-Wdeprecated-declarations]
zedCam->setCameraFPS(val);
^
In file included from /usr/local/zed/include/sl_core/utils/Core.hpp:63:0,
from /usr/local/zed/include/sl_zed/Camera.hpp:63,
from /usr/local/zed/include/sl/Camera.hpp:1,
from /home/zeliang/Gitdocs/Codes/ZEDcam/zed-matlab/src/mex/mexZED.cpp:24:
/usr/local/zed/include/sl_zed/Camera.hpp:742:60: note: declared here
/@cond SHOWHIDDEN/SL_DEPRECATED(/@endcond/void setCameraFPS(int des
^
/usr/local/zed/include/sl_core/utils/types.hpp:110:29: note: in definition of macro ‘SL_DEPRECATED’
#define SL_DEPRECATED(func) func attribute ((deprecated))
^
[100%] Linking CXX shared library mexZED.mexa64
[100%] Built target mexZED
zeliang@l009:~/Gitdocs/Codes/ZEDcam/zed-matlab/build$ make install
[100%] Built target mexZED
Install the project...
-- Install configuration: ""
-- Installing: /home/zeliang/Gitdocs/Codes/ZEDcam/zed-matlab/src/../matlab/mexZED.mexa64
-- Set runtime path of "/home/zeliang/Gitdocs/Codes/ZEDcam/zed-matlab/src/../matlab/mexZED.mexa64" to ""

It looks Build files have been successfully created, however, when I run either of the MATLAB example code ZED_Camera.m It prompts the following error message

=========SL_ZED_WITH_MATLAB -- Basic=========
Invalid MEX-file '/home/zeliang/Gitdocs/Codes/ZEDcam/zed-matlab/matlab/mexZED.mexa64': Missing dependent
shared libraries:
'libsl_input.so' required by '/home/zeliang/Gitdocs/Codes/ZEDcam/zed-matlab/matlab/mexZED.mexa64'
'libsl_core.so' required by '/home/zeliang/Gitdocs/Codes/ZEDcam/zed-matlab/matlab/mexZED.mexa64'
'libsl_zed.so' required by '/home/zeliang/Gitdocs/Codes/ZEDcam/zed-matlab/matlab/mexZED.mexa64'
...

I can confirm that ZED SDK, CUDA 9.2, OpenCV 3.4.2 are installed and working without any problems on my Linux machine. Also, I can locate these three .so files in the relevant directory

zeliang@l009:~/Gitdocs/Codes/ZEDcam/zed-matlab/build$ cd /usr/local/zed/lib
zeliang@l009:/usr/local/zed/lib$ ls
libsl_core.so libsl_input.so libsl_zed.so

I have been getting stuck with this for a while, but still can't solve the problem. Can anybody help me on this? Thanks!

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days