码迷,mamicode.com
首页 > 系统相关 > 详细

mac安装lightgbm之两步走战略

时间:2020-03-31 12:09:36      阅读:85      评论:0      收藏:0      [点我收藏+]

标签:inux   参考   fss   blob   file   ace   战略   目录   除了   

技术图片

官方教程:https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#macos

1、mac安装lightgbm之两步走策略(要求编译器:Apple Clang version 8.1 or higher)

(1)安装homebrew

参考:https://brew.sh/index_zh-cn


/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

(2)使用homebrew直接安装


brew install lightgbm

2、mac安装lightgbm之三步走战略(通过gcc构建)

(1)安装homebrew

参考:https://brew.sh/index_zh-cn


/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

(2)安装cmake和gcc


brew install cmake
brew install gcc

(3)使用gcc构建:mac上gcc可能为8.1版本,我们需要将编译器改为gcc-7版本


git clone --recursive https://github.com/microsoft/LightGBM ; cd LightGBM
export CXX=g++-7 CC=gcc-7  # replace "7" with version of gcc installed on your machine
mkdir build ; cd build
cmake ..
make -j4

3、mac安装lightgbm之四步走战略:不考虑gcc

(1)安装homebrew

参考:https://brew.sh/index_zh-cn


/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

(2)安装cmake和OpenMP


brew install cmake

(3)安装OpenMP


brew install libomp

(4)直接使用cmake构建makefile,然后make编译

git clone --recursive https://github.com/microsoft/LightGBM ; cd LightGBM
mkdir build ; cd build
cmake ..
make -j4

4、python中运行lightgbm

参考:https://github.com/microsoft/LightGBM/tree/master/python-package

如果要在python中运行lightgbm,除了上面的三种方法之一外,还需要:


brew install libomp

python -m pip install lightgbm

mac安装lightgbm之两步走战略

标签:inux   参考   fss   blob   file   ace   战略   目录   除了   

原文地址:https://www.cnblogs.com/hugechuanqi/p/12604089.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!