-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collection of resources for debugging in Matlab #134
Comments
Even with the new plugin approach, it is still not possible to avoid rebooting Matlab when the plugin library containing the blocks is updated. Here follows some details for future reference. At the end of the simulation, with the Simulink model still open, this is the output of the
... The mex library of the S-Function ( >> version('-modules')
linux-vdso.so.1
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/usr/local/MATLAB/bin/glnxa64/libmwi18n.so 9.4.0.802882 (Feb 6 2018)
/usr/local/MATLAB/bin/glnxa64/libmwmvm.so 9.4.0.802882 (Feb 6 2018)
/usr/local/MATLAB/bin/glnxa64/libmwgraphics_state.so 9.4.0.802882 (Feb 6 2018)
/usr/local/MATLAB/bin/glnxa64/libmwfl.so
[...]
/usr/local/MATLAB/bin/glnxa64/libprotobuf.so.9
/usr/local/MATLAB/bin/glnxa64/libmwslcheck_component_base.so 9.4.0.802882 (Feb 6 2018)
/usr/local/MATLAB/bin/glnxa64/mex_builtin.so 9.4.0.810697 (Feb 19 2018)
/usr/local/MATLAB/bin/glnxa64/libmexcmd.so 9.4.0.810697 (Feb 19 2018)
/iit/sources/robotology-superbuild/build/install/mex/BlockFactory.mexa64
/iit/sources/robotology-superbuild/build/install/lib/libBlockFactoryCore.so.1.0
/iit/sources/robotology-superbuild/build/install/lib/libMxAnyType.so.0.1
/iit/sources/robotology-superbuild/build/install/lib/libshlibpp.so.1
/iit/sources/robotology-superbuild/build/install/lib/libWBToolboxLibrary.so
/iit/sources/robotology-superbuild/build/install/lib/libWBToolboxBase.so
/iit/local/lib/libClockRpc.so
/iit/local/lib/libidyntree-high-level.so
/iit/sources/robotology-superbuild/build/install/lib/libqpOASES.so.3.2
/usr/lib/x86_64-linux-gnu/libmatio.so.4
/iit/local/lib/libidyntree-modelio-urdf.so
/iit/local/lib/libidyntree-modelio-xml.so
/iit/local/lib/libidyntree-sensors.so
/iit/local/lib/libidyntree-model.so
/iit/local/lib/libidyntree-core.so
/iit/local/lib/libYARP_dev.so.3
/iit/local/lib/libYARP_math.so.3
/iit/local/lib/libYARP_init.so.3
/iit/local/lib/libYARP_sig.so.3
/iit/local/lib/libYARP_OS.so.3
/usr/lib/x86_64-linux-gnu/libgsl.so.23
/usr/lib/x86_64-linux-gnu/libgslcblas.so.0
/usr/lib/x86_64-linux-gnu/libhdf5_serial.so.100
/usr/local/MATLAB/bin/glnxa64/libxml2.so.2
/usr/lib/x86_64-linux-gnu/libjpeg.so.8
/usr/lib/x86_64-linux-gnu/libedit.so.2
/usr/lib/x86_64-linux-gnu/libsz.so.2
/lib/x86_64-linux-gnu/libtinfo.so.5
/usr/lib/x86_64-linux-gnu/libaec.so.0 This is confirmed by dferigo@9aed5e6ce8bd:~> lsof -p 9638 | grep ' mem ' | grep iit
MATLAB 9638 dferigo mem REG 259,7 3954296 /iit/local/lib/libYARP_OS.so.3.1.0 (path dev=0,58, inode=5802857)
MATLAB 9638 dferigo mem REG 259,7 3954252 /iit/local/lib/libYARP_sig.so.3.1.0 (path dev=0,58, inode=5802892)
MATLAB 9638 dferigo mem REG 259,7 3954255 /iit/local/lib/libYARP_init.so.3.1.0 (path dev=0,58, inode=5802869)
MATLAB 9638 dferigo mem REG 259,7 3954283 /iit/local/lib/libYARP_math.so.3.1.0 (path dev=0,58, inode=5802874)
MATLAB 9638 dferigo mem REG 259,7 3954231 /iit/local/lib/libYARP_dev.so.3.1.0 (path dev=0,58, inode=5802863)
MATLAB 9638 dferigo mem REG 259,7 3936470 /iit/local/lib/libidyntree-core.so (path dev=0,58, inode=4873178)
MATLAB 9638 dferigo mem REG 259,7 3936872 /iit/local/lib/libidyntree-model.so (path dev=0,58, inode=4873184)
MATLAB 9638 dferigo mem REG 259,7 3936421 /iit/local/lib/libidyntree-sensors.so (path dev=0,58, inode=4873189)
MATLAB 9638 dferigo mem REG 259,7 3940884 /iit/local/lib/libidyntree-modelio-xml.so (path dev=0,58, inode=4873186)
MATLAB 9638 dferigo mem REG 259,7 3936437 /iit/local/lib/libidyntree-modelio-urdf.so (path dev=0,58, inode=4873185)
MATLAB 9638 dferigo mem REG 259,7 4064965 /iit/sources/robotology-superbuild/build/install/lib/libqpOASES.so.3.2 (path dev=0,58)
MATLAB 9638 dferigo mem REG 259,7 3936736 /iit/local/lib/libidyntree-high-level.so (path dev=0,58, inode=4873181)
MATLAB 9638 dferigo mem REG 259,7 3988655 /iit/local/lib/libClockRpc.so (path dev=0,58)
MATLAB 9638 dferigo mem REG 259,7 4064610 /iit/sources/robotology-superbuild/build/install/lib/libWBToolboxBase.so (path dev=0,58)
# Here it is:
MATLAB 9638 dferigo mem REG 259,7 4064618 /iit/sources/robotology-superbuild/build/install/lib/libWBToolboxLibrary.so (path dev=0,58)
MATLAB 9638 dferigo mem REG 259,7 4063376 /iit/sources/robotology-superbuild/build/install/lib/libshlibpp.so.0.0.1 (path dev=0,58)
MATLAB 9638 dferigo mem REG 259,7 4064596 /iit/sources/robotology-superbuild/build/install/lib/libMxAnyType.so.0.1 (path dev=0,58)
MATLAB 9638 dferigo mem REG 259,7 4064054 /iit/sources/robotology-superbuild/build/install/lib/libBlockFactoryCore.so.1.0 (path dev=0,58)
MATLAB 9638 dferigo mem REG 259,7 4196025 /iit/sources/robotology-superbuild/build/install/mex/BlockFactory.mexa64 (path dev=0,58) And:
After updating the plugin on the fsThe
And it disappeared from the process in-memory list:
By executing I am not sure that it is possible to force the reload of the updated plugin at this point without restarting the entire matlab process. Resources: |
Disclaimer: this will be ported sooner or later in the website.
What follows is a problem I wanted to solve since long time, but always postponed for laziness. However, this laziness has the consequence that during development I have to open and close matlab very often.
For some while we have been able during development to reload the
mex
library created from the S-Function without restarting Matlab. @francesco-romano developed thesetupForMatlabDebug.m.in
matlab script for this purpose. In this case, the mex file from the build tree was used instead of the installed one.With wb-toolbox
v3.0
the file was split inlibWBToolbox.so
andWBToolbox.mexa64
. Unfortunately, Matlab is able to reload onlymex
files, not shared library (which are somehow cached). After some investigation it turned out that Matlab supports loading / unloading shared library with the loadlibrary command, but it works only for headers that offer a C interface. Furthermore, it would require to list all the headers of the library, which can be annoying if done manually (probably a solution which involves creating a prototype file with CMake would automate the process).A reasonable solution might be the following:
Any other idea? @traversaro
Other resources:
The text was updated successfully, but these errors were encountered: