Unverified Commit 76170788 authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[ci][docs] updated fix for OpenMP conflicts (#2166)

* test: AppleClang on Travis

* updated fix for OpenMP multiple instances

* updated docs

* switch compiler back
parent e09e4caa
...@@ -82,7 +82,8 @@ fi ...@@ -82,7 +82,8 @@ fi
conda install -q -y -n $CONDA_ENV matplotlib numpy pandas psutil pytest python-graphviz scikit-learn scipy conda install -q -y -n $CONDA_ENV matplotlib numpy pandas psutil pytest python-graphviz scikit-learn scipy
if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "clang" ]]; then 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 fi
if [[ $TASK == "sdist" ]]; then if [[ $TASK == "sdist" ]]; then
......
...@@ -139,6 +139,20 @@ LightGBM ...@@ -139,6 +139,20 @@ LightGBM
ln -sf `ls -d "$(brew --cellar libomp)"/*/lib`/* $CONDA_PREFIX/lib 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. If this is not your case, then you should find conflicting OpenMP library installations on your own and leave only one of them.
-------------- --------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment