pip install horovod files he conda + u=10=u 10.14

pip install horovod fails on conda + OSX 10.14

运行 pip install horovod 在安装了 pytorch 的 conda 环境中导致

error: None of TensorFlow, PyTorch, or MXNet plugins were built. See errors above.

stdout 顶部附近的根本问题是

ld: library not found for -lstdc++ clang: error: linker command failed with exit code 1 (use -v to see invocation) INFO: Unable to build PyTorch plugin, will skip it.

CFLAGS=-mmacosx-version-min=10.9 pip install horovod,灵感来自这个看似无关的Horovod issue.

This issue thread from pandas 有一个很好的解释:

The compiler standard library defaults to either libstdc++ or libc++, depending on the targetted macOS version - libstdc++ for 10.8 and below, and libc++ for 10.9 and above. This is determined by the environment variable MACOSX_DEPLOYMENT_TARGET or the compiler option-mmacosx-version-min, defaulting to the system version otherwise.

When distuils builds extensions on macOS, it setsMACOSX_DEPLOYMENT_TARGET to the version that python was compiled with, even if the host system / Xcode is newer.

Recent macOS versions of python have a 64-bit only variant built for 10.9 (python.org), and a universal 64/32-bit variant built for 10.6 (python.org) or 10.7 (conda). I am running the conda universal variant, so distutils targets macOS 10.7, despite my system being 10.14, with Xcode 10 which doesn't install libstdc++.