From 74ffe2d2b6de1d53d63972ddb0cf5d8aa440f2c1 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Sun, 10 Sep 2023 22:30:48 +0200 Subject: [PATCH 1/6] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 8d72a169c..34b22fb81 100644 --- a/README.md +++ b/README.md @@ -319,6 +319,19 @@ and again, specify your MATLAB installation directory and when there is the ques If the problem persists even after following this steps, please [open a new issue in the robotology-superbuild issue tracker](https://github.com/robotology/robotology-superbuild/issues/new). +### How to I solved the "Initializing libomp.dylib, but found libiomp5.dylib already initialized." when using MATLAB libraries? + +If you are on macOS and you encounter errors similar to: +~~~ +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/ +~~~ +when running MATLAB libraries installed by the robotology-superbuild, a simple workaround is to install the netlib version of libblas via: +~~~ +mamba install libblas=*=*netlib +~~~ + +See https://github.com/robotology/idyntree/issues/1109 for more details. From ffeed47d80b840a20f93060369dabc5ec89699ad Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Sun, 10 Sep 2023 22:32:15 +0200 Subject: [PATCH 2/6] Update ci.yml --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cde76384d..951ca17c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,12 @@ jobs: # Additional dependencies only useful on Windows mamba install -c conda-forge -c robotology esdcan freeglut + # Workaround for https://github.com/robotology/idyntree/issues/1109 + - name: Dependencies [Conda/macOS] + if: contains(matrix.os, 'macos') + run: | + mamba install libblas=*=*netlib + - name: Print used environment [Conda] shell: bash -l {0} run: | From afdde4e96fc087c01ccab36cec772b9af2e2c43e Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Sun, 10 Sep 2023 23:36:15 +0200 Subject: [PATCH 3/6] Update ci.yml --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 951ca17c0..cde76384d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,12 +98,6 @@ jobs: # Additional dependencies only useful on Windows mamba install -c conda-forge -c robotology esdcan freeglut - # Workaround for https://github.com/robotology/idyntree/issues/1109 - - name: Dependencies [Conda/macOS] - if: contains(matrix.os, 'macos') - run: | - mamba install libblas=*=*netlib - - name: Print used environment [Conda] shell: bash -l {0} run: | From b35e8a15c73b9982cc1d8fe7b68e9bf3bd54cf2e Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Sun, 10 Sep 2023 23:37:42 +0200 Subject: [PATCH 4/6] Update install_robotology_packages.m --- scripts/install_robotology_packages.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_robotology_packages.m b/scripts/install_robotology_packages.m index ca45c7da7..28b04737a 100644 --- a/scripts/install_robotology_packages.m +++ b/scripts/install_robotology_packages.m @@ -80,7 +80,7 @@ function install_robotology_packages(varargin) % Install all the robotology packages related to MATLAB or Simulink fprintf('Installing robotology packages\n'); - system(sprintf('"%s" install -y -c conda-forge -c robotology yarp-matlab-bindings idyntree-matlab-bindings wb-toolbox osqp-matlab casadi-matlab-bindings whole-body-controllers matlab-whole-body-simulator icub-models', conda_full_path)); + system(sprintf('"%s" install -y -c conda-forge -c robotology yarp-matlab-bindings idyntree-matlab-bindings wb-toolbox osqp-matlab casadi-matlab-bindings whole-body-controllers matlab-whole-body-simulator icub-models libblas=*=*netlib', conda_full_path)); fprintf('Installation of robotology packages completed\n'); fprintf('Creating setup script in %s\n', setup_script); From 842e022ae1ea84c29212bd66733ff7ef19226c95 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Mon, 11 Sep 2023 09:17:03 +0200 Subject: [PATCH 5/6] Update install_robotology_packages.m --- scripts/install_robotology_packages.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/install_robotology_packages.m b/scripts/install_robotology_packages.m index 28b04737a..e83480a23 100644 --- a/scripts/install_robotology_packages.m +++ b/scripts/install_robotology_packages.m @@ -80,7 +80,12 @@ function install_robotology_packages(varargin) % Install all the robotology packages related to MATLAB or Simulink fprintf('Installing robotology packages\n'); - system(sprintf('"%s" install -y -c conda-forge -c robotology yarp-matlab-bindings idyntree-matlab-bindings wb-toolbox osqp-matlab casadi-matlab-bindings whole-body-controllers matlab-whole-body-simulator icub-models libblas=*=*netlib', conda_full_path)); + packages_to_install = 'yarp-matlab-bindings idyntree-matlab-bindings wb-toolbox osqp-matlab casadi-matlab-bindings whole-body-controllers matlab-whole-body-simulator icub-models'; + if ismac + % Workaround for https://github.com/robotology/idyntree/issues/1109 + packages_to_install + " libblas=*=*netlib"; + end + system(sprintf('"%s" install -y -c conda-forge -c robotology %s', conda_full_path, packages_to_install)); fprintf('Installation of robotology packages completed\n'); fprintf('Creating setup script in %s\n', setup_script); From 9bd33af01e7e8be96a80c0b90a620ac60b05d931 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Mon, 11 Sep 2023 09:28:02 +0200 Subject: [PATCH 6/6] Update install_robotology_packages.m --- scripts/install_robotology_packages.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_robotology_packages.m b/scripts/install_robotology_packages.m index e83480a23..95275d0cf 100644 --- a/scripts/install_robotology_packages.m +++ b/scripts/install_robotology_packages.m @@ -83,7 +83,7 @@ function install_robotology_packages(varargin) packages_to_install = 'yarp-matlab-bindings idyntree-matlab-bindings wb-toolbox osqp-matlab casadi-matlab-bindings whole-body-controllers matlab-whole-body-simulator icub-models'; if ismac % Workaround for https://github.com/robotology/idyntree/issues/1109 - packages_to_install + " libblas=*=*netlib"; + packages_to_install = packages_to_install + " libblas=*=*netlib"; end system(sprintf('"%s" install -y -c conda-forge -c robotology %s', conda_full_path, packages_to_install)); fprintf('Installation of robotology packages completed\n');