c++ - How to link shared libraries in custom path directly without specifying RPATH? -
i on ubuntu 16.04, , required use external library (mcr). puts of it's shared libraries inside matlab/bin/glnxa64/
folder. need libmx.so in there there libraries in there has exact same name ones in /usr/lib
different (because file size different), example libtiff.so.5
.
this becomes problem because when use find_library
function in cmake add matlab/bin/glnxa64/
rpath in order link libmx.so application, since application depends on external library (opencv) linked libtiff.so.5
in /usr/lib
when built, when compile application shows compilation error of
/usr/lib/libopencv_imgcodecs.so.3.3.0: undefined reference `tiffreaddirectory@libtiff_4.0'
it because application trying link libtiff.so.5
in matlab/bin/glnxa64/
instead of /usr/lib
because rpath has higher priority default directories. best way solve this?
i tried renaming libtiff.so.5
in matlab/bin/glnxa64/
libtiff_old.so.5
. solves ugly.
is there anyway can alternate search priority rpath goes after default directories? or there can in cmake application can directly link libmx.so without having add matlab/bin/glnxa64/
rpath mess things up?
well, first see cmake file, alas..
you can try using this, <...> base directory matlab install, might /usr/local/ or /opt.
find_library (matlab_runtime libmx paths <...>/matlab/bin/glnxa64/ no_default_path )
Comments
Post a Comment