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

Problem with compiling pymatgen on macOS due to C++ extensions #1619

Closed
mkhorton opened this issue Oct 4, 2019 · 5 comments
Closed

Problem with compiling pymatgen on macOS due to C++ extensions #1619

mkhorton opened this issue Oct 4, 2019 · 5 comments

Comments

@mkhorton
Copy link
Member

mkhorton commented Oct 4, 2019

User report:

  Running setup.py develop for pymatgen
    ERROR: Command errored out with exit status 1:
     command: /Users/.../miniconda3/envs/pmg/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/.../uw/pymatgen/setup.py'"'"'; __file__='"'"'/Users/.../uw/pymatgen/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /Users/.../uw/pymatgen/
    Complete output (18 lines):
    running develop
    running egg_info
    writing pymatgen.egg-info/PKG-INFO
    writing dependency_links to pymatgen.egg-info/dependency_links.txt
    writing entry points to pymatgen.egg-info/entry_points.txt
    writing requirements to pymatgen.egg-info/requires.txt
    writing top-level names to pymatgen.egg-info/top_level.txt
    reading manifest file 'pymatgen.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'pymatgen.egg-info/SOURCES.txt'
    running build_ext
    building 'pymatgen.optimization.neighbors' extension
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/.../miniconda3/envs/pmg/include -arch x86_64 -I/Users/.../miniconda3/envs/pmg/include -arch x86_64 -I/Users/.../miniconda3/envs/pmg/include/python3.6m -I/Users/.../miniconda3/envs/pmg/lib/python3.6/site-packages/numpy/core/include -c pymatgen/optimization/neighbors.cpp -o build/temp.macosx-10.7-x86_64-3.6/pymatgen/optimization/neighbors.o -Wno-cpp -Wno-unused-function -O2 -march=native -std=c++11 -stdlib=libc++
    g++ -bundle -undefined dynamic_lookup -L/Users/.../miniconda3/envs/pmg/lib -arch x86_64 -L/Users/.../miniconda3/envs/pmg/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/pymatgen/optimization/neighbors.o -o build/lib.macosx-10.7-x86_64-3.6/pymatgen/optimization/neighbors.cpython-36m-darwin.so
    clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
    ld: library not found for -lstdc++
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'g++' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/.../miniconda3/envs/pmg/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/.../uw/pymatgen/setup.py'"'"'; __file__='"'"'/Users/.../uw/pymatgen/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

@chc273 This shouldn't be too hard to fix, you have to link to libc++ on macOS instead since libstdc++ is not supported anymore. There are a few other Python codes that have had similar issues (including BoltzTraP I think?)

@mkhorton mkhorton changed the title Problem with compiling pymatgen on macOS with C++ Problem with compiling pymatgen on macOS due to C++ extensions Oct 4, 2019
@shyuep
Copy link
Member

shyuep commented Oct 4, 2019

Just tell user to use conda install -c conda-forge pymatgen.

@shyuep shyuep closed this as completed Oct 4, 2019
@shyuep
Copy link
Member

shyuep commented Oct 4, 2019

Also, the current dev version of pymatgen actually does link libc++. It seems this user's Xcode is out of date.

@mkhorton mkhorton reopened this Oct 4, 2019
@mkhorton
Copy link
Member Author

mkhorton commented Oct 4, 2019

To clarify, python setup.py develop is broken on macOS for development purposes. This is not just an end user issue.

@shyuep
Copy link
Member

shyuep commented Oct 4, 2019

@chc273 Just pushed a fix.

@shyuep shyuep closed this as completed Oct 4, 2019
@mkhorton
Copy link
Member Author

mkhorton commented Oct 4, 2019

Thanks ! I'll let them know to update their Xcode also

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

2 participants