Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion and troubleshooting on PyPI (pip) installation (the newest 0.6 version) #1446

Closed
phunterlau opened this issue Aug 9, 2016 · 43 comments

Comments

@phunterlau
Copy link
Contributor

After some good tries (#1445), the PyPI xgboost installation is updated to the most recent code https://pypi.python.org/pypi/xgboost/ and Mac/Linux users can install it via pip install xgboost. I recommend using Anaconda or Miniconda python release for easier dependency resolution on numpy scipy and scikit-learn, and update pip (setuptools) to the most recent version.

Before typing pip install xgboost and happy waiting, please follow the instruction on the PyPI page as copied here:

  • Since this package contains C++ source code, pip needs a C++ compiler from the system to compile the source code on-the-fly. Please follow the following instruction for each supported platform.
  • Note for Mac OS X users: please install gcc from brew by brew tap homebrew/versions; brew install gcc --without-multilib firstly.
  • Note for Linux users: please install gcc by sudo apt-get install build-essential firstly or using the corresponding package manager of the system.
  • Note for windows users: this pip installation may not work on some windows environment, and it may cause unexpected errors. pip installation on windows is currently disabled for further investigation, please install from Github.

If everything is fine, after hearing CPU fan noise for couple of minutes (it is compiling on the fly), one should see something like this:
screen shot 2016-08-09 at 2 59 16 am

This package is tested with Mac OS X 10.10, ubuntu 14/16 and CentOS 7 with no problem. Please report any issues or installation difficulties here, with detailed information. For having the debug output, please use pip install -v xgboost. Thanks.

@byronliwei
Copy link

1、gcc-6.1.0_1 already installed
2、Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/n2/q3c3s28n7ybbmt2glbsb4s5h0000gn/T/pip-build-Yu8pqZ/xgboost

@hemoely
Copy link

hemoely commented Aug 10, 2016

  1. CentOS Linux release 7.0.1406 (Core)(x64)
  2. Linux version 3.10.0-123.8.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) 2.0 version, lots of changes #1 SMP Mon Sep 22 19:06:58 UTC 2014
  3. Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-DzjokQ/xgboost/

@phunterlau
Copy link
Contributor Author

@hemoely can you provide the full log somewhere, e.g. dropbox? P.S. you have g++ too, right?
@byronliwei what is your system, Ubuntu, Mac or CentOS? also, can you provide the full log somewhere, e.g. dropbox?

@byronliwei
Copy link

Mac ,,thank you

Collecting xgboost
Using cached xgboost-0.6a2.tar.gz
Complete output from command python setup.py egg_info:
rm -f -rf build build_plugin lib bin _~ */_~ //_~ *///_~ /.o //.o *///.o xgboost
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
/bin/sh: clang-omp++: command not found
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
make: *** [build/learner.o] Error 127
make: *** Waiting for unfinished jobs....
/bin/sh: clang-omp++: command not found
make: *** [build/logging.o] Error 127
-----------------------------
Building multi-thread xgboost failed
Start to build single-thread xgboost
rm -f -rf build build_plugin lib bin _~ */_~ //_~ *///_~ /.o //.o *///.o xgboost
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
/bin/sh: clang-omp++: command not found
make: *** [build/learner.o] Error 127
make: *** Waiting for unfinished jobs....
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
/bin/sh: clang-omp++: command not found
make: *** [build/logging.o] Error 127
Successfully build single-thread xgboost
If you want multi-threaded version
See additional instructions in doc/build.md
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/n2/q3c3s28n7ybbmt2glbsb4s5h0000gn/T/pip-build-_5FFp6/xgboost/setup.py", line 29, in
LIB_PATH = libpath'find_lib_path'
File "/private/var/folders/n2/q3c3s28n7ybbmt2glbsb4s5h0000gn/T/pip-build-_5FFp6/xgboost/xgboost/libpath.py", line 45, in find_lib_path
'List of candidates:\n' + ('\n'.join(dll_path)))
builtin.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
List of candidates:
/private/var/folders/n2/q3c3s28n7ybbmt2glbsb4s5h0000gn/T/pip-build-_5FFp6/xgboost/xgboost/libxgboost.so
/private/var/folders/n2/q3c3s28n7ybbmt2glbsb4s5h0000gn/T/pip-build-_5FFp6/xgboost/xgboost/../../lib/libxgboost.so
/private/var/folders/n2/q3c3s28n7ybbmt2glbsb4s5h0000gn/T/pip-build-_5FFp6/xgboost/xgboost/./lib/libxgboost.so

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/n2/q3c3s28n7ybbmt2glbsb4s5h0000gn/T/pip-build-_5FFp6/xgboost/

@phunterlau
Copy link
Contributor Author

@byronliwei seems like you don't have either gcc-5 or clang-omp, so the compiling fails. Please install either one from brew.

@garyci
Copy link

garyci commented Aug 11, 2016

@byronliwei brew install clang-omp

@rashmibanthia
Copy link

rashmibanthia commented Aug 13, 2016

I am hoping this is the right place for the following problem: (If not please let me know where to post this)
I have OSX El Capitan 10.11.5, Anaconda Python 3.5.
I have done install and uninstall multiple times with brew install gcc --without-multilib
brew installs gcc6 and xgboost needs gcc5. Here’s the exact error I am getting:

Python 3.5.2 |Anaconda 4.1.1 (x86_64)| (default, Jul  2 2016, 17:52:12) 
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import xgboost
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "//anaconda/lib/python3.5/site-packages/xgboost/__init__.py", line 11, in <module>
    from .core import DMatrix, Booster
  File "//anaconda/lib/python3.5/site-packages/xgboost/core.py", line 112, in <module>
    _LIB = _load_lib()
  File "//anaconda/lib/python3.5/site-packages/xgboost/core.py", line 106, in _load_lib
    lib = ctypes.cdll.LoadLibrary(lib_path[0])
  File "//anaconda/lib/python3.5/ctypes/__init__.py", line 425, in LoadLibrary
    return self._dlltype(name)
  File "//anaconda/lib/python3.5/ctypes/__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(//anaconda/lib/python3.5/site-packages/xgboost/./lib/libxgboost.so, 6): Library not loaded: /usr/local/opt/gcc/lib/gcc/5/libgomp.1.dylib
  Referenced from: //anaconda/lib/python3.5/site-packages/xgboost/./lib/libxgboost.so
  Reason: image not found

Any help really appreciated. Thank you!

@phunterlau
Copy link
Contributor Author

Makefile in Mac now requires gcc-5, maybe we should just ask gcc-6?

@GradientBoostingGPA
Copy link

GradientBoostingGPA commented Aug 14, 2016

Hi,

I got the following error when I tried to install xgboost.
Do you know why I got the following eroor?
I am using Mac and I have run "brew tap homebrew/versions; brew install gcc --without-multilib"
Thanks in advance!

Collecting xgboost
  1 location(s) to search for versions of xgboost:
  * https://pypi.python.org/simple/xgboost/
  Getting page https://pypi.python.org/simple/xgboost/
  Looking up "https://pypi.python.org/simple/xgboost/" in the cache
  Current age based on date: 39
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  The response is "fresh", returning cached response
  600 > 39
  Analyzing links from page https://pypi.python.org/simple/xgboost/
    Found link https://pypi.python.org/packages/16/ac/dd16a3206de8658a5e0076174941ae642ee10c958c53a35a7500993ca936/xgboost-0.4a15.tar.gz#md5=bcab760af5ac7f20e88bde7426423565 (from https://pypi.python.org/simple/xgboost/), version: 0.4a15
    Found link https://pypi.python.org/packages/20/95/c089ee1be6574ed8167f0bfbd5f78c1adc7b1403ba3977d5ae98003882af/xgboost-0.4a22.tar.gz#md5=cb858cf85fe9f4263e9b523c4900c3f9 (from https://pypi.python.org/simple/xgboost/), version: 0.4a22
    Found link https://pypi.python.org/packages/21/5c/a221a2ea13ee14acd1ddc59e213fc788ebd2e7550249adbb12934367aa58/xgboost-0.4a28.tar.gz#md5=fd8ffedd172b5cb917483df76e6efe7a (from https://pypi.python.org/simple/xgboost/), version: 0.4a28
    Found link https://pypi.python.org/packages/34/85/456a1a8c762f646671043e446a59efbce02b5f408f522c4ef8793e860c5e/xgboost-0.6a2.tar.gz#md5=c486211efa29b95771c74f5d8701ca4a (from https://pypi.python.org/simple/xgboost/), version: 0.6a2
    Found link https://pypi.python.org/packages/4a/cc/9556005199e9f550c97bc1e81bff64431c952a9968f78651ba48b9687243/xgboost-0.4a26.tar.gz#md5=e5b1f7c477e5238e7b491153449b33b2 (from https://pypi.python.org/simple/xgboost/), version: 0.4a26
    Found link https://pypi.python.org/packages/4f/70/a236e5170ab7f72cf49554400d841a2046d7c712e2cf6524a435612469a4/xgboost-0.4a25.tar.gz#md5=bf3d633fa88ae7923794dd5da0600388 (from https://pypi.python.org/simple/xgboost/), version: 0.4a25
    Found link https://pypi.python.org/packages/58/85/94517fb4933fbc66c87df3f0166c48e421b1d3d082d8d0b29960f4e3b643/xgboost-0.4a30.tar.gz#md5=5f4e812ba3a1faa85514993e56c1b4b8 (from https://pypi.python.org/simple/xgboost/), version: 0.4a30
    Found link https://pypi.python.org/packages/65/4e/05d8fe3dd568cf57fe76edb3018d2a7d8bc57611b8fef6dd2e4cfb6c794a/xgboost-0.4a12.tar.gz#md5=4d768e034a28590497bb79279f036946 (from https://pypi.python.org/simple/xgboost/), version: 0.4a12
    Found link https://pypi.python.org/packages/6c/d7/b7e5027c95f1bd6676062af56bfbd53eee567f8384a4aa582330360a3989/xgboost-0.4a14.tar.gz#md5=a7c648933a47ae31f869b5c030c17c69 (from https://pypi.python.org/simple/xgboost/), version: 0.4a14
    Found link https://pypi.python.org/packages/71/aa/206c86bc4be36832f8c73491d972a6c1bcdcd2717f1fb04d0bad0c61ae35/xgboost-0.4a23.tar.gz#md5=4f8a17ca86995ed51fc1a424618b94db (from https://pypi.python.org/simple/xgboost/), version: 0.4a23
    Found link https://pypi.python.org/packages/7a/b4/fa38771ebd221dd83aa37864157daebb7d8446fd6c3614dc6f56932f9643/xgboost-0.4a19.tar.gz#md5=413d55d0534447e77064dbd1ad1ccb48 (from https://pypi.python.org/simple/xgboost/), version: 0.4a19
    Found link https://pypi.python.org/packages/7e/16/d47c4ba06a5b4d364a7323013e040f3f21d50db2b50cfc962bad674b873f/xgboost-0.4a29.tar.gz#md5=4bf4eb1898cfc28bbd3b43e19c69fdf5 (from https://pypi.python.org/simple/xgboost/), version: 0.4a29
    Found link https://pypi.python.org/packages/7f/36/e55ba853acc85d7ebaddec498c72c768bb2700415c5a2ea967a0b8dc8957/xgboost-0.6a1.tar.gz#md5=be2b2f4c6f439960da3f495da39b45e2 (from https://pypi.python.org/simple/xgboost/), version: 0.6a1
    Found link https://pypi.python.org/packages/92/37/d7b963a6b307941e86758bd3330d62ace0c83eaf60fbacf8486a6e8d72da/xgboost-0.4a21.tar.gz#md5=45284beb53f5087e73dcf55ff1c5a026 (from https://pypi.python.org/simple/xgboost/), version: 0.4a21
    Found link https://pypi.python.org/packages/97/7b/344e3b849bb041dca7c6cab66be8007f64cdceebcb41cda9f1e10bc651d9/xgboost-0.4a13.tar.gz#md5=5f53d51e4305c679192b3cabda2b0dbe (from https://pypi.python.org/simple/xgboost/), version: 0.4a13
    Found link https://pypi.python.org/packages/b3/ec/110721470306e8c9199c46217cfff5c32ad1e7e8a2dabefa2603d79b32bc/xgboost-0.4a18.tar.gz#md5=9f70ca05843afb1d50522530f140d640 (from https://pypi.python.org/simple/xgboost/), version: 0.4a18
    Found link https://pypi.python.org/packages/ca/58/2c3265f4824a8c3a33784e7236adb7808d3c647cfe962045fcc53d10d570/xgboost-0.4a24.tar.gz#md5=2bf0edfe62ddb3502c4f48df3428a7e0 (from https://pypi.python.org/simple/xgboost/), version: 0.4a24
    Found link https://pypi.python.org/packages/cd/4d/9a9341759aa32358b794db9e21cd0825e9107e2fc7a641e285eb1b0b69b8/xgboost-0.4a20.tar.gz#md5=88721733e7c7026fa2e95de7165d4b86 (from https://pypi.python.org/simple/xgboost/), version: 0.4a20
    Found link https://pypi.python.org/packages/ec/c1/93d27b079b5edd76bc93d6cefcf82e667942bb576a5f764742401febe161/xgboost-0.4a27.tar.gz#md5=cd091569f651c3c625c4a299cfc72e74 (from https://pypi.python.org/simple/xgboost/), version: 0.4a27
  Using version 0.6a2 (newest of versions: 0.4a12, 0.4a13, 0.4a14, 0.4a15, 0.4a18, 0.4a19, 0.4a20, 0.4a21, 0.4a22, 0.4a23, 0.4a24, 0.4a25, 0.4a26, 0.4a27, 0.4a28, 0.4a29, 0.4a30, 0.6a1, 0.6a2)
  Looking up "https://pypi.python.org/packages/34/85/456a1a8c762f646671043e446a59efbce02b5f408f522c4ef8793e860c5e/xgboost-0.6a2.tar.gz" in the cache
  Current age based on date: 12635
  Freshness lifetime from max-age: 31557600
  The response is "fresh", returning cached response
  31557600 > 12635
  Using cached xgboost-0.6a2.tar.gz
  Downloading from URL https://pypi.python.org/packages/34/85/456a1a8c762f646671043e446a59efbce02b5f408f522c4ef8793e860c5e/xgboost-0.6a2.tar.gz#md5=c486211efa29b95771c74f5d8701ca4a (from https://pypi.python.org/simple/xgboost/)
  Running setup.py (path:/private/var/folders/qb/g_6lvtb15_b_60g185fxj5v40000gn/T/pip-build-dzdymwlh/xgboost/setup.py) egg_info for package xgboost
    Running command python setup.py egg_info
    rm -f -rf build build_plugin lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o xgboost
    clang-omp++ -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude   -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
    /bin/sh: clang-omp++: command not found
    clang-omp++ -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude   -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
    make: *** [build/learner.o] Error 127
    make: *** Waiting for unfinished jobs....
    /bin/sh: clang-omp++: command not found
    make: *** [build/logging.o] Error 127
    -----------------------------
    Building multi-thread xgboost failed
    Start to build single-thread xgboost
    rm -f -rf build build_plugin lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o xgboost
    clang-omp++ -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude   -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
    /bin/sh: clang-omp++: command not found
    make: *** [build/learner.o] Error 127
    make: *** Waiting for unfinished jobs....
    clang-omp++ -std=c++0x -Wall -O3 -msse2  -Wno-unknown-pragmas -funroll-loops -Iinclude   -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
    /bin/sh: clang-omp++: command not found
    make: *** [build/logging.o] Error 127
    Successfully build single-thread xgboost
    If you want multi-threaded version
    See additional instructions in doc/build.md
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/qb/g_6lvtb15_b_60g185fxj5v40000gn/T/pip-build-dzdymwlh/xgboost/setup.py", line 29, in <module>
        LIB_PATH = libpath['find_lib_path']()
      File "/private/var/folders/qb/g_6lvtb15_b_60g185fxj5v40000gn/T/pip-build-dzdymwlh/xgboost/xgboost/libpath.py", line 45, in find_lib_path
        'List of candidates:\n' + ('\n'.join(dll_path)))
    XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
    List of candidates:
    /private/var/folders/qb/g_6lvtb15_b_60g185fxj5v40000gn/T/pip-build-dzdymwlh/xgboost/xgboost/libxgboost.so
    /private/var/folders/qb/g_6lvtb15_b_60g185fxj5v40000gn/T/pip-build-dzdymwlh/xgboost/xgboost/../../lib/libxgboost.so
    /private/var/folders/qb/g_6lvtb15_b_60g185fxj5v40000gn/T/pip-build-dzdymwlh/xgboost/xgboost/./lib/libxgboost.so
Cleaning up...
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/qb/g_6lvtb15_b_60g185fxj5v40000gn/T/pip-build-dzdymwlh/xgboost/
Exception information:
Traceback (most recent call last):
  File "//anaconda/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "//anaconda/lib/python3.5/site-packages/pip/commands/install.py", line 310, in run
    wb.build(autobuilding=True)
  File "//anaconda/lib/python3.5/site-packages/pip/wheel.py", line 750, in build
    self.requirement_set.prepare_files(self.finder)
  File "//anaconda/lib/python3.5/site-packages/pip/req/req_set.py", line 370, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "//anaconda/lib/python3.5/site-packages/pip/req/req_set.py", line 601, in _prepare_file
    abstract_dist.prep_for_dist()
  File "//anaconda/lib/python3.5/site-packages/pip/req/req_set.py", line 127, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "//anaconda/lib/python3.5/site-packages/pip/req/req_install.py", line 425, in run_egg_info
    command_desc='python setup.py egg_info')
  File "//anaconda/lib/python3.5/site-packages/pip/utils/__init__.py", line 718, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/qb/g_6lvtb15_b_60g185fxj5v40000gn/T/pip-build-dzdymwlh/xgboost/

@phunterlau
Copy link
Contributor Author

@liuxu1104 please install either gcc-5 or clang-omp from brew. the error log shows you have neither of these compilers.

@phunterlau
Copy link
Contributor Author

phunterlau commented Aug 14, 2016

@liuxu1104 seems like you have gcc-6 instead of gcc-5. maybe we should just require gcc-6 or clang-omp for Mac in PyPI, and discard gcc-5? Meanwhile, you can always install from github, and edit make/config.mk by changing the CC and CXX to your compilers.

@rashmibanthia
Copy link

@phunterlau Thank you ! I build it on OS X (El Capitan 10.11.5, Anaconda Python 3.5) and it worked. Also installed gcc5 brew install gcc5 --without-multilib (There were few notes and warning, but I can import xgboost from python)

@GradientBoostingGPA
Copy link

@phunterlau Solved!
Thank you!

@davechallis
Copy link
Contributor

It's worth noting that clang-omp was removed from brew (Homebrew/homebrew-core@c57e307), so anyone on updated OS X + homebrew will get a 'not found' error.

@phunterlau
Copy link
Contributor Author

@davechallis so, should we just remove clang-omp support for future?

@davechallis
Copy link
Contributor

@phunterlau it looks like the opemmp functionality is available in current versions of LLVM, so using that instead should work (but I can't test it on older versions of Mac OS X easily, so not sure if homebrew has the same channels/software available for them).

I.e. brew install llvm provides /usr/local/opt/llvm/bin/clang and /usr/local/opt/llvm/bin/clang++, both of which support the -fopenmp flag.

Changing xgboost to then use these compilers (or gcc-6) on mac os x worked for me.

@rayquazasnow
Copy link

rayquazasnow commented Oct 29, 2016

I've already installed gcc-6, but still cannot install xgboost with the error below,
so I follow your advice to install clang-omp from brew but it still failed.
pip install xgboost
Collecting xgboost
Using cached xgboost-0.6a2.tar.gz
Complete output from command python setup.py egg_info: rm -f -rf build build_plugin lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o xgboost clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
/bin/sh: clang-omp++: command not found
make: *** [build/learner.o] Error 127
make: *** Waiting for unfinished jobs....
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
/bin/sh: clang-omp++: command not found
make: *** [build/logging.o] Error 127
-----------------------------
Building multi-thread xgboost failed
Start to build single-thread xgboost
rm -f -rf build build_plugin lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o xgboost
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
/bin/sh: clang-omp++: command not found
make: *** [build/learner.o] Error 127
make: *** Waiting for unfinished jobs....
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
/bin/sh: clang-omp++: command not found
make: *** [build/logging.o] Error 127
Successfully build single-thread xgboost
If you want multi-threaded version
See additional instructions in doc/build.md
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-TbS11L/xgboost/setup.py", line 29, in <module>
LIB_PATH = libpath['find_lib_path']()
File "/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-TbS11L/xgboost/xgboost/libpath.py", line 45, in find_lib_path
'List of candidates:\n' + ('\n'.join(dll_path)))
__builtin__.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
List of candidates:
/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-TbS11L/xgboost/xgboost/libxgboost.so
/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-TbS11L/xgboost/xgboost/../../lib/libxgboost.so
/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-TbS11L/xgboost/xgboost/./lib/libxgboost.so
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-TbS11L/xgboost/

Then I install clang-omp instead but still failed. The code is attached below

$ brew install clang-omp
Error: No available formula with the name "clang-omp"
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: undefined method []' for nil:NilClass Please report this bug: https://git.io/brew-troubleshooting /usr/local/Library/Homebrew/vendor/okjson.rb:202:ineat'
/usr/local/Library/Homebrew/vendor/okjson.rb:165:in pairparse' /usr/local/Library/Homebrew/vendor/okjson.rb:148:inblock in objparse'
/usr/local/Library/Homebrew/vendor/okjson.rb:145:in loop' /usr/local/Library/Homebrew/vendor/okjson.rb:145:inobjparse'
/usr/local/Library/Homebrew/vendor/okjson.rb:119:in valparse' /usr/local/Library/Homebrew/vendor/okjson.rb:191:inblock in arrparse'
/usr/local/Library/Homebrew/vendor/okjson.rb:188:in loop' /usr/local/Library/Homebrew/vendor/okjson.rb:188:inarrparse'
/usr/local/Library/Homebrew/vendor/okjson.rb:120:in valparse' /usr/local/Library/Homebrew/vendor/okjson.rb:166:inpairparse'
/usr/local/Library/Homebrew/vendor/okjson.rb:148:in block in objparse' /usr/local/Library/Homebrew/vendor/okjson.rb:145:inloop'
/usr/local/Library/Homebrew/vendor/okjson.rb:145:in objparse' /usr/local/Library/Homebrew/vendor/okjson.rb:102:intextparse'
/usr/local/Library/Homebrew/vendor/okjson.rb:46:in decode' /usr/local/Library/Homebrew/utils/json.rb:10:inload'
/usr/local/Library/Homebrew/utils/github.rb:176:in open' /usr/local/Library/Homebrew/cmd/search.rb:133:inblock in search_tap'
/usr/local/Library/Homebrew/cmd/search.rb:151:in yield' /usr/local/Library/Homebrew/cmd/search.rb:151:insearch_tap'
/usr/local/Library/Homebrew/cmd/search.rb:117:in block (2 levels) in search_taps'

What should I do next? Please help. Thanks!

@phunterlau
Copy link
Contributor Author

@rayquazasnow seems like you have gcc-6 while the current pip install xgboost requires either gcc-5 or clang-omp++ since brew provided gcc-5 at that time. Meanwhile, you can install from github, or brew install --with-clang llvm for having clang++ . I will find a stable version and update PyPI to gcc-6 along with other fixes.

@rayquazasnow
Copy link

rayquazasnow commented Oct 29, 2016

@phunterlau thanks for your advice. I successfully installed llvm by brew install --with-clang llvm. However, pip install xgboost still can not work(the same error code shown above). Should I uninstall gcc-6 and install gcc-5 instead?

brew install gcc --without-multilib
Error: gcc-6.1.0_1 already installed
To install this version, first 'brew unlink gcc'

@phunterlau
Copy link
Contributor Author

@rayquazasnow please post the new error message from pip before downgrade gcc. Or, install from github.

@rayquazasnow
Copy link

rayquazasnow commented Oct 30, 2016

@phunterlau Here is the new error after I install llvm. Still with the message "/bin/sh: clang-omp++: command not found"

$ pip install xgboost
Collecting xgboost
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/xgboost/
Using cached xgboost-0.6a2.tar.gz
Complete output from command python setup.py egg_info:
rm -f -rf build build_plugin lib bin _~ */_~ //_~ *///_~ /.o //.o *///.o xgboost
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
/bin/sh: clang-omp++: command not found
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
make: *** [build/learner.o] Error 127
make: *** Waiting for unfinished jobs....
/bin/sh: clang-omp++: command not found
make: *** [build/logging.o] Error 127
-----------------------------
Building multi-thread xgboost failed
Start to build single-thread xgboost
rm -f -rf build build_plugin lib bin _~ */_~ //_~ *///_~ /.o //.o *///.o xgboost
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
/bin/sh: clang-omp++: command not found
make: *** [build/learner.o] Error 127
make: *** Waiting for unfinished jobs....
clang-omp++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
/bin/sh: clang-omp++: command not found
make: *** [build/logging.o] Error 127
Successfully build single-thread xgboost
If you want multi-threaded version
See additional instructions in doc/build.md
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-cEIF0a/xgboost/setup.py", line 29, in
LIB_PATH = libpath'find_lib_path'
File "/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-cEIF0a/xgboost/xgboost/libpath.py", line 45, in find_lib_path
'List of candidates:\n' + ('\n'.join(dll_path)))
builtin.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
List of candidates:
/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-cEIF0a/xgboost/xgboost/libxgboost.so
/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-cEIF0a/xgboost/xgboost/../../lib/libxgboost.so
/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-cEIF0a/xgboost/xgboost/./lib/libxgboost.so

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-cEIF0a/xgboost/

After I update homebrew, the output of error code is shown below
$ pip install xgboost
Collecting xgboost
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x103c91b90>: Failed to establish a new connection: [Errno 65] No route to host',)': /simple/xgboost/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x103c91310>: Failed to establish a new connection: [Errno 65] No route to host',)': /simple/xgboost/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x103c91590>: Failed to establish a new connection: [Errno 65] No route to host',)': /simple/xgboost/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x103c91b10>: Failed to establish a new connection: [Errno 65] No route to host',)': /simple/xgboost/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x103c91190>: Failed to establish a new connection: [Errno 65] No route to host',)': /simple/xgboost/
Could not find a version that satisfies the requirement xgboost (from versions: )
No matching distribution found for xgboost

@phunterlau
Copy link
Contributor Author

@rayquazasnow can you try which clang-omp++ and see the result? It should be something like this or the installation didn't work:

$ which clang-omp++
/usr/local/bin/clang-omp++

@rayquazasnow
Copy link

rayquazasnow commented Nov 1, 2016

@phunterlau there is no response with which clang-omp++. It seems like the installation didn't work.
$ brew install --with-clang llvm
/usr/local/bin/brew: line 28: /usr/local/Library/Homebrew/brew.sh: No such file or directory
$ brew install clang++
/usr/local/bin/brew: line 28: /usr/local/Library/Homebrew/brew.sh: No such file or directory

$ which clang
/usr/bin/clang
$ which llvm
$ which clang++
/usr/bin/clang++

@phunterlau
Copy link
Contributor Author

@rayquazasnow you might want to install or re-install brew firstly, seems like your brew installation was broken.

@benman1
Copy link

benman1 commented Nov 10, 2016

I did brew install gcc6 --without-multilib. That got it rolling.

@AbdealiLoKo
Copy link
Contributor

I didn't quite get why clang-omp or gcc is needed in Mac.
The log says that the single threaded version has been built, but it still can't find the library.

It says:

Successfully build single-thread xgboost
If you want multi-threaded version
See additional instructions in doc/build.md

but finally gives:

__builtin__.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
List of candidates:
/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-cEIF0a/xgboost/xgboost/libxgboost.so
/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-cEIF0a/xgboost/xgboost/../../lib/libxgboost.so
/private/var/folders/m3/yqpf5xhs1rxbzyh_hz4lhx040000gn/T/pip-build-cEIF0a/xgboost/xgboost/./lib/libxgboost.so

So, as I see it the issue is something else. It should be installing xgboost with the single threaded version.

I can install xgboost from git without gcc nor clang-omp++ ... using just the bash build.sh

@phunterlau
Copy link
Contributor Author

@AbdealiJK if there is no gcc or clang-omp, the script would call the default clang from Xcode which only supports single thread and loses the advantage of XGBoost parallelization.

@AbdealiLoKo
Copy link
Contributor

@phunterlau while I completely agree with that, I don't see why the installation failure happens. I don't understand why the error would be:

builtin.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?

@AbdealiLoKo
Copy link
Contributor

@phunterlau I was checking the pypi package to understand the problem and found that the way of calling make without openmp was invalid (and it always used -fopenmp). And that the default gcc/g++ was never an option.

Modifying it with these diffs worked for me:

--- a/xgboost-0.6a2/xgboost/Makefile
+++ b/xgboost-0.6a2_modified/xgboost/Makefile
@@ -43,8 +43,8 @@ endif
 # it is useful for pip install compiling-on-the-fly
 OS := $(shell uname)
 ifeq ($(OS), Darwin)
-export CC = $(if $(shell which gcc-5),gcc-5,clang-omp)
-export CXX = $(if $(shell which g++-5),g++-5,clang-omp++)
+export CC = $(if $(shell which gcc-5),gcc-5,$(if $(shell which clang-omp),clang-omp,gcc))
+export CXX = $(if $(shell which g++-5),g++-5,$(if $(shell which clang-omp++),clang-omp++,g++))
 endif


--- a/xgboost-0.6a2/xgboost/build-python.sh
+++ b/xgboost-0.6a2_modified/xgboost/build-python.sh
@@ -22,7 +22,7 @@ else
     echo "Building multi-thread xgboost failed"
     echo "Start to build single-thread xgboost"
     make clean
-    make lib/libxgboost.so -j4 no_omp=1
+    make lib/libxgboost.so -j4 config=make/minimum.mk
     echo "Successfully build single-thread xgboost"
     echo "If you want multi-threaded version"
     echo "See additional instructions in doc/build.md"

 export LDFLAGS= -pthread -lm $(ADD_LDFLAGS) $(DMLC_LDFLAGS) $(PLUGIN_LDFLAGS)

@phunterlau
Copy link
Contributor Author

@AbdealiJK Thanks. PyPI 's makefile was quick-n-dirty way and it didn't consider all scenarios . Would you like to send a PR for updating this?

@AbdealiLoKo
Copy link
Contributor

Would love to, but I'm not sure what to modify - because the github build.sh and Makefile uses the correct versions.

The pypi package seems to have a different structure and different files than github (maybe they just need to be updated?)

@phunterlau
Copy link
Contributor Author

@AbdealiJK oh, now I remember it: PyPI version was a little bit outdated, it was created before the Makefile fix. Let me update it. Thanks.

@xgdgsc
Copy link
Contributor

xgdgsc commented Dec 3, 2016

Would you consider uploading official prebuild wheel packages to pypi? It would make windows and mac users installation easier. Now windows users can get unofficial builds at http://www.lfd.uci.edu/~gohlke/pythonlibs/#xgboost

@phunterlau
Copy link
Contributor Author

@xgdgsc precompiled package is good. Is the Windows precompiled package made by you or someone that you know? can you add the recipe to the official guideline so other people can start using it? I have seen much pain on this issue list when installing windows version. As to precompiled PyPI build for Mac/Linux, we have to separate them since PyPI doesn't tell difference between platforms. Definitely a good idea, in short.

@xgdgsc
Copy link
Contributor

xgdgsc commented Dec 9, 2016

That package is not made by me or anyone I know, but that page is famous among windows python users. I would suggest uploading precompiled packages to pypi just like what I do here. Pip would automatically select the right wheel package when user install. This way we just add the warning of installing the VC redistribution packages if loading the prebuilt binary failed. Another option is to use conda-forge to build the packages for anaconda users.

@kishore432
Copy link

I am trying to install xgboost and below is the result.

[root@hostname bdinstalldir]# pip2.7 install xgboost
Downloading/unpacking xgboost
Could not find a version that satisfies the requirement xgboost (from versions: 0.4a15, 0.4a22, 0.4a28, 0.6a2, 0.4a26, 0.4a25, 0.4a30, 0.4a12, 0.4a14, 0.4a23, 0.4a19, 0.4a29, 0.6a1, 0.4a21, 0.4a13, 0.4a18, 0.4a24, 0.4a20, 0.4a27)
Cleaning up...
No distributions matching the version for xgboost
Storing debug log for failure in /root/.pip/pip.log
[root@hostname bdinstalldir]#

Checked for gcc and we have following gcc's on node.

[root@hostname bdinstalldir]# rpm -qa | grep -i gcc
gcc-4.4.7-17.el6.x86_64
libgcc-4.4.7-17.el6.x86_64
compat-gcc-34-c++-3.4.6-19.el6.x86_64
gcc-gnat-4.4.7-17.el6.x86_64
compat-gcc-34-3.4.6-19.el6.x86_64
libgcc-4.4.7-17.el6.i686
gcc-java-4.4.7-17.el6.x86_64
devtoolset-3-gcc-c++-4.9.1-10.el6.x86_64
gcc-c++-4.4.7-17.el6.x86_64
gcc-gfortran-4.4.7-17.el6.x86_64
gcc-objc++-4.4.7-17.el6.x86_64
devtoolset-3-gcc-4.9.1-10.el6.x86_64
gcc-objc-4.4.7-17.el6.x86_64

[root@hostname site-packages]# print xgboost.file
-bash: print: command not found
[root@hostname site-packages]#

Tried with --pre option and it didn't work as shown below.

[root@hostname bdinstalldir]# pip2.7 install --pre xgboost
Downloading/unpacking xgboost
Downloading xgboost-0.6a2.tar.gz (1.2MB): 1.2MB downloaded
Running setup.py (path:/tmp/pip_build_root/xgboost/setup.py) egg_info for package xgboost
rm -f -rf build build_plugin lib bin *~ /~ //*~ ///~ /.o //.o ///.o xgboost
g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/c_api/c_api.o src/c_api/c_api.cc >build/c_api/c_api.d
g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/c_api/c_api_error.o src/c_api/c_api_error.cc >build/c_api/c_api_error.d
g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/c_api/c_api_error.cc -o build/c_api/c_api_error.o
g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/logging.cc -o build/logging.o
g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/c_api/c_api.cc -o build/c_api/c_api.o
g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/learner.cc -o build/learner.o
In file included from src/c_api/./c_api_error.h:9,
from src/c_api/c_api_error.cc:6:
dmlc-core/include/dmlc/base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled
In file included from include/xgboost/data.h:10,
from src/c_api/c_api.cc:3:
dmlc-core/include/dmlc/base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled
In file included from dmlc-core/include/dmlc/logging.h:15,
from include/xgboost/logging.h:11,
from src/learner.cc:7:
dmlc-core/include/dmlc/./base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled
In file included from dmlc-core/include/dmlc/logging.h:15,
from include/xgboost/logging.h:11,
from src/logging.cc:7:
dmlc-core/include/dmlc/./base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled
In file included from src/c_api/c_api_error.cc:7:
src/c_api/../common/thread_local.h: In static member function ‘static T
xgboost::common::ThreadLocalStore::Get()’:
src/c_api/../common/thread_local.h:44: error: ‘nullptr’ was not declared in this scope
make: *** [build/c_api/c_api_error.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from src/c_api/c_api.cc:3:
include/xgboost/data.h: In constructor ‘xgboost::DMatrix::DMatrix()’:
include/xgboost/data.h:234: error: ‘nullptr’ was not declared in this scope
In file included from src/c_api/c_api.cc:15:
src/c_api/../data/simple_csr_source.h: At global scope:
src/c_api/../data/simple_csr_source.h:65: error: expected ‘;’ before ‘override’
src/c_api/../data/simple_csr_source.h:67: error: expected ‘;’ before ‘override’
src/c_api/../data/simple_csr_source.h:69: error: expected ‘;’ before ‘override’
In file included from src/c_api/c_api.cc:16:
src/c_api/../common/thread_local.h: In static member function ‘static T* xgboost::common::ThreadLocalStore::Get()’:
src/c_api/../common/thread_local.h:44: error: ‘nullptr’ was not declared in this scope
In file included from include/xgboost/./gbm.h:17,
from include/xgboost/learner.h:16,
from src/learner.cc:8:
include/xgboost/././data.h: In constructor ‘xgboost::DMatrix::DMatrix()’:
include/xgboost/././data.h:234: error: ‘nullptr’ was not declared in this scope
In file included from src/c_api/c_api.cc:18:
src/c_api/../common/io.h: At global scope:
src/c_api/../common/io.h:30: error: expected ‘;’ before ‘override’
src/c_api/c_api.cc:267: error: expected ‘;’ before end of line
src/c_api/c_api.cc:267: error: expected ‘}’ before end of line
In file included from src/c_api/c_api.cc:18:
src/c_api/../common/io.h: In constructor ‘xgboost::common::PeekableInStream::PeekableInStream(dmlc::Stream*)’:
src/c_api/../common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘strm_’
src/c_api/../common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘buffer_ptr_’
src/c_api/c_api.cc: At global scope:
src/c_api/c_api.cc:267: error: expected unqualified-id before end of line
src/c_api/c_api.cc:267: error: expected ‘}’ before end of line
src/c_api/c_api.cc:267: error: expected ‘}’ before end of line
src/c_api/c_api.cc:267: error: expected declaration before end of line
In file included from src/learner.cc:17:
src/./common/io.h: At global scope:
src/./common/io.h:30: error: expected ‘;’ before ‘override’
src/learner.cc:484: error: expected ‘;’ before end of line
src/learner.cc:484: error: expected ‘}’ before end of line
In file included from src/learner.cc:17:
src/./common/io.h: In constructor ‘xgboost::common::PeekableInStream::PeekableInStream(dmlc::Stream*)’:
src/./common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘strm_’
src/./common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘buffer_ptr_’
src/learner.cc: At global scope:
src/learner.cc:484: error: expected unqualified-id before end of line
src/learner.cc:484: error: expected ‘}’ before end of line
src/learner.cc:484: error: expected ‘}’ before end of line
src/learner.cc:484: error: expected declaration before end of line
make: *** [build/c_api/c_api.o] Error 1
make: *** [build/learner.o] Error 1
-----------------------------
Building multi-thread xgboost failed
Start to build single-thread xgboost
rm -f -rf build build_plugin lib bin *~ /~ //*~ ///~ /.o //.o ///.o xgboost
g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/c_api/c_api.o src/c_api/c_api.cc >build/c_api/c_api.d
g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/c_api/c_api_error.o src/c_api/c_api_error.cc >build/c_api/c_api_error.d
g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/c_api/c_api_error.cc -o build/c_api/c_api_error.o
g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/learner.cc -o build/learner.o
g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/c_api/c_api.cc -o build/c_api/c_api.o
g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/logging.cc -o build/logging.o
In file included from src/c_api/./c_api_error.h:9,
from src/c_api/c_api_error.cc:6:
dmlc-core/include/dmlc/base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled
In file included from include/xgboost/data.h:10,
from src/c_api/c_api.cc:3:
dmlc-core/include/dmlc/base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled
In file included from dmlc-core/include/dmlc/logging.h:15,
from include/xgboost/logging.h:11,
from src/logging.cc:7:
dmlc-core/include/dmlc/./base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled
In file included from dmlc-core/include/dmlc/logging.h:15,
from include/xgboost/logging.h:11,
from src/learner.cc:7:
dmlc-core/include/dmlc/./base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled
In file included from src/c_api/c_api_error.cc:7:
src/c_api/../common/thread_local.h: In static member function ‘static T
xgboost::common::ThreadLocalStore::Get()’:
src/c_api/../common/thread_local.h:44: error: ‘nullptr’ was not declared in this scope
make: *** [build/c_api/c_api_error.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from include/xgboost/./gbm.h:17,
from include/xgboost/learner.h:16,
from src/learner.cc:8:
include/xgboost/././data.h: In constructor ‘xgboost::DMatrix::DMatrix()’:
include/xgboost/././data.h:234: error: ‘nullptr’ was not declared in this scope
In file included from src/c_api/c_api.cc:3:
include/xgboost/data.h: In constructor ‘xgboost::DMatrix::DMatrix()’:
include/xgboost/data.h:234: error: ‘nullptr’ was not declared in this scope
In file included from src/learner.cc:17:
src/./common/io.h: At global scope:
src/./common/io.h:30: error: expected ‘;’ before ‘override’
src/learner.cc:484: error: expected ‘;’ before end of line
src/learner.cc:484: error: expected ‘}’ before end of line
In file included from src/learner.cc:17:
src/./common/io.h: In constructor ‘xgboost::common::PeekableInStream::PeekableInStream(dmlc::Stream*)’:
src/./common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘strm_’
src/./common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘buffer_ptr_’
src/learner.cc: At global scope:
src/learner.cc:484: error: expected unqualified-id before end of line
src/learner.cc:484: error: expected ‘}’ before end of line
src/learner.cc:484: error: expected ‘}’ before end of line
src/learner.cc:484: error: expected declaration before end of line
In file included from src/c_api/c_api.cc:15:
src/c_api/../data/simple_csr_source.h: At global scope:
src/c_api/../data/simple_csr_source.h:65: error: expected ‘;’ before ‘override’
src/c_api/../data/simple_csr_source.h:67: error: expected ‘;’ before ‘override’
src/c_api/../data/simple_csr_source.h:69: error: expected ‘;’ before ‘override’
In file included from src/c_api/c_api.cc:16:
src/c_api/../common/thread_local.h: In static member function ‘static T* xgboost::common::ThreadLocalStore::Get()’:
src/c_api/../common/thread_local.h:44: error: ‘nullptr’ was not declared in this scope
In file included from src/c_api/c_api.cc:18:
src/c_api/../common/io.h: At global scope:
src/c_api/../common/io.h:30: error: expected ‘;’ before ‘override’
src/c_api/c_api.cc:267: error: expected ‘;’ before end of line
src/c_api/c_api.cc:267: error: expected ‘}’ before end of line
In file included from src/c_api/c_api.cc:18:
src/c_api/../common/io.h: In constructor ‘xgboost::common::PeekableInStream::PeekableInStream(dmlc::Stream*)’:
src/c_api/../common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘strm_’
src/c_api/../common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘buffer_ptr_’
src/c_api/c_api.cc: At global scope:
src/c_api/c_api.cc:267: error: expected unqualified-id before end of line
src/c_api/c_api.cc:267: error: expected ‘}’ before end of line
src/c_api/c_api.cc:267: error: expected ‘}’ before end of line
src/c_api/c_api.cc:267: error: expected declaration before end of line
make: *** [build/learner.o] Error 1
make: *** [build/c_api/c_api.o] Error 1
Successfully build single-thread xgboost
If you want multi-threaded version
See additional instructions in doc/build.md
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/xgboost/setup.py", line 29, in
LIB_PATH = libpath'find_lib_path'
File "/tmp/pip_build_root/xgboost/xgboost/libpath.py", line 45, in find_lib_path
'List of candidates:\n' + ('\n'.join(dll_path)))
builtin.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
List of candidates:
/tmp/pip_build_root/xgboost/xgboost/libxgboost.so
/tmp/pip_build_root/xgboost/xgboost/../../lib/libxgboost.so
/tmp/pip_build_root/xgboost/xgboost/./lib/libxgboost.so
Complete output from command python setup.py egg_info:
rm -f -rf build build_plugin lib bin *~ /~ //*~ ///~ /.o //.o ///*.o xgboost

g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d

g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d

g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/c_api/c_api.o src/c_api/c_api.cc >build/c_api/c_api.d

g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/c_api/c_api_error.o src/c_api/c_api_error.cc >build/c_api/c_api_error.d

g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/c_api/c_api_error.cc -o build/c_api/c_api_error.o

g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/logging.cc -o build/logging.o

g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/c_api/c_api.cc -o build/c_api/c_api.o

g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/learner.cc -o build/learner.o

In file included from src/c_api/./c_api_error.h:9,

             from src/c_api/c_api_error.cc:6:

dmlc-core/include/dmlc/base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled

In file included from include/xgboost/data.h:10,

             from src/c_api/c_api.cc:3:

dmlc-core/include/dmlc/base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled

In file included from dmlc-core/include/dmlc/logging.h:15,

             from include/xgboost/logging.h:11,

             from src/learner.cc:7:

dmlc-core/include/dmlc/./base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled

In file included from dmlc-core/include/dmlc/logging.h:15,

             from include/xgboost/logging.h:11,

             from src/logging.cc:7:

dmlc-core/include/dmlc/./base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled

In file included from src/c_api/c_api_error.cc:7:

src/c_api/../common/thread_local.h: In static member function ‘static T* xgboost::common::ThreadLocalStore::Get()’:

src/c_api/../common/thread_local.h:44: error: ‘nullptr’ was not declared in this scope

make: *** [build/c_api/c_api_error.o] Error 1

make: *** Waiting for unfinished jobs....

In file included from src/c_api/c_api.cc:3:

include/xgboost/data.h: In constructor ‘xgboost::DMatrix::DMatrix()’:

include/xgboost/data.h:234: error: ‘nullptr’ was not declared in this scope

In file included from src/c_api/c_api.cc:15:

src/c_api/../data/simple_csr_source.h: At global scope:

src/c_api/../data/simple_csr_source.h:65: error: expected ‘;’ before ‘override’

src/c_api/../data/simple_csr_source.h:67: error: expected ‘;’ before ‘override’

src/c_api/../data/simple_csr_source.h:69: error: expected ‘;’ before ‘override’

In file included from src/c_api/c_api.cc:16:

src/c_api/../common/thread_local.h: In static member function ‘static T* xgboost::common::ThreadLocalStore::Get()’:

src/c_api/../common/thread_local.h:44: error: ‘nullptr’ was not declared in this scope

In file included from include/xgboost/./gbm.h:17,

             from include/xgboost/learner.h:16,

             from src/learner.cc:8:

include/xgboost/././data.h: In constructor ‘xgboost::DMatrix::DMatrix()’:

include/xgboost/././data.h:234: error: ‘nullptr’ was not declared in this scope

In file included from src/c_api/c_api.cc:18:

src/c_api/../common/io.h: At global scope:

src/c_api/../common/io.h:30: error: expected ‘;’ before ‘override’

src/c_api/c_api.cc:267: error: expected ‘;’ before end of line

src/c_api/c_api.cc:267: error: expected ‘}’ before end of line

In file included from src/c_api/c_api.cc:18:

src/c_api/../common/io.h: In constructor ‘xgboost::common::PeekableInStream::PeekableInStream(dmlc::Stream*)’:

src/c_api/../common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘strm_’

src/c_api/../common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘buffer_ptr_’

src/c_api/c_api.cc: At global scope:

src/c_api/c_api.cc:267: error: expected unqualified-id before end of line

src/c_api/c_api.cc:267: error: expected ‘}’ before end of line

src/c_api/c_api.cc:267: error: expected ‘}’ before end of line

src/c_api/c_api.cc:267: error: expected declaration before end of line

In file included from src/learner.cc:17:

src/./common/io.h: At global scope:

src/./common/io.h:30: error: expected ‘;’ before ‘override’

src/learner.cc:484: error: expected ‘;’ before end of line

src/learner.cc:484: error: expected ‘}’ before end of line

In file included from src/learner.cc:17:

src/./common/io.h: In constructor ‘xgboost::common::PeekableInStream::PeekableInStream(dmlc::Stream*)’:

src/./common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘strm_’

src/./common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘buffer_ptr_’

src/learner.cc: At global scope:

src/learner.cc:484: error: expected unqualified-id before end of line

src/learner.cc:484: error: expected ‘}’ before end of line

src/learner.cc:484: error: expected ‘}’ before end of line

src/learner.cc:484: error: expected declaration before end of line

make: *** [build/c_api/c_api.o] Error 1

make: *** [build/learner.o] Error 1


Building multi-thread xgboost failed

Start to build single-thread xgboost

rm -f -rf build build_plugin lib bin *~ /~ //*~ ///~ /.o //.o ///*.o xgboost

g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d

g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d

g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/c_api/c_api.o src/c_api/c_api.cc >build/c_api/c_api.d

g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/c_api/c_api_error.o src/c_api/c_api_error.cc >build/c_api/c_api_error.d

g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/c_api/c_api_error.cc -o build/c_api/c_api_error.o

g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/learner.cc -o build/learner.o

g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/c_api/c_api.cc -o build/c_api/c_api.o

g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -c src/logging.cc -o build/logging.o

In file included from src/c_api/./c_api_error.h:9,

             from src/c_api/c_api_error.cc:6:

dmlc-core/include/dmlc/base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled

In file included from include/xgboost/data.h:10,

             from src/c_api/c_api.cc:3:

dmlc-core/include/dmlc/base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled

In file included from dmlc-core/include/dmlc/logging.h:15,

             from include/xgboost/logging.h:11,

             from src/logging.cc:7:

dmlc-core/include/dmlc/./base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled

In file included from dmlc-core/include/dmlc/logging.h:15,

             from include/xgboost/logging.h:11,

             from src/learner.cc:7:

dmlc-core/include/dmlc/./base.h:71: note: #pragma message: Will need g++-4.6 or higher to compile allthe features in dmlc-core, compile without c++0x, some features may be disabled

In file included from src/c_api/c_api_error.cc:7:

src/c_api/../common/thread_local.h: In static member function ‘static T* xgboost::common::ThreadLocalStore::Get()’:

src/c_api/../common/thread_local.h:44: error: ‘nullptr’ was not declared in this scope

make: *** [build/c_api/c_api_error.o] Error 1

make: *** Waiting for unfinished jobs....

In file included from include/xgboost/./gbm.h:17,

             from include/xgboost/learner.h:16,

             from src/learner.cc:8:

include/xgboost/././data.h: In constructor ‘xgboost::DMatrix::DMatrix()’:

include/xgboost/././data.h:234: error: ‘nullptr’ was not declared in this scope

In file included from src/c_api/c_api.cc:3:

include/xgboost/data.h: In constructor ‘xgboost::DMatrix::DMatrix()’:

include/xgboost/data.h:234: error: ‘nullptr’ was not declared in this scope

In file included from src/learner.cc:17:

src/./common/io.h: At global scope:

src/./common/io.h:30: error: expected ‘;’ before ‘override’

src/learner.cc:484: error: expected ‘;’ before end of line

src/learner.cc:484: error: expected ‘}’ before end of line

In file included from src/learner.cc:17:

src/./common/io.h: In constructor ‘xgboost::common::PeekableInStream::PeekableInStream(dmlc::Stream*)’:

src/./common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘strm_’

src/./common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘buffer_ptr_’

src/learner.cc: At global scope:

src/learner.cc:484: error: expected unqualified-id before end of line

src/learner.cc:484: error: expected ‘}’ before end of line

src/learner.cc:484: error: expected ‘}’ before end of line

src/learner.cc:484: error: expected declaration before end of line

In file included from src/c_api/c_api.cc:15:

src/c_api/../data/simple_csr_source.h: At global scope:

src/c_api/../data/simple_csr_source.h:65: error: expected ‘;’ before ‘override’

src/c_api/../data/simple_csr_source.h:67: error: expected ‘;’ before ‘override’

src/c_api/../data/simple_csr_source.h:69: error: expected ‘;’ before ‘override’

In file included from src/c_api/c_api.cc:16:

src/c_api/../common/thread_local.h: In static member function ‘static T* xgboost::common::ThreadLocalStore::Get()’:

src/c_api/../common/thread_local.h:44: error: ‘nullptr’ was not declared in this scope

In file included from src/c_api/c_api.cc:18:

src/c_api/../common/io.h: At global scope:

src/c_api/../common/io.h:30: error: expected ‘;’ before ‘override’

src/c_api/c_api.cc:267: error: expected ‘;’ before end of line

src/c_api/c_api.cc:267: error: expected ‘}’ before end of line

In file included from src/c_api/c_api.cc:18:

src/c_api/../common/io.h: In constructor ‘xgboost::common::PeekableInStream::PeekableInStream(dmlc::Stream*)’:

src/c_api/../common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘strm_’

src/c_api/../common/io.h:28: error: class ‘xgboost::common::PeekableInStream’ does not have any field named ‘buffer_ptr_’

src/c_api/c_api.cc: At global scope:

src/c_api/c_api.cc:267: error: expected unqualified-id before end of line

src/c_api/c_api.cc:267: error: expected ‘}’ before end of line

src/c_api/c_api.cc:267: error: expected ‘}’ before end of line

src/c_api/c_api.cc:267: error: expected declaration before end of line

make: *** [build/learner.o] Error 1

make: *** [build/c_api/c_api.o] Error 1

Successfully build single-thread xgboost

If you want multi-threaded version

See additional instructions in doc/build.md

Traceback (most recent call last):

File "", line 17, in

File "/tmp/pip_build_root/xgboost/setup.py", line 29, in

LIB_PATH = libpath['find_lib_path']()

File "/tmp/pip_build_root/xgboost/xgboost/libpath.py", line 45, in find_lib_path

'List of candidates:\n' + ('\n'.join(dll_path)))

builtin.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?

List of candidates:

/tmp/pip_build_root/xgboost/xgboost/libxgboost.so

/tmp/pip_build_root/xgboost/xgboost/../../lib/libxgboost.so

/tmp/pip_build_root/xgboost/xgboost/./lib/libxgboost.so


Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/xgboost
Traceback (most recent call last):
File "/usr/local/bin/pip2.7", line 9, in
load_entry_point('pip==1.5.4', 'console_scripts', 'pip2.7')()
File "/usr/local/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/init.py", line 185, in main
return command.main(cmd_args)
File "/usr/local/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 66: ordinal not in range(128)
[root@hostname bdinstalldir]#

Thanks
Krishna

@kishore432
Copy link

Do we need to upgrade gcc, can we any older version which can run with gcc 4. Isn't gcc OS related compiler.

Thanks
Krishna

@phunterlau
Copy link
Contributor Author

@kishore432 you can try github install and manually edit the compiler requirement in Makefile

@rolweber
Copy link

I was pip-installing xgboost 0.6a2 in a CentOS container where make was missing. The installation claimed to be successful, but of course the lib couldn't be loaded. I think it would help if installation problems caused an error at installation time, rather than at runtime.

Excerpts from the verbose pip output:

  Running setup.py (path:/tmp/pip-build-mv_qff2b/xgboost/setup.py) egg_info for package xgboost
    Running command python setup.py egg_info
    ./xgboost/build-python.sh: line 17: make: command not found
    ./xgboost/build-python.sh: line 18: make: command not found
    -----------------------------
    Building multi-thread xgboost failed
    Start to build single-thread xgboost
    ./xgboost/build-python.sh: line 24: make: command not found
    ./xgboost/build-python.sh: line 25: make: command not found
    Successfully build single-thread xgboost

...

Building wheels for collected packages: xgboost
  Running setup.py bdist_wheel for xgboost: started
  Destination directory: /tmp/tmpgcuwvdt8pip-wheel-
  Running command /usr/local/src/conda3_runtime/4.1.1/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-mv_qff2b/xgboost/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpgcuwvdt8pip-wheel- --python-tag cp35
  ./xgboost/build-python.sh: line 17: make: command not found
  ./xgboost/build-python.sh: line 18: make: command not found
  -----------------------------
  Building multi-thread xgboost failed
  Start to build single-thread xgboost
  ./xgboost/build-python.sh: line 24: make: command not found
  ./xgboost/build-python.sh: line 25: make: command not found
  Successfully build single-thread xgboost

@rolweber
Copy link

rolweber commented Jul 21, 2017

These error messages when pip-installing in a Python 3 environment are caused by print statements using Python 2 syntax. They don't seem to cause any harm though. In this case, I'm happy that the installation problem doesn't trigger an error at installation time.

Installing collected packages: xgboost
  *** Error compiling '/tmp/pip-build-eoltxht1/xgboost/xgboost/rabit/guide/basic.py'...
    File "/tmp/pip-build-eoltxht1/xgboost/xgboost/rabit/guide/basic.py", line 20
      print '@node[%d] before-allreduce: a=%s' % (rank, str(a))
                                             ^
  SyntaxError: invalid syntax
  
  *** Error compiling '/tmp/pip-build-eoltxht1/xgboost/xgboost/rabit/guide/broadcast.py'...
    File "/tmp/pip-build-eoltxht1/xgboost/xgboost/rabit/guide/broadcast.py", line 18
      print '@node[%d] before-broadcast: s=\"%s\"' % (rank, str(s))
                                                 ^
  SyntaxError: invalid syntax
  
  *** Error compiling '/tmp/pip-build-eoltxht1/xgboost/xgboost/rabit/test/local_recover.py'...
    File "/tmp/pip-build-eoltxht1/xgboost/xgboost/rabit/test/local_recover.py", line 16
      print '[%d] restart from version %d' % (rank, version)
                                         ^
  SyntaxError: invalid syntax
  

Successfully installed xgboost-0.6a2

I found the offending files here: https://github.com/dmlc/rabit/tree/master/guide
and here: https://github.com/dmlc/rabit/blob/master/test/local_recover.py

@jarandaf
Copy link

brew install gcc-5 solved all problems in MacOS Sierra 10.12.6.

@fqassemi
Copy link

fqassemi commented Jan 26, 2018

I have MacOS El Captain, and I have installed gcc 49 and gcc 5, and yet I can not install xgboost using pip install xgboost. I receive bunch of messages with the following red error message at the bottom:

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/9x/9vqgp6tn69d5mxkspzw840qr0000gn/T/pip-build-GuPlss/xgboost/

I have seen many complained over the same issue, but I did not find any satisfying response. Maybe I have missed it.

Thanks
FQ

@fqassemi
Copy link

I could not get pip install xgboost working, but I followed this instruction here: https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_on_Mac_OSX?lang=en

where I used git-clone and now I have xgboost.

@tqchen tqchen closed this as completed Jul 4, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests