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

Configuring error in a docker image with Matlab 2020b #86

Closed
diegoferigo opened this issue May 26, 2022 · 1 comment · Fixed by #87
Closed

Configuring error in a docker image with Matlab 2020b #86

diegoferigo opened this issue May 26, 2022 · 1 comment · Fixed by #87
Assignees

Comments

@diegoferigo
Copy link
Member

I'm trying to compile the robotology-superbuild in a docker image based on ubuntu:focal that contains (an inactive version of) Matlab similarly to the official Mathworks images located at https://hub.docker.com/r/mathworks/matlab.

The compilation of this projects fails with the following error:

[213/272] Performing configure step for 'yarp-matlab-bindings'
FAILED: src/yarp-matlab-bindings/CMakeFiles/YCMStamp/yarp-matlab-bindings-configure /home/matlab/isaac/robotology-superbuild/build/src/yarp-matlab-bindings/CMakeFiles/YCMStamp/yarp-matlab-bindings-configure 
cd /home/matlab/isaac/robotology-superbuild/build/src/yarp-matlab-bindings && /usr/bin/cmake --no-warn-unused-cli -DCMAKE_PREFIX_PATH:PATH=/home/matlab/isaac/robotology-superbuild/build/install -DYARP_USES_MATLAB:BOOL=ON -DYARP_USES_OCTAVE:BOOL=OFF -C/home/matlab/isaac/robotology-superbuild/build/src/yarp-matlab-bindings/CMakeFiles/YCMTmp/yarp-matlab-bindings-cache-Release.cmake -GNinja /home/matlab/isaac/robotology-superbuild/src/yarp-matlab-bindings && /usr/bin/cmake -E touch /home/matlab/isaac/robotology-superbuild/build/src/yarp-matlab-bindings/CMakeFiles/YCMStamp/yarp-matlab-bindings-configure
Not searching for unused variables given on the command line.
loading initial cache file /home/matlab/isaac/robotology-superbuild/build/src/yarp-matlab-bindings/CMakeFiles/YCMTmp/yarp-matlab-bindings-cache-Release.cmake
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found YARP: /home/matlab/isaac/robotology-superbuild/build/install/lib/cmake/YARP (found version "3.5.1")
CMake Deprecation Warning at /home/matlab/isaac/robotology-superbuild/build/install/lib/cmake/YARP/YARPConfig.cmake:223 (message):
  The YARP_INCLUDE_DIRS variable is deprecated
Call Stack (most recent call first):
  CMakeLists.txt:9223372036854775807 (_yarp_deprecated_variable_warning)
  CMakeLists.txt:29 (get_target_property)


-- Found YCM: /home/matlab/isaac/robotology-superbuild/build/install/share/cmake/YCM (found version "0.13.0")
CMake Deprecation Warning at /home/matlab/isaac/robotology-superbuild/build/install/lib/cmake/YARP/YARPConfig.cmake:223 (message):
  The YARP_INCLUDE_DIRS variable is deprecated
Call Stack (most recent call first):
  CMakeLists.txt:9223372036854775807 (_yarp_deprecated_variable_warning)
  CMakeLists.txt:42 (include_directories)


CMake Error at cmake/FindMatlab.cmake:1033 (list):
  list GET given empty list
Call Stack (most recent call first):
  cmake/FindMatlab.cmake:1239 (_Matlab_get_version_from_root)
  matlab/CMakeLists.txt:105 (find_package)


-- Found Matlab: /opt/matlab/extern/include (found version "NOTFOUND") found components: MX_LIBRARY 
CMake Deprecation Warning at /home/matlab/isaac/robotology-superbuild/build/install/share/YCM/modules/InstallBasicPackageFiles.cmake:304 (message):
  TARGETS is deprecated.  Use EXPORT instead
Call Stack (most recent call first):
  matlab/CMakeLists.txt:177 (install_basic_package_files)


CMake Deprecation Warning at /home/matlab/isaac/robotology-superbuild/build/install/share/YCM/modules/InstallBasicPackageFiles.cmake:375 (message):
  Compatibility variables are no longer generated.  Use
  ENABLE_COMPATIBILITY_VARS to re-enable them (deprecated) or define them
  using either INCLUDE_FILE or INCLUDE_CONTENT (recommended).
Call Stack (most recent call first):
  matlab/CMakeLists.txt:177 (install_basic_package_files)


-- Configuring incomplete, errors occurred!

The call stack tells me that the problem's origin is this line of the vendored FindMatlab.cmake file:

list(GET matlab_list_of_all_versions 0 _matlab_version_tmp)

that is called here:

_Matlab_get_version_from_root(
"${Matlab_ROOT_DIR}"
${Matlab_VERSION_STRING}
Matlab_VERSION_STRING
)

For reasons, I'm using an old v3.5.0 tag from last summer. At first, I thought it could be caused by missing version mappings introduced later in #81 for my Matlab version. However, even after adding them, the problem in the docker image did not get solved.

Since it was quite old, I tried to update the vendored version of the file to the latest release, and the compilation inside docker got fixed. @traversaro do you prefer I open a PR to update this file? I don't think I have enough time to understand what's wrong in the current version of FindMatlab.cmake.

@traversaro
Copy link
Member

Since it was quite old, I tried to update the vendored version of the file to the latest release, and the compilation inside docker got fixed. @traversaro do you prefer I open a PR to update this file? I don't think I have enough time to understand what's wrong in the current version of FindMatlab.cmake.

Ok to update FindMATLAB, the important thing is to use a version after https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7139 (so current master is fine, but not latest release). As soon as CMake 3.24 is released we can drop all the vendored FindMatlab modules around (see robotology/robotology-superbuild#1044).

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

Successfully merging a pull request may close this issue.

2 participants