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

Aer does not build on arm64 macs #1225

Closed
nonhermitian opened this issue Apr 17, 2021 · 6 comments
Closed

Aer does not build on arm64 macs #1225

nonhermitian opened this issue Apr 17, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@nonhermitian
Copy link
Contributor

Informations

  • Qiskit Aer version: 0.8.1 and earlier
  • Python version: 3.9
  • Operating system: OSX

What is the current behavior?

Building Aer natively for arm64 on OSX fails with the error (also see Qiskit/qiskit#1201):

-- Conan executing: /Users/paul/mambaforge/envs/qiskit/bin/conan install . -s build_type=Release -s compiler=apple-clang -s compiler.version=12.0 -s compiler.libcxx=libc++ -e=CONAN_CMAKE_PROGRAM=/Users/paul/Downloads/qiskit-aer-0.8.1/.eggs/cmake-3.18.4.post1-py3.9-macosx-10.9-arm64.egg/cmake/data/CMake.app/Contents/bin/cmake -g=cmake --build=missing
ERROR: Invalid setting 'arm64' is not a valid 'settings.arch' value.
Possible values are ['armv4', 'armv4i', 'armv5el', 'armv5hf', 'armv6', 'armv7', 'armv7hf', 'armv7k', 'armv7s', 'armv8', 'armv8.3', 'armv8_32', 'asm.js', 'avr', 'mips', 'mips64', 'ppc32', 'ppc32be', 'ppc64', 'ppc64le', 's390', 's390x', 'sh4le', 'sparc', 'sparcv9', 'wasm', 'x86', 'x86_64']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"
CMake Error at cmake/conan.cmake:402 (message):
  Conan install failed='1'

Steps to reproduce the problem

Try to build

What is the expected behavior?

Aer builds

Suggested solutions

@nonhermitian nonhermitian added the bug Something isn't working label Apr 17, 2021
@mtreinish
Copy link
Member

mtreinish commented Apr 19, 2021

On top of the conan issue, which we might be able to workaround with disabling conan (set the environment variable DISABLE_CONAN=1) and installing the required libs manually, there is an issue with scikit-build that will block actually building aer when it gets to that part.

I've been planning to add a wheel job for this (similar to Qiskit/qiskit#6252) but am blocked because scikit-build doesn't work for cross-builds on macOS (if ignores the architecture flags set and hard codes x86_64 when it calls cmake) there is an issue and PR someone opened to fix scikit-build but until that PR merges and is included in a scikit-build release adding arm64 macOS builds will be blocked.

@vvilpas
Copy link
Contributor

vvilpas commented Apr 27, 2021

It seems Conan should correctly detect M1 Macs since version 1.34.0. Can you update conan to check if it works with M1 Macs (pip install -U conan)?

@nonhermitian
Copy link
Contributor Author

So I think that resolved the conan issue, but then one hits another:

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /Library/Developer/CommandLineTools/usr/bin/c++ 
Build flags: 
Id flags:  

The output was:
1
ld: library not found for -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /Library/Developer/CommandLineTools/usr/bin/cc 
Build flags: 
Id flags:  

The output was:
1
ld: library not found for -lSystem
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am using the default Xcode compiler:

Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: arm64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@nonhermitian
Copy link
Contributor Author

scikit-build master now supports arm64 macs, but conan (I think) is trying to build a ton of dependencies from source and crashes on SciPy. Why it is trying to build SciPy is beyond me.

@vvilpas
Copy link
Contributor

vvilpas commented Jun 18, 2021

That shouldn't be happening. Can you post the full logs (Doing from a fresh clone VERBOSE=1 python ./setup.py bdist_wheel 2>&1|tee build.log) ?

@vvilpas
Copy link
Contributor

vvilpas commented Jul 10, 2021

Closing this one. Check #1286

@vvilpas vvilpas closed this as completed Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants