Skip to content
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

idyntree and wb-toolbox conda binaries do not work on MATLAB online #653

Closed
traversaro opened this issue Mar 9, 2021 · 4 comments · Fixed by robotology/blockfactory#62
Closed

Comments

@traversaro
Copy link
Member

No description provided.

@traversaro
Copy link
Member Author

If I go to MATLAB Online and execute the following code:

system('curl -LO https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh')
system('sh Miniforge3-Linux-x86_64.sh -b')
system('~/miniforge3/condabin/conda install -c robotology-staging yarp-matlab-bindings idyntree -y')
addpath('~/miniforge3/mex')
vec = iDynTree.Vector3()

This fails with error:

>> vec = iDynTree.Vector3()
Invalid MEX-file '/home/mluser/miniforge3/mex/iDynTreeMEX.mexa64': libMatlabEngine.so: cannot open shared object file: No such file or directory

Error in iDynTree.Vector3 (line 12)
        tmp = iDynTreeMEX(314, varargin{:});

The reason is that modern CMake's FindMatlab matlab_add_mex always links all the available libraries, including the libMatlabEngine.so library that is available in MATLAB, but not in MATLAB Online.

@traversaro
Copy link
Member Author

The problem is also affecting BlockFactory:

system('~/miniforge3/condabin/conda install -c robotology-staging blockfactory -y')
[..]
>> system('ldd ~/miniforge3/mex/BlockFactory.mexa64')
	linux-vdso.so.1 =>  (0x00007ffc6d951000)
	libMatlabEngine.so => not found
	libMatlabDataArray.so => /MATLAB/bin/glnxa64/libMatlabDataArray.so (0x00007f7a25c14000)
	libmex.so => /MATLAB/bin/glnxa64/libmex.so (0x00007f7a25afb000)
	libmx.so => /MATLAB/bin/glnxa64/libmx.so (0x00007f7a257f0000)
	libBlockFactoryCore.so.0.8 => /home/mluser/miniforge3/mex/../lib/libBlockFactoryCore.so.0.8 (0x00007f7a25ac3000)

@traversaro
Copy link
Member Author

yarp-matlab-bindings is not affected as it is using an old vendored FindMatlab CMake that does not search or link to libMatlabEngine.so.

@traversaro
Copy link
Member Author

iDynTree was fixed in robotology/idyntree#840 and the fix was released in 3.0.1, now indeed iDynTree works fine in MATLAB online:
working_idyntree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant