Universal MEX wrapper
19 Mar 2012
Call any function in a shared library from Matlab (with some limits on the function signature).
function soPath = dl_check(symbol)
%Returns the path of shared library that provides "symbol"
%based on the search order of the current handle.
%The symbol can be defined in the soLib loaded by dl_load
%or in any dependency.
%This function is useful for checking that the intended
%function will be called, particularly when there are two
%versions of the same library in the namespace. (This
%happens often when a shared object depends on an external
%BLAS library, as opposed to Matlab's BLAS.)
%WARNING: This function returns what function ought to run
%under the default glibc search traversal. The MEX libraries
%don't aways respect this. Use LD logging for a debugger
%find out for sure.
soPath = dl_check_mex(SO_HANDLE, symbol);