myQLM / myqlm-issues

4 stars 1 forks source link

OpenMP, Libomp dynamic library, architecture mismatch. #30

Closed Louis2emeduNom closed 5 months ago

Louis2emeduNom commented 10 months ago

Hello, I am currently trying to install myQLM on my computer :
Model Name: MacBook Air Model Identifier: MacBookAir10,1 Chip: Apple M1 Total Number of Cores: 8 (4 performance and 4 efficiency) Memory: 8 GB System Firmware Version: 7459.121.3 OS Loader Version: 7459.121.3

The chip M1's architecture is arm64.

I am using Python 3.9.7.

Problem :

I successfully installed myQLM using pip, then installed Homebrew, then installed cmake using brew. I also installed Libomp using brew by following the instructions at https://myqlm.github.io/01_getting_started/%3Amyqlm%3Amacos.html#macos .

############################## I tried to run the following code :

from qat.lang import Program, H, CNOT

Create a Program

qprog = Program()

Number of qbits

nbqbits = 2

Allocate some qbits

qbits = qprog.qalloc(nbqbits)

Apply some quantum Gates

H(qbits[0]) CNOT(qbits[0], qbits[1])

Export this program into a quantum circuit

circuit = qprog.to_circ()

Import a Quantum Processor Unit Factory (the default one)

from qat.qpus import get_default_qpu

Create a Quantum Processor Unit

qpu = get_default_qpu()

Create a job

job = circuit.to_job()

Submit the job to the QPU

result = qpu.submit(job)

Iterate over the final state vector to get all final components

for sample in result: print("State %s amplitude %s" % (sample.state, sample.amplitude))

##############################

I get his error when calling get_default_qpu() :

Screenshot 2023-12-01 at 14 12 03

(here is the text error :

ImportError: dlopen(/Users/louissimon/opt/miniconda3/lib/python3.9/site-packages/qat/clinalg/wrapper.so, 0x0002): Library not loaded: /usr/local/lib/libomp.dylib Referenced from: /Users/louissimon/opt/miniconda3/lib/python3.9/site-packages/qat/clinalg/libqatclinalg.so Reason: tried: '/usr/local/lib/libomp.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libomp.dylib' (no such file), '/opt/homebrew/Cellar/libomp/17.0.6/lib/libomp.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libomp.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libomp.dylib' (no such file)Library not loaded: /usr/local/lib/libomp.dylib Referenced from: /Users/louissimon/opt/miniconda3/lib/python3.9/site-packages/qat/clinalg/libqatclinalg_gpu.so Reason: tried: '/usr/local/lib/libomp.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libomp.dylib' (no such file), '/opt/homebrew/Cellar/libomp/17.0.6/lib/libomp.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libomp.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libomp.dylib' (no such file)

)

"mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')" seems to indicate that there is an issue with the architecture of the dynamic library libomp.

Can you help me please ?

Thank you very much.

JayEviden commented 6 months ago

We are sorry to reach out late. Is it still issue? Please let us know. We do not support x86_64 in Conda. I see you are using miniconda3.

JayEviden commented 5 months ago

We are closing this Issue, please use the updated version for this type of issue. Don't hesitate to reopen, if it is still a problem.