简体   繁体   中英

Xgboost installation on Mac

I am trying to install xgboost on my mac (10.12.5) and after several attempts I did not succeed. I follow different tuto trying to modifi gcc variable by adding gcc-6 but I have the same problem.

So what I did:

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

I have the following error:

/usr/local/bin/g++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP -MM -MT build/learner.o src/learner.cc >build/learner.d
/usr/local/bin/g++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP -MM -MT build/logging.o src/logging.cc >build/logging.d
/usr/local/bin/g++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP -MM -MT build/c_api/c_api.o src/c_api/c_api.cc >build/c_api/c_api.d
/usr/local/bin/g++ -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP -MM -MT build/c_api/c_api_error.o src/c_api/c_api_error.cc >build/c_api/c_api_error.d
/bin/sh: /usr/local/bin/g++: No such file or directory
/bin/sh: /usr/local/bin/g++: No such file or directory
make: *** [build/learner.o] Error 127
make: *** Waiting for unfinished jobs....
/bin/sh: /usr/local/bin/g++: No such file or directory
make: *** [build/logging.o] Error 127
make: *** [build/c_api/c_api.o] Error 127
/bin/sh: /usr/local/bin/g++: No such file or directory
make: *** [build/c_api/c_api_error.o] Error 127

My gcc version is:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I really need your help. For the moment I use pip install xgboost to use the library but I know it's not the right way to use this library. Thank you for your help

ps: sorry if my english is not ok, i am not fluent

Using Docker images helps the best in such cases since it encapsulates the environment. You can install Docker from here . If you want to work using xgboost library, you can pull image using the following command,

docker pull datmo/xgboost:cpu

After this, you can run containers using this image and mount necessary files in order to run the same environment.

You can also use datmo CLI in order to easily setup environment and also version control your machine learning models.

I was able to install xgboost on my mac by using conda.

Try "conda install py-xgboost". This worked for me.

Try This it worked for

$ brew install gcc-5
$ brew install cmake
$ pip install xgboost

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM