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

unable to install on macos after brew install llvm #11

Open
tony-tian opened this issue Mar 26, 2018 · 10 comments
Open

unable to install on macos after brew install llvm #11

tony-tian opened this issue Mar 26, 2018 · 10 comments

Comments

@tony-tian
Copy link

after brew install llvm worked fine, pip install git+https://github.com/teemupitkanen/mrpt/ meet some problems...hope for your help

  Running setup.py install for mrpt ... error
    Complete output from command /Users/tianyizhuang/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/66/rk12_30x5dvbpg0pk_glwg2c0000gn/T/pip-zmys9ilr-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/66/rk12_30x5dvbpg0pk_glwg2c0000gn/T/pip-7__rozak-record/install-record.txt --single-version-externally-managed --compile:
    WARNING: '.' not a valid package name; please use only .-separated package names in setup.py
    running install
    running build
    running build_py
    package init file '__init__.py' not found (or not a regular file)
    creating build
    creating build/lib.macosx-10.7-x86_64-3.6
    copying setup.py -> build/lib.macosx-10.7-x86_64-3.6
    copying mrpt.py -> build/lib.macosx-10.7-x86_64-3.6
    copying demo.py -> build/lib.macosx-10.7-x86_64-3.6
    running build_ext
    building 'mrptlib' extension
    creating build/temp.macosx-10.7-x86_64-3.6
    creating build/temp.macosx-10.7-x86_64-3.6/cpp
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/tianyizhuang/anaconda/include -arch x86_64 -I/Users/tianyizhuang/anaconda/include -arch x86_64 -Icpp/lib -I/Users/tianyizhuang/anaconda/lib/python3.6/site-packages/numpy/core/include -I/Users/tianyizhuang/anaconda/include/python3.6m -c cpp/mrptmodule.cpp -o build/temp.macosx-10.7-x86_64-3.6/cpp/mrptmodule.o -std=c++11 -O3 -ffast-math -s -fno-rtti -fopenmp -DNDEBUG -march=native
    clang: error: unsupported option '-fopenmp'
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/Users/tianyizhuang/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/66/rk12_30x5dvbpg0pk_glwg2c0000gn/T/pip-zmys9ilr-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/66/rk12_30x5dvbpg0pk_glwg2c0000gn/T/pip-7__rozak-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/66/rk12_30x5dvbpg0pk_glwg2c0000gn/T/pip-zmys9ilr-build/
@ejaasaari
Copy link
Collaborator

It seems that your compiler is defaulting to gcc. Try clang:

CC=clang CXX=clang++ pip install git+https://github.com/teemupitkanen/mrpt/

@tony-tian
Copy link
Author

thanks for reply! the command still not worked..

  Running setup.py install for mrpt ... error
    Complete output from command /Users/tianyizhuang/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/66/rk12_30x5dvbpg0pk_glwg2c0000gn/T/pip-1ligc2ie-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/66/rk12_30x5dvbpg0pk_glwg2c0000gn/T/pip-z3mysqps-record/install-record.txt --single-version-externally-managed --compile:
    WARNING: '.' not a valid package name; please use only .-separated package names in setup.py
    running install
    running build
    running build_py
    package init file '__init__.py' not found (or not a regular file)
    creating build
    creating build/lib.macosx-10.7-x86_64-3.6
    copying setup.py -> build/lib.macosx-10.7-x86_64-3.6
    copying mrpt.py -> build/lib.macosx-10.7-x86_64-3.6
    copying demo.py -> build/lib.macosx-10.7-x86_64-3.6
    running build_ext
    building 'mrptlib' extension
    creating build/temp.macosx-10.7-x86_64-3.6
    creating build/temp.macosx-10.7-x86_64-3.6/cpp
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/tianyizhuang/anaconda/include -arch x86_64 -I/Users/tianyizhuang/anaconda/include -arch x86_64 -Icpp/lib -I/Users/tianyizhuang/anaconda/lib/python3.6/site-packages/numpy/core/include -I/Users/tianyizhuang/anaconda/include/python3.6m -c cpp/mrptmodule.cpp -o build/temp.macosx-10.7-x86_64-3.6/cpp/mrptmodule.o -std=c++11 -O3 -ffast-math -s -fno-rtti -fopenmp -DNDEBUG -march=native
    clang-4.0: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
    In file included from cpp/mrptmodule.cpp:6:
    /Users/tianyizhuang/anaconda/include/python3.6m/Python.h:25:10: fatal error: 'stdio.h' file not found
    #include <stdio.h>
             ^~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1
    
    ----------------------------------------
Command "/Users/tianyizhuang/anaconda/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/66/rk12_30x5dvbpg0pk_glwg2c0000gn/T/pip-1ligc2ie-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/66/rk12_30x5dvbpg0pk_glwg2c0000gn/T/pip-z3mysqps-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/66/rk12_30x5dvbpg0pk_glwg2c0000gn/T/pip-1ligc2ie-build/

@ejaasaari
Copy link
Collaborator

Do you have Xcode Command Line Tools installed? Try

xcode-select --install

@tony-tian
Copy link
Author

ensure the installation..still unable to install...but very thanks for help! still hope for further communication

@ejaasaari
Copy link
Collaborator

Can you try what's suggested here, mainly the brew install python part? If that doesn't work, try without using anaconda.

@tony-tian
Copy link
Author

hard to work without anaconda...maybe I need to wait for further updates in order to get it working..thanks for the help and reply, and hope for any advice if available.

@tony-tian
Copy link
Author

sir...now the question becomes:cpp/Mrpt.h:10:10: fatal error: 'random' file not found..
after google it, I found bit of the question...seemed seldom happened..
do need your help,plz

@ejaasaari
Copy link
Collaborator

Your compiler apparently doesn't have C++11 support. What version of clang are you using?

@tony-tian
Copy link
Author

clang version 4.0.1 (tags/RELEASE_401/final)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Users/tianyizhuang/anaconda3/bin

I wonder the C++11 support have something wrong because only random package could not be found...

@snapstew
Copy link

I saw many similar errors as above, however I was able install successfully on Mac OS Catalina with Anaconda 3.7 using the following commands:

brew update
brew install llvm

CC=/usr/local/opt/llvm/bin/clang CXX=/usr/local/opt/llvm/bin/clang++ CPATH=/usr/local/opt/llvm/include/c++/v1 pip install git+https://github.com/teemupitkanen/mrpt/

Thanks for taking the time to open source this great package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants