From 638eed5a6efb5bfffb575dcec7ff08c7c4ac2d6a Mon Sep 17 00:00:00 2001 From: cheewei Date: Fri, 19 Sep 2025 15:15:44 +0800 Subject: [PATCH] Enhance MacOS instructions for Qiskit C API to clarify Python dylib requirement https://github.com/Qiskit/documentation/issues/3934 --- docs/guides/install-c-api.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/guides/install-c-api.mdx b/docs/guides/install-c-api.mdx index 6cc5b30b038..3b2bac75f87 100644 --- a/docs/guides/install-c-api.mdx +++ b/docs/guides/install-c-api.mdx @@ -84,13 +84,13 @@ export LD_LIBRARY_PATH=/path/to/dist/c/lib:$LD_LIBRARY_PATH ``` On MacOS: ```bash -export DYLD_LIBRARY_PATH=/path/to/dist/c/lib:$DYLD_LIBRARY_PATH +export DYLD_LIBRARY_PATH=/path/to/dist/c/lib:/path/to/python/lib:$DYLD_LIBRARY_PATH ``` Alternatively, you can set the runtime library path during compilation by adding ``` --Wl,-rpath,/path/to/dist/c/lib +-Wl,-rpath,/path/to/dist/c/lib -Wl,-rpath,/path/to/python/lib ``` -to the compiler flags. +to the compiler flags. This ensures your program can find both the Qiskit library and the required Python libraries (such as libpython3.xx.dylib). Now you can execute the binary: ```bash