-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
As of now, it's impossible to (easily, automatically) build this crate for usage on the web (or on any target other than the host machine).
The first problem you will run into is <stdlib.h> and <complex.h> not being defined.
- The first should be solved by making qiskit's
cbindgen(in qiskit, not qiskit-rs) not include the standard includes: it doesn't look likeqiskit.hneeds anything fromstdlib.h. - The second can be solved with a simple fill assuming GCC/clang:
#if !__has_include(<complex.h>)
#define complex _Complex
#define _Complex_I ((_Complex float)__builtin_complex((float)0.0, (float)1.0))
#define I _Complex_I
#define creal(x) (__real__(x))
#define cimag(x) (__imag__(x))
#endifAfter this, one will find that bindgen (in qiskit-rs, not qiskit) does not generate forwarders for the C functions. This is because qiskit-sys just builds qiskit using make, which uses the system compiler instead of the correct compiler for the target.
The recommended solution as far as I know is to use the cc crate as a build-dependency, and not use the Makefile at all, but I simply don't have the energy right now to try and get that working.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels