MAT-File Libraries conflicts with existing libraries causing error in CMake

4 views (last 30 days)
I am trying to link libmx.so and libmat.so from Matlab Runtime to my C++ code on Ubuntu 14.04. However, when I specify the library runtime search path to "matlabroot/bin/arch", there exist a copy of "libtbb.so.2 and libtbbmalloc.so.2" at both "matlabroot/bin/arch" and "/usr/lib" but they are different. The error (warnings treat as error) I got from cmake is
Cannot generate a safe runtime search path for target TestExample
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libtbb.so.2] in /usr/lib may be hidden by files in:
/usr/local/MATLAB/MATLAB_Runtime/v85/bin/glnxa64
runtime library [libtbbmalloc.so.2] in /usr/lib may be hidden by files in:
/usr/local/MATLAB/MATLAB_Runtime/v85/bin/glnxa64
Some of these libraries may not be found correctly.
ldd -d /usr/local/MATLAB/MATLAB_Runtime/v85/bin/glnxa64/libtbb.so.2 returns
linux-vdso.so.1 => (0x00007ffc93bb7000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f564bf97000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f564bd79000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f564bb71000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f564b86b000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f564b567000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f564b351000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f564af8c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f564c3e6000)
and ldd -d /usr/lib/libtbb.so.2 returns
linux-vdso.so.1 => (0x00007fff61384000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f65fbeb1000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f65fbbad000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f65fb997000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f65fb5d2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f65fc303000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f65fb2cc000)
so they are different. What is the best way to resolve this?
Perhaps Matlab should provide static libraries (libmx.a and libmat.a) instead of shared libraries?
  1 Comment
Walter Roberson
Walter Roberson on 7 Aug 2015
What aspect of the code you provide needs /usr/lib/libtbb*.so ?
It appears that libtbb* might be related to Threading Building Blocks library

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!