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

pip install fails when install 0.90, gcc-8, macOS 10.14.5 #4677

Closed
adithyabsk opened this issue Jul 18, 2019 · 8 comments
Closed

pip install fails when install 0.90, gcc-8, macOS 10.14.5 #4677

adithyabsk opened this issue Jul 18, 2019 · 8 comments

Comments

@adithyabsk
Copy link

Traceback

(venv) adithyabalaji@Adithyas-MacBook-Pro:~/Coding/test$ export CC=gcc-9; export CXX=g++-9; pip install xgboost==0.90
Collecting xgboost==0.90
  Using cached https://files.pythonhosted.org/packages/96/84/4e2cae6247f397f83d8adc5c2a2a0c5d7d790a14a4c7400ff6574586f589/xgboost-0.90.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: ++ pwd
    + oldpath=/private/var/folders/ky/xpvlh4052fb99mp1n12s4pzc0000gn/T/pip-install-fnq0m8bb/xgboost
    + cd ./xgboost/
    + echo darwin18
    + grep -q darwin
    + LIB_XGBOOST=libxgboost.dylib
    + which g++-5
    /usr/local/bin/g++-5
    + export CC=gcc-5
    + CC=gcc-5
    + export CXX=g++-5
    + CXX=g++-5
    + make clean
    Makefile:31: MAKE [/Applications/Xcode.app/Contents/Developer/usr/bin/make] - checked OK
    rm -f -rf build build_plugin lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o #xgboost
    rm -f -rf build_tests *.gcov tests/cpp/xgboost_test
    if [ -d "R-package/src" ]; then \
    		cd R-package/src; \
    		rm -f -rf rabit src include dmlc-core amalgamation *.so *.dll; \
    		cd /private/var/folders/ky/xpvlh4052fb99mp1n12s4pzc0000gn/T/pip-install-fnq0m8bb/xgboost/xgboost; \
    	fi
    + make lib/libxgboost.dylib -j4
    Makefile:31: MAKE [/Applications/Xcode.app/Contents/Developer/usr/bin/make] - checked OK
    g++-5 -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d
    g++-5 -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d
    g++-5 -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -fopenmp -MM -MT build/c_api/c_api.o src/c_api/c_api.cc >build/c_api/c_api.d
    g++-5 -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -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++-5 -c -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -fopenmp src/c_api/c_api_error.cc -o build/c_api/c_api_error.o
    In file included from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/bits/postypes.h:40:0,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/bits/char_traits.h:40,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/string:40,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/stdexcept:39,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/array:38,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/tuple:39,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/mutex:38,
                     from dmlc-core/include/dmlc/thread_local.h:9,
                     from src/c_api/c_api_error.cc:6:
    /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/cwchar:44:19: fatal error: wchar.h: No such file or directory
    compilation terminated.
    make: *** [build/c_api/c_api_error.o] Error 1
    make: *** Waiting for unfinished jobs....
    g++-5 -c -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -fopenmp src/logging.cc -o build/logging.o
    g++-5 -c -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -fopenmp src/c_api/c_api.cc -o build/c_api/c_api.o
    In file included from include/xgboost/data.h:10:0,
                     from src/c_api/c_api.cc:3:
    dmlc-core/include/dmlc/base.h:190:23: fatal error: sys/types.h: No such file or directory
    compilation terminated.
    In file included from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/bits/postypes.h:40:0,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/bits/char_traits.h:40,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/string:40,
                     from rabit/include/rabit/rabit.h:13,
                     from src/logging.cc:7:
    /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/cwchar:44:19: fatal error: wchar.h: No such file or directory
    compilation terminated.
    make: *** [build/c_api/c_api.o] Error 1
    make: *** [build/logging.o] Error 1
    g++-5 -c -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -fopenmp src/learner.cc -o build/learner.o
    In file included from dmlc-core/include/dmlc/io.h:8:0,
                     from src/learner.cc:7:
    /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/cstdio:42:19: fatal error: stdio.h: No such file or directory
    compilation terminated.
    make: *** [build/learner.o] Error 1
    + echo -----------------------------
    -----------------------------
    + echo 'Building multi-thread xgboost failed'
    Building multi-thread xgboost failed
    + echo 'Start to build single-thread xgboost'
    Start to build single-thread xgboost
    + make clean
    Makefile:31: MAKE [/Applications/Xcode.app/Contents/Developer/usr/bin/make] - checked OK
    rm -f -rf build build_plugin lib bin *~ */*~ */*/*~ */*/*/*~ */*.o */*/*.o */*/*/*.o #xgboost
    rm -f -rf build_tests *.gcov tests/cpp/xgboost_test
    if [ -d "R-package/src" ]; then \
    		cd R-package/src; \
    		rm -f -rf rabit src include dmlc-core amalgamation *.so *.dll; \
    		cd /private/var/folders/ky/xpvlh4052fb99mp1n12s4pzc0000gn/T/pip-install-fnq0m8bb/xgboost/xgboost; \
    	fi
    + make lib/libxgboost.dylib -j4 USE_OPENMP=0
    Makefile:31: MAKE [/Applications/Xcode.app/Contents/Developer/usr/bin/make] - checked OK
    g++-5 -DDMLC_LOG_CUSTOMIZE=1 -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
    g++-5 -DDMLC_LOG_CUSTOMIZE=1 -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
    g++-5 -DDMLC_LOG_CUSTOMIZE=1 -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
    g++-5 -DDMLC_LOG_CUSTOMIZE=1 -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
    g++-5 -c -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP src/c_api/c_api_error.cc -o build/c_api/c_api_error.o
    In file included from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/bits/postypes.h:40:0,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/bits/char_traits.h:40,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/string:40,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/stdexcept:39,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/array:38,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/tuple:39,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/mutex:38,
                     from dmlc-core/include/dmlc/thread_local.h:9,
                     from src/c_api/c_api_error.cc:6:
    /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/cwchar:44:19: fatal error: wchar.h: No such file or directory
    compilation terminated.
    make: *** [build/c_api/c_api_error.o] Error 1
    make: *** Waiting for unfinished jobs....
    g++-5 -c -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP src/logging.cc -o build/logging.o
    g++-5 -c -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP src/c_api/c_api.cc -o build/c_api/c_api.o
    In file included from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/bits/postypes.h:40:0,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/bits/char_traits.h:40,
                     from /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/string:40,
                     from rabit/include/rabit/rabit.h:13,
                     from src/logging.cc:7:
    /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/cwchar:44:19: fatal error: wchar.h: No such file or directory
    compilation terminated.
    In file included from include/xgboost/data.h:10:0,
                     from src/c_api/c_api.cc:3:
    dmlc-core/include/dmlc/base.h:190:23: fatal error: sys/types.h: No such file or directory
    compilation terminated.
    make: *** [build/logging.o] Error 1
    make: *** [build/c_api/c_api.o] Error 1
    g++-5 -c -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -msse2 -fPIC -DDISABLE_OPENMP src/learner.cc -o build/learner.o
    In file included from dmlc-core/include/dmlc/io.h:8:0,
                     from src/learner.cc:7:
    /usr/local/Cellar/gcc@5/5.5.0_2/include/c++/5.5.0/cstdio:42:19: fatal error: stdio.h: No such file or directory
    compilation terminated.
    make: *** [build/learner.o] Error 1
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/ky/xpvlh4052fb99mp1n12s4pzc0000gn/T/pip-install-fnq0m8bb/xgboost/setup.py", line 42, in <module>
        LIB_PATH = libpath['find_lib_path']()
      File "/private/var/folders/ky/xpvlh4052fb99mp1n12s4pzc0000gn/T/pip-install-fnq0m8bb/xgboost/xgboost/libpath.py", line 48, in find_lib_path
        'List of candidates:\n' + ('\n'.join(dll_path)))
    XGBoostLibraryNotFound: Cannot find XGBoost Library in the candidate path, did you install compilers and run build.sh in root path?
    List of candidates:
    /private/var/folders/ky/xpvlh4052fb99mp1n12s4pzc0000gn/T/pip-install-fnq0m8bb/xgboost/xgboost/libxgboost.dylib
    /private/var/folders/ky/xpvlh4052fb99mp1n12s4pzc0000gn/T/pip-install-fnq0m8bb/xgboost/xgboost/../../lib/libxgboost.dylib
    /private/var/folders/ky/xpvlh4052fb99mp1n12s4pzc0000gn/T/pip-install-fnq0m8bb/xgboost/xgboost/./lib/libxgboost.dylib
    /Users/adithyabalaji/.pyenv/versions/3.6.8/envs/foreshadow/xgboost/libxgboost.dylib
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/ky/xpvlh4052fb99mp1n12s4pzc0000gn/T/pip-install-fnq0m8bb/xgboost/

I tried installing prior versions and it seems that the earlist version that still works on my current mac is 0.71.post4. I have no problems on another mac machine thought which I can add to this thread.

@adithyabsk
Copy link
Author

If I could get some debugging directions, would be more than happy to provide those details.

@wugufly
Copy link

wugufly commented Jul 18, 2019

open the file and install it
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

and try it again.

@adithyabsk
Copy link
Author

@wugufly Based on the conversations here, I was under the impression that this wasn't the best practice: pyenv/pyenv#1219 (comment) Is there an alternative solution that we can gun for to make the project work out of the box in the long run? I can try this in the short run to see if it works for me.

@hcho3
Copy link
Collaborator

hcho3 commented Jul 18, 2019

@adithyabsk See discussion in #4477. I think a permanent fix would be to have users install OpenMP via brew install libomp. I'm currently working to fix CMakeLists.txt.

@adithyabsk
Copy link
Author

@hcho3 Oh okay, haha I opened that issue as well :) I just wasn't sure if that ticket would solve this issue.

@wel51x
Copy link

wel51x commented Jul 28, 2019

@adithyabsk See discussion in #4477. I think a permanent fix would be to have users install OpenMP via brew install libomp. I'm currently working to fix CMakeLists.txt.

Any luck?

@adithyabsk
Copy link
Author

@hcho3 @wel51x sorry I forgot to follow up, yep that seemed to do the trick. We can close this issue for now, but as I mentioned the legacy headers are probably not the way to go for this problem in the future.

@trivialfis
Copy link
Member

Since #4477 is blocking. We can safely close this one now.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 8, 2019
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

5 participants