robotology / idyntree

Multibody Dynamics Library designed for Free Floating Robots
BSD 3-Clause "New" or "Revised" License
155 stars 65 forks source link

MATLAB bindings crash on macOS with R2023a #1109

Closed traversaro closed 10 months ago

traversaro commented 10 months ago

Since ~3 days ago, MATLAB R2023a jobs started failing with error:

62: Test command: /Applications/MATLAB_R2023a/MATLAB_R2023a.app/bin/matlab "-nodisplay" "-nodesktop" "-nojvm" "-batch" "addpath('/Users/runner/work/idyntree/idyntree/build/lib');addpath('/Users/runner/work/idyntree/idyntree/bindings/matlab/autogenerated');addpath('/Users/runner/work/idyntree/idyntree/bindings/matlab');addpath('/Users/runner/work/idyntree/idyntree/bindings/matlab/tests/');addpath(genpath('/Users/runner/work/idyntree/idyntree/extern/MOxUnit/MOxUnit'));success=moxunit_runtests('/Users/runner/work/idyntree/idyntree/bindings/matlab/tests','-verbose');exit(~success);"
62: Working Directory: /Users/runner/work/idyntree/idyntree/build/bindings/matlab/tests
62: Test timeout computed to be: 1500
62: 
62:     Sponsored License -- for use in support of a program or activity sponsored by MathWorks.
62:     Not for government, commercial or other non-sponsored organizational use.
62: 
62: OMP: Error #15: Initializing libomp.dylib, but found libiomp5.dylib already initialized.
62: OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://openmp.llvm.org/
62: 
62: MATLAB is exiting because of fatal error
Errors while running CTest
1/1 Test #62: matlab_idyntree_tests ............Subprocess killed***Exception:  22.94 sec

    Sponsored License -- for use in support of a program or activity sponsored by MathWorks.
    Not for government, commercial or other non-sponsored organizational use.

OMP: Error #15: Initializing libomp.dylib, but found libiomp5.dylib already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://openmp.llvm.org/

MATLAB is exiting because of fatal error

Last successful job: https://github.com/robotology/idyntree/actions/runs/6068285176/job/16461022969 . First failing job: https://github.com/robotology/idyntree/actions/runs/6091882043/job/16529117827 .

traversaro commented 10 months ago

Change in deps:

--- <unnamed>
+++ <unnamed>
@@ -31,7 +31,7 @@
 krb5                      1.21.2               hb884880_0    conda-forge
 ld64                      609                 ha91a046_14    conda-forge
 ld64_osx-64               609                 h0fd476b_14    conda-forge
-libblas                   3.9.0           17_osx64_openblas    conda-forge
+libblas                   3.9.0           18_osx64_openblas    conda-forge
 libclang-cpp15            15.0.7          default_hdb78580_3    conda-forge
 libcurl                   8.2.1                h5f667d7_0    conda-forge
 libcxx                    16.0.6               hd57cbcb_0    conda-forge
@@ -43,10 +43,10 @@
 libgfortran5              12.3.0               hbd3c1fe_1    conda-forge
 libiconv                  1.17                 hac89ed1_0    conda-forge
 libjpeg-turbo             2.1.5.1              hb7f2c08_0    conda-forge
-liblapack                 3.9.0           17_osx64_openblas    conda-forge
+liblapack                 3.9.0           18_osx64_openblas    conda-forge
 libllvm15                 15.0.7               he4b1e75_3    conda-forge
 libnghttp2                1.52.0               he2ab024_0    conda-forge
-libopenblas               0.3.23          openmp_h429af6e_0    conda-forge
+libopenblas               0.3.24          openmp_h48a4ad5_0    conda-forge
 libosqp                   0.6.3                he965462_0    conda-forge
 libpng                    1.6.39               ha978bb4_0    conda-forge
 libqdldl                  0.1.5                hf0c8a7f_1    conda-forge
traversaro commented 10 months ago

Forcing the installation of openblas 0.3.23 fixes the problem: https://github.com/robotology/idyntree/pull/1110 .

traversaro commented 10 months ago

An easy workaround is to use netlib's libblas instead of the default one (openblas).