From 205881237ebd82f0e19189a962cbc0ee8d1a56ca Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Fri, 31 May 2024 13:39:34 +0200 Subject: [PATCH 1/3] The KMP_DUPLICATE_LIB_OK problem is present also on Windows so document and apply the workaround also on Windows --- doc/faqs.md | 15 +++++++++++++-- scripts/install_robotology_packages.m | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/faqs.md b/doc/faqs.md index b61942265..d4ce66330 100644 --- a/doc/faqs.md +++ b/doc/faqs.md @@ -54,19 +54,30 @@ 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? +### How to I solved the "Initializing libomp.*, 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/ ~~~ + +or you are on Windows if you encounter errors similar to: +~~~ +OMP: Error https://github.com/ami-iit/element_aerodynamics-control/issues/15: Initializing libiomp5md.dll, but found libiomp5md.dll 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://www.intel.com/software/products/support/. +~~~ + when running MATLAB libraries installed by the robotology-superbuild, a simple workaround is to install the netlib version of libblas via: ~~~ conda install libblas=*=*netlib ~~~ -See https://github.com/robotology/idyntree/issues/1109 for more details. +See https://github.com/robotology/idyntree/issues/1109 for more details. The [One-line Installation of Robotology MATLAB/Simulink Packages](./matlab-one-line-install.md) installs `libblas=*=*netlib` to mitigate this problem. ### I want to install packages from the `robotology` conda channel that were built in 2021 but I am not finding them, where I can find them? diff --git a/scripts/install_robotology_packages.m b/scripts/install_robotology_packages.m index 66283cb25..0e8ee8f9f 100644 --- a/scripts/install_robotology_packages.m +++ b/scripts/install_robotology_packages.m @@ -81,7 +81,7 @@ function install_robotology_packages(varargin) % Install all the robotology packages related to MATLAB or Simulink fprintf('Installing robotology packages\n'); 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 + if ismac or ispc % Workaround for https://github.com/robotology/idyntree/issues/1109 packages_to_install = packages_to_install + " libblas=*=*netlib"; end From e02490cd42a6f3ca6cb3a7af731d75a8c6944d55 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Fri, 31 May 2024 13:42:07 +0200 Subject: [PATCH 2/3] Fix markdown typo --- doc/faqs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/faqs.md b/doc/faqs.md index d4ce66330..4badce475 100644 --- a/doc/faqs.md +++ b/doc/faqs.md @@ -54,7 +54,7 @@ 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.*, but found libiomp5.*dylib* already initialized." when using MATLAB libraries? +### How to I solved the "Initializing libomp.\*, but found libiomp5.\* already initialized." when using MATLAB libraries? If you are on macOS and you encounter errors similar to: ~~~ From 166273869a9e2b258016a148f289064370921ad8 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 4 Jun 2024 08:07:39 -0400 Subject: [PATCH 3/3] 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 0e8ee8f9f..53dd662d4 100644 --- a/scripts/install_robotology_packages.m +++ b/scripts/install_robotology_packages.m @@ -81,7 +81,7 @@ function install_robotology_packages(varargin) % Install all the robotology packages related to MATLAB or Simulink fprintf('Installing robotology packages\n'); 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 or ispc + if ismac | ispc % Workaround for https://github.com/robotology/idyntree/issues/1109 packages_to_install = packages_to_install + " libblas=*=*netlib"; end