qcc4cp/qcc

Compiling lilxgates in MacBook Air M2

maremnev opened this issue · 5 comments

Hi!

I tried to run qcc simulator on a MacBook Air with the processor M2. The macOS is Ventura 13.5.2. It works correctly. The python was installed though brew and downloaded by git.

But I can't run it with C++ accelerator, the module returns the message:

**************************************************************`
  WARNING: Could not find 'libxgates.so'.
  Please build it and point PYTHONPATH to it.
  Execution is being re-directed to a Python implementation,
  performance may suffer greatly.
  **************************************************************`

All paths are corrected according libraries place that file WORKSPACE takes into accounts the python positions:

new_local_repository(
    name = "third_party_python",
    build_file = __workspace_dir__ + "/python.BUILD",
    # Configure:
    path = "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers/",
)

new_local_repository(
    name = "third_party_numpy",
    build_file = __workspace_dir__ + "/numpy.BUILD",
    # Configure:
    path = "/Users/maremnev/Library/Python/3.9/lib/python/site-packages/numpy/core/",
)

And variables PATH and PYTHONPATH are corrected too:

export PATH=/Users/maremnev/WorkPlace/qcc:$PATH
export PYTHONPATH=/Users/maremnev/WorkPlace/qcc:$PYTHONPATH

export PYTHONPATH=/Users/maremnev/WorkPlace/qcc/bazel-bin/src/lib:$PYTHONPATH

Command bazel build all returns no errors. But it made in directory qcc/bazel-bin/src/lib files libxgates.a and libxgates.dylib, but python searchs for file libxgates.so.

I guess it's a remainder from Linux.

How to compile the library correctly in Mac? May be it's needed to point the another library in python?

I eliminated the warning message by copying libxgates.dylib into libxgates.so. But I'm not sure it's correct.

The fix seems to work. Checked in. Thank you again (I also added your name to the Thank You notes in the README.md).