Skip to content

Commit

Permalink
Fix cargo builds on arm64 macOS systems (Qiskit#269)
Browse files Browse the repository at this point in the history
Building the retworkx library on macOS requires some extra rustc linker
flags so that cargo and rustc are able to link the binary against python
correctly at build time. To do this by default we added the cargo config
for the x86_64 macOS target in Qiskit#53 which fixed it for all users running
cargo on those platforms. However, now there are macOS systems that have
aarch64 CPUs. To ensure that people trying to use cargo to build
binaries on those systems don't need to manually specify the linker
flags this commit adds the config for that target as well.
  • Loading branch information
mtreinish authored Mar 11, 2021
1 parent 65876db commit 10faa83
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]

[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]

0 comments on commit 10faa83

Please sign in to comment.