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

Installation error on macOS (both with arm64 and x86_64 conda environments) #10

Open
honamnguyen opened this issue Feb 10, 2022 · 5 comments

Comments

@honamnguyen
Copy link

honamnguyen commented Feb 10, 2022

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<T, std::vector<uint32_t>> || detail::std_array<T>;
          ~~~~~^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include/LatticeConcept.hpp:42:24: error: 'T' does not refer to a value
        = std::convertible_to<T, std::vector<uint32_t>> || detail::std_array<T>;
                              ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include/LatticeConcept.hpp:40:19: note: declared here
template<typename T>
                  ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include/LatticeConcept.hpp:52:8: error: expected concept name with optional arguments
                } -> std::convertible_to<uint32_t>;
                     ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include/LatticeConcept.hpp:55:8: error: expected concept name with optional arguments
                } -> std::convertible_to<uint32_t>;
                     ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include/LatticeConcept.hpp:58:8: error: expected concept name with optional arguments
                } -> vertex_connections_result;
                     ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include/LatticeConcept.hpp:61:8: error: expected concept name with optional arguments
                } -> std::convertible_to<uint32_t>;
                     ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include/LatticeConcept.hpp:64:8: error: expected concept name with optional arguments
                } -> std::convertible_to<uint32_t>;
                     ^
In file included from /Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:18:
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include/Decoder.hpp:36:10: error: unknown type name 'LatticeConcept'
template<LatticeConcept Lattice> class Decoder
         ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include/Decoder.hpp:43:8: error: unknown type name 'Lattice'
        const Lattice lattice_;
              ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:40:52: error: template argument for non-type template parameter must be an expression
        using UnionFindFromParity = UnionFindCPP::Decoder<UnionFindCPP::LatticeFromParity>;
                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/include/Decoder.hpp:36:25: note: template parameter is declared here
template<LatticeConcept Lattice> class Decoder
                        ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:41:13: error: use of undeclared identifier 'UnionFindFromParity'
        py::class_<UnionFindFromParity>(m, "DecoderFromParity")
                   ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:57:12: error: use of undeclared identifier 'UnionFindFromParity'
                                return UnionFindFromParity(static_cast<uint32_t>(num_parities),
                                       ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:42:8: error: no matching function for call to 'init'
                .def(py::init(
                     ^~~~~~~~
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/externals/pybind11/include/pybind11/pybind11.h:1657:5: note: candidate template ignored: substitution failure [with Func = (lambda at /Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:43:4)]
Ret init(Func &&f) { return {std::forward<Func>(f)}; }
    ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/externals/pybind11/include/pybind11/pybind11.h:1650:68: note: candidate function template not viable: requires 0 arguments, but 1 was provided
template <typename... Args> detail::initimpl::constructor<Args...> init() { return {}; }
                                                                   ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/externals/pybind11/include/pybind11/pybind11.h:1662:5: note: candidate function template not viable: requires 2 arguments, but 1 was provided
Ret init(CFunc &&c, AFunc &&a) {
    ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:82:12: error: use of undeclared identifier 'UnionFindFromParity'
                                return UnionFindFromParity(static_cast<uint32_t>(num_parities),
                                       ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:62:8: error: no matching function for call to 'init'
                .def(py::init(
                     ^~~~~~~~
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/externals/pybind11/include/pybind11/pybind11.h:1657:5: note: candidate template ignored: substitution failure [with Func = (lambda at /Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:63:4)]
Ret init(Func &&f) { return {std::forward<Func>(f)}; }
    ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/externals/pybind11/include/pybind11/pybind11.h:1650:68: note: candidate function template not viable: requires 0 arguments, but 1 was provided
template <typename... Args> detail::initimpl::constructor<Args...> init() { return {}; }
                                                                   ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/externals/pybind11/include/pybind11/pybind11.h:1662:5: note: candidate function template not viable: requires 2 arguments, but 1 was provided
Ret init(CFunc &&c, AFunc &&a) {
    ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:88:18: error: use of undeclared identifier 'UnionFindFromParity'
                .def("clear", &UnionFindFromParity::clear, "Clear decoder's internal data")
                               ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:89:40: error: use of undeclared identifier 'UnionFindFromParity'
                .def_property_readonly("num_edges", &UnionFindFromParity::num_edges,
                                                     ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:92:21: error: use of undeclared identifier 'UnionFindFromParity'
                        "num_vertices", &UnionFindFromParity::num_vertices,
                                         ^
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:96:7: error: unknown type name 'UnionFindFromParity'
                        [](UnionFindFromParity& decoder,
                           ^
19 errors generated.
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/Users/honamnguyen/miniconda3/UnionFind/setup.py", line 130, in <module>
    setup(classifiers=classifiers, **(info))
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 164, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
    self.run_command(cmdname)
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/command/install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 79, in run
    _build_ext.run(self)
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/command/build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/command/build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "/Users/honamnguyen/miniconda3/UnionFind/setup.py", line 78, in build_extension
    subprocess.check_call(
  File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 1.
@chaeyeunpark
Copy link
Owner

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.

@honamnguyen
Copy link
Author

honamnguyen commented Feb 11, 2022

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.

Output for `CXX=clang++` (successful build)
(base) honamnguyen@Nams-MacBook-Air UnionFind % CXX=clang++ python3 setup.py install
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'
writing manifest file 'UnionFindPy.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-11.1-arm64/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 Clang 13.0.1
-- 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: /opt/homebrew/opt/llvm/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- union_find version 
-- pybind11 v2.8.1 
-- Found PythonInterp: /Users/honamnguyen/miniconda3/bin/python3 (found version "3.8.11") 
-- Found PythonLibs: /Users/honamnguyen/miniconda3/lib/libpython3.8.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-11.1-arm64-3.8
[2/3] Building CXX object UnionFindPy/cpp/CMa.../_union_find_py.dir/binding/UnionFindPy.cpp.
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:114:34: warning: braces around scalar initializer [-Wbraced-scalar-init]
                                return py::array_t<uint32_t>({(int64_t)decoder.num_edges()}, corrections,
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[3/3] Linking CXX shared module ../lib.macosx...ionFindPy/_union_find_py.cpython-38-darwin.s
creating build/bdist.macosx-11.1-arm64
creating build/bdist.macosx-11.1-arm64/egg
creating build/bdist.macosx-11.1-arm64/egg/UnionFindPy
copying build/lib.macosx-11.1-arm64-3.8/UnionFindPy/decoder.py -> build/bdist.macosx-11.1-arm64/egg/UnionFindPy
copying build/lib.macosx-11.1-arm64-3.8/UnionFindPy/_version.py -> build/bdist.macosx-11.1-arm64/egg/UnionFindPy
copying build/lib.macosx-11.1-arm64-3.8/UnionFindPy/__init__.py -> build/bdist.macosx-11.1-arm64/egg/UnionFindPy
creating build/bdist.macosx-11.1-arm64/egg/UnionFindPy/cpp
copying build/lib.macosx-11.1-arm64-3.8/UnionFindPy/cpp/CMakeLists.txt -> build/bdist.macosx-11.1-arm64/egg/UnionFindPy/cpp
copying build/lib.macosx-11.1-arm64-3.8/UnionFindPy/cpp/Makefile -> build/bdist.macosx-11.1-arm64/egg/UnionFindPy/cpp
copying build/lib.macosx-11.1-arm64-3.8/UnionFindPy/_union_find_py.cpython-38-darwin.so -> build/bdist.macosx-11.1-arm64/egg/UnionFindPy
byte-compiling build/bdist.macosx-11.1-arm64/egg/UnionFindPy/decoder.py to decoder.cpython-38.pyc
byte-compiling build/bdist.macosx-11.1-arm64/egg/UnionFindPy/_version.py to _version.cpython-38.pyc
byte-compiling build/bdist.macosx-11.1-arm64/egg/UnionFindPy/__init__.py to __init__.cpython-38.pyc
creating stub loader for UnionFindPy/_union_find_py.cpython-38-darwin.so
byte-compiling build/bdist.macosx-11.1-arm64/egg/UnionFindPy/_union_find_py.py to _union_find_py.cpython-38.pyc
creating build/bdist.macosx-11.1-arm64/egg/EGG-INFO
copying UnionFindPy.egg-info/PKG-INFO -> build/bdist.macosx-11.1-arm64/egg/EGG-INFO
copying UnionFindPy.egg-info/SOURCES.txt -> build/bdist.macosx-11.1-arm64/egg/EGG-INFO
copying UnionFindPy.egg-info/dependency_links.txt -> build/bdist.macosx-11.1-arm64/egg/EGG-INFO
copying UnionFindPy.egg-info/requires.txt -> build/bdist.macosx-11.1-arm64/egg/EGG-INFO
copying UnionFindPy.egg-info/top_level.txt -> build/bdist.macosx-11.1-arm64/egg/EGG-INFO
writing build/bdist.macosx-11.1-arm64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
UnionFindPy.__pycache__._union_find_py.cpython-38: module references __file__
creating 'dist/UnionFindPy-0.2.0-py3.8-macosx-11.1-arm64.egg' and adding 'build/bdist.macosx-11.1-arm64/egg' to it
removing 'build/bdist.macosx-11.1-arm64/egg' (and everything under it)
Processing UnionFindPy-0.2.0-py3.8-macosx-11.1-arm64.egg
creating /Users/honamnguyen/miniconda3/lib/python3.8/site-packages/UnionFindPy-0.2.0-py3.8-macosx-11.1-arm64.egg
Extracting UnionFindPy-0.2.0-py3.8-macosx-11.1-arm64.egg to /Users/honamnguyen/miniconda3/lib/python3.8/site-packages
Adding UnionFindPy 0.2.0 to easy-install.pth file

Installed /Users/honamnguyen/miniconda3/lib/python3.8/site-packages/UnionFindPy-0.2.0-py3.8-macosx-11.1-arm64.egg
Processing dependencies for UnionFindPy==0.2.0
Searching for ninja==1.10.2.3
Best match: ninja 1.10.2.3
Adding ninja 1.10.2.3 to easy-install.pth file
Installing ninja script to /Users/honamnguyen/miniconda3/bin

Using /Users/honamnguyen/miniconda3/lib/python3.8/site-packages
Finished processing dependencies for UnionFindPy==0.2.0
Output for `CC=clang CXX=clang++` (unsuccessful build)

(qcircuit64) honamnguyen@Nams-MacBook-Air UnionFind % CC=clang CXX=clang++ python setup.py install
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 Clang 13.0.1
-- The CXX compiler identification is Clang 13.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/opt/llvm/bin/clang - 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: /usr/local/opt/llvm/bin/clang++ - 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/python (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/CMakeFiles/_union_find_py.dir/binding/UnionFindPy.cpp.o
/Users/honamnguyen/miniconda3/UnionFind/UnionFindPy/cpp/binding/UnionFindPy.cpp:114:34: warning: braces around scalar initializer [-Wbraced-scalar-init]
return py::array_t<uint32_t>({(int64_t)decoder.num_edges()}, corrections,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
[3/3] Linking CXX shared module ../lib.macosx-10.9-x86_64-3.9/UnionFindPy/_union_find_py.cpython-39-darwin.so
FAILED: ../lib.macosx-10.9-x86_64-3.9/UnionFindPy/_union_find_py.cpython-39-darwin.so
: && /usr/local/opt/llvm/bin/clang++ -O3 -DNDEBUG -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -bundle -Wl,-headerpad_max_install_names -L/usr/local/opt/llvm/lib -Xlinker -undefined -Xlinker dynamic_lookup -flto -o ../lib.macosx-10.9-x86_64-3.9/UnionFindPy/_union_find_py.cpython-39-darwin.so UnionFindPy/cpp/CMakeFiles/_union_find_py.dir/binding/UnionFindPy.cpp.o UnionFindPy/cpp/CMakeFiles/_union_find_py.dir/src/utility.cpp.o && cd /Users/honamnguyen/miniconda3/UnionFind/build/temp.macosx-10.9-x86_64-3.9/UnionFindPy/cpp && /usr/local/opt/llvm/bin/llvm-strip -x /Users/honamnguyen/miniconda3/UnionFind/build/lib.macosx-10.9-x86_64-3.9/UnionFindPy/_union_find_py.cpython-39-darwin.so
/usr/local/opt/llvm/bin/llvm-strip: error: unsupported load command (cmd=0x80000034)
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/Users/honamnguyen/miniconda3/UnionFind/setup.py", line 130, in
setup(classifiers=classifiers, **(info))
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 164, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
self.run_command(cmdname)
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/command/install_lib.py", line 107, in build
self.run_command('build_ext')
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/Users/honamnguyen/miniconda3/UnionFind/setup.py", line 78, in build_extension
subprocess.check_call(
File "/Users/honamnguyen/miniconda3/envs/qcircuit64/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 1.

@chaeyeunpark
Copy link
Owner

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).

@honamnguyen
Copy link
Author

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!

@chaeyeunpark
Copy link
Owner

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/.

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