0. Get gcc with open mp.  Just paste and execute the following command in your terminal, once Homebrew installation is completed.

brew install gcc --without-multilib  
1. xinpingdeMacBook-Pro:anaconda xinpingbao$ git clone --recursive https://github.com/dmlc/xgboost
2. xinpingdeMacBook-Pro:anaconda xinpingbao$ cd ./xgboost
3. Then open make/config.mk and uncomment these two lines

export CC = gcc
export CXX = g++

4. cd xgboost; cp make/minimum.mk ./config.mk; make -j4 注: 可以直接修改config.mk {1. export CC = gcc 去#,export CXX = g++ 去#,

USE_OPENMP = 0

}

5. We then build with the following commands.

cd <directory>/xgboost
cp make/config.mk .
make -j4

6. Once the build is finished, we can use XGBoost with its command line.  I am using Python, hence I performed this final step.  You may need to enter the admin password to execute it.

cd python-package; sudo python setup.py install

在Mac os下安装xgboost

git clone --recursive https://github.com/dmlc/xgboost
cd xgboost; cp make/minimum.mk ./config.mk; make -j4

这是不支持多线程版本的,如果想要支持多线程,那么就要使用如下指令:

brew install gcc --without-multilib

brew相当于在Linux中的yum或者apt-get,可以到这里 下载,也可以使用如下命令:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 

安装brew命令

然后执行命令

git clone --recursive https://github.com/dmlc/xgboost
cd xgboost; cp make/config.mk ./config.mk; make -j4

有时候也会出现错误:

clang: error: : errorunsupported option '-fopenmp'  

可以参考这里 :

首先

ls /usr/local/bin/*

找到其中的gcc g++,然后

将./config.mk中的

$ export CC=/usr/local/bin/gcc-6
$ export CC=/usr/local/bin/g++-6

之后,重新 make -j4即可。

如果是利用python调用,那么还需要

cd python-package; sudo python setup.py install

即可安装完成。

最新文章

  1. Node.js:fs文件系统模块
  2. SQL Server 事务日志传输
  3. Rest Post示例(java服务端、python客户端)
  4. linux学习网站分享
  5. 微信公众平台回复链接可以直接访问,但不能是锚文字链接&lt;a&gt;标签
  6. 亲自动手用HTK实现YES NO孤立词识别
  7. 交通银行 Java Socket 服务启动 管理 WINDOWS 版
  8. Java编程思想学习(十二) 数组和容器
  9. RMQ(log2储存方法)
  10. 用IKVMC将jar转成dll供c#调用
  11. [iOS]为什么不要在init初始化方法里调用self.view
  12. Js实现select联动,option从数据库中读取
  13. An Introduction to Variational Methods (5.3)
  14. 用7ch中断例程完成jmp near ptr s指令的功能,用bx向中断例程传送转移位移。
  15. spring-boot自定义favicon.ico文件
  16. swift 实践- 10 -- UIProgressView
  17. Linux编程学习笔记(二)
  18. 222. Getter与Setter
  19. 洛谷P1516 青蛙的约会(扩展欧几里德)
  20. zookeeper的原理讲解

热门文章

  1. python的一些开源库
  2. cnn(卷积神经网络)比较系统的讲解
  3. shh整合后web.xml、spring配置文件和struts.xml的内容
  4. Dijkstra算法(带路径模板)
  5. 获取设备 ID 和名称
  6. 开学初的c
  7. php小算法总结一(数组重排,进制转换,二分查找)
  8. ffmpeg摄像头采集h264编码RTP发送
  9. 如何在windows7中使用“专用字符编辑器”中的字
  10. PHP文件操作(三)-文件的写入