-
Notifications
You must be signed in to change notification settings - Fork 159
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
Unable to build qsimcirq on MacOS #242
Comments
Hi @JacobBeckey, Before digging too deeply into this, I'll note that we recommend our Docker build instructions for running on MacOS. Since Docker builds run in a container, this would avoid any OS-specific issues you might be experiencing. If Docker isn't an option: The error messages point to an issue with CMake. Depending on how your version of CMake is configured, it may or may not use C++11 by default; based on the
|
Thank you for your response. I uninstalled cmake and updated and that did not work. I then downloaded the repo, changed the CMakeLists.txt file to set C++11 as the default. I saved the file, restarted my terminal, changed into the directory containing qsimcirq and then ran |
Try this again but with If that doesn't work...since you're installing qsimcirq, I assume you are also using Cirq? Depending on your use case, you may be able to get by using the built-in Cirq simulators. They're not as fast as qsim, but for up to ~12 qubits the difference in runtime is usually less than a second. |
Sadly that still did not work. I appreciate your help though. Does |
Where is |
Hey, this is the mixed simulator I was attempting to use: https://pennylane-cirq.readthedocs.io/en/latest/devices/mixed_simulator.html But, okay, I really only need to work with 8 or so qubits max for what I am attempting to accomplish. |
Ah, that checks out. Yes, I'll keep this issue open to highlight the need for non-Docker options on MacOS. |
FWIW I tried this quickly and went down the rabbithole on my mac. Not sure it will be easy but could be worthwhile. I started with the same error as @JacobBeckey. I installed This makes However
After some digging it turns out
So now But I have no clue how to make that work with CMake just yet :) |
I've simplified @balopat 's instructions to avoid modifying Makefiles :)
Note, the three environment variables being set; You can put this in your Note for those who may try to follow along: if you try to build once and then monkey with the environment variables, any changes likely won't get picked up and it will continue to fail in the same way. CMake caches everything in the |
We'd have to be very careful packaging this as a wheel, though, as it links to our homebrew libomp
|
Super cool! Thanks for adding to the solutions! I confirm that this compiles. |
The above recommendations (both modifying the Makefile as well as CMakeLists.txt) have failed in my case (Apple M1 Max) I'm getting errors of the following sort: /opt/homebrew/Cellar/llvm/15.0.5/lib/clang/15.0.5/include/smmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture" |
@VolodyaCO Please see this comment - in short, the M1 architecture does not support the vector instructions qsim uses for fast simulation. Some alternatives are suggested in the linked comment. |
Thank you for linking the comment! |
When running "pip install qsimcirq" on my mac I get the following two error messages:
The rest of the error was:
I would be grateful for any input as to how I could circumvent this issue. I am not sure how to interpret all of this error message, but the one part indicates
So, I attempted to use home brew to update my gcc but that also did not work.
The text was updated successfully, but these errors were encountered: