zoukankan      html  css  js  c++  java
  • Installing XGBoost on Mac OSX

     
    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

    即可安装完成。

  • 相关阅读:
    Silverlight 4版本升级到4.0.60531.0
    Silverlight实例教程 理解Navigation导航框架Page类
    微软官方在线培训课程汇总2011版
    分享Silverlight/WPF/Windows Phone一周学习导读(07月11日07月17日)
    Linux内核简介
    Brief Summary of IaaS, PaaS, SaaS
    On Amazon EC2's Underlying Architecture
    Linux进程管理(2)
    一个诡异的时间问题追查[转]
    查看一个进程打开了哪些文件的命令
  • 原文地址:https://www.cnblogs.com/xinping-study/p/7053784.html
Copyright © 2011-2022 走看看