cmake 在MacOS上安装LightGBM时出现错误:“找不到OpenMP_C”

mklgxw1f  于 2022-11-24  发布在  Mac
关注(0)|答案(1)|浏览(266)

在Mac OS上安装LightGBM时,我收到以下错误:

CMake Error at /usr/local/Cellar/cmake/3.12.4/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
Call Stack (most recent call first): 
  /usr/local/Cellar/cmake/3.12.4/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.12.4/share/cmake/Modules/FindOpenMP.cmake:466 (find_package_handle_standard_args)
  CMakeLists.txt:82 (find_package)

我正在遵循官方手册,错误出现在cmake ..步骤:

如果你能帮助我的话,谢谢你的帮助。

watbbzwu

watbbzwu1#

Darts安装指南中的解决方案对我很有效。您需要降级libomp库:

wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
brew unlink libomp
brew install libomp.rb

相关问题