Open honamnguyen opened 2 years ago
Hi @honamnguyen, thank you for the interest! Unfortunately, as I don't have a mac machine, I don't think I can fix this issue at the moment. Instead, I would like to suggest you use clang++
instead of AppleClang++
. You can install it using homebrew
(see e.g. this). Then
$ CXX=clang++ python setup.py install
will work.
Hi Chae-Yeun, thank you for the quick reply! After figuring out the right clang++
version, the build seemed to be completed but when I imported UnionFindPy, the file _union_find_py.py
is missing. Maybe something went wrong during the build?
(base) honamnguyen@Nams-MacBook-Air UnionFind % python
Python 3.8.11 (default, Jul 29 2021, 14:57:32)
[Clang 12.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import UnionFind
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'UnionFind'
>>> import UnionFindPy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/__init__.py", line 2, in <module>
from .decoder import Decoder
File "/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/decoder.py", line 1, in <module>
from ._union_find_py import DecoderFromParity
ModuleNotFoundError: No module named 'UnionFindPy._union_find_py'
I also tried different combinations of C compiler and C++ compiler between clang
and AppleClang
and found that only the CC=AppleClang + CXX=clang++ combination finished the build. Here are some of the outputs.
Thanks for the details! I tried to make a wheel for Mac M1 (you may see artifacts here). Could you install this directly (with e.g. https://stackoverflow.com/a/64450982/2470172)? Ideally, I think it is time to upload wheels to PyPI (for pip).
So I copied the file to the UnionFind folder and tried pip install
and wheel unpack
with both extensions .yml
and .whl
but it didn't work, saying that the file name was invalid. I also tried to rename it to UnionFindPy-0.2.0-cp37-osx_arm64.whl
but no luck. I don't think that I am installing from a wheel correctly...
Having this on pip
would be great! If it's not too bad, can you have a wheel for the 86_64x architecture on macOS as well?
Thank you for spending the time on this!
Hi, I uploaded wheels to PyPI (currently only for Mac and Windows). You can now just install it with pip
. See https://pypi.org/project/UnionFindPy/.
When following the installation instruction (with an additional step of
conda install cmake
), I ran into the following error. Any suggestion on what went wrong? Thanks!Output (click to expand)
``` python3 setup.py install Requirement already satisfied: ninja in /Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (1.10.2.3) Requirement already satisfied: numpy in /Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages (from -r requirements.txt (line 2)) (1.22.0) Requirement already satisfied: scipy in /Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages (from -r requirements.txt (line 3)) (1.7.3) running install running bdist_egg running egg_info writing UnionFindPy.egg-info/PKG-INFO writing dependency_links to UnionFindPy.egg-info/dependency_links.txt writing requirements to UnionFindPy.egg-info/requires.txt writing top-level names to UnionFindPy.egg-info/top_level.txt reading manifest file 'UnionFindPy.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'UnionFindPy.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.9-x86_64/egg running install_lib running build_py running build_ext -- The C compiler identification is AppleClang 13.0.0.13000029 -- The CXX compiler identification is AppleClang 13.0.0.13000029 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- union_find version -- pybind11 v2.8.1 -- Found PythonInterp: /Users/honamnguyen/miniconda3/envs/qcircuit64/bin/python3 (found version "3.9.7") -- Found PythonLibs: /Users/honamnguyen/miniconda3/envs/qcircuit64/lib/libpython3.9.dylib -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- Performing Test HAS_FLTO_THIN -- Performing Test HAS_FLTO_THIN - Success -- Configuring done -- Generating done -- Build files have been written to: /Users/honamnguyen/miniconda3/UnionFind/build/temp.macosx-10.9-x86_64-3.9 [2/3] Building CXX object UnionFindPy/cpp/CMa.../_union_find_py.dir/binding/UnionFindPy.cpp. FAILED: UnionFindPy/cpp/CMakeFiles/_union_find_py.dir/binding/UnionFindPy.cpp.o /Library/Developer/CommandLineTools/usr/bin/c++ -D_union_find_py_EXPORTS -I/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/externals/robin-map/include -I/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include -I/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/externals -isystem /Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/externals/pybind11/include -isystem /Users/honamnguyen/miniconda3/envs/qcircuit64/include/python3.9 -O3 -DNDEBUG -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -fPIC -fvisibility=hidden -flto -std=gnu++2a -MD -MT UnionFindPy/cpp/CMakeFiles/_union_find_py.dir/binding/UnionFindPy.cpp.o -MF UnionFindPy/cpp/CMakeFiles/_union_find_py.dir/binding/UnionFindPy.cpp.o.d -o UnionFindPy/cpp/CMakeFiles/_union_find_py.dir/binding/UnionFindPy.cpp.o -c /Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp In file included from /Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:18: In file included from /Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include/Decoder.hpp:19: /Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include/LatticeConcept.hpp:42:9: error: no member named 'convertible_to' in namespace 'std' = std::convertible_to