diff --git a/.ci/test.sh b/.ci/test.sh index 7d49d03f56f..6830bebbd97 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -82,7 +82,8 @@ fi conda install -q -y -n $CONDA_ENV matplotlib numpy pandas psutil pytest python-graphviz scikit-learn scipy if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "clang" ]]; then - sudo ln -sf `ls -d "$(brew --cellar libomp)"/*/lib`/* $CONDA_PREFIX/lib || exit -1 # fix "OMP: Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized." (OpenMP library conflict due to conda's MKL) + # fix "OMP: Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized." (OpenMP library conflict due to conda's MKL) + for LIBOMP_ALIAS in libgomp.dylib libiomp5.dylib libomp.dylib; do sudo ln -sf "$(brew --cellar libomp)"/*/lib/libomp.dylib $CONDA_PREFIX/lib/$LIBOMP_ALIAS || exit -1; done fi if [[ $TASK == "sdist" ]]; then diff --git a/docs/FAQ.rst b/docs/FAQ.rst index e8d07cd0858..08db71eead9 100644 --- a/docs/FAQ.rst +++ b/docs/FAQ.rst @@ -139,6 +139,20 @@ LightGBM ln -sf `ls -d "$(brew --cellar libomp)"/*/lib`/* $CONDA_PREFIX/lib + The described above fix worked fine before the release of OpenMP 8.0.0 version. + Starting from 8.0.0 version, Homebrew formula for OpenMP includes ``-DLIBOMP_INSTALL_ALIASES=OFF`` option which leads to that the fix doesn't work anymore. + However, you can create symlinks to library aliases manually: + + :: + + for LIBOMP_ALIAS in libgomp.dylib libiomp5.dylib libomp.dylib; do sudo ln -sf "$(brew --cellar libomp)"/*/lib/libomp.dylib $CONDA_PREFIX/lib/$LIBOMP_ALIAS; done + + Another workaround would be removing MKL optimizations from Conda's packages completely: + + :: + + conda install nomkl + If this is not your case, then you should find conflicting OpenMP library installations on your own and leave only one of them. --------------