This PR resolves #788, providing a way to build a small subset of Quilc functionality into a shared library.
Notes
Tested on macOS, but not Linux.
The Makefile for the C tests includes a condition to add the -pagezero_size 0x100000 compilation option when compiling on macOS to address the issue at the bottom of the sbcl-librarian README.
The Python tests will not run on macOS unless either 1) you are using a custom build of SBCL that negates the aforementioned page zero size issue or 2) you are using a custom build of Python that was compiled with the -pagezero_size 0x100000 option.
The test-build-lib test that builds libquilc.dylib will fail unless you have libsbcl.so in your library path. Instructions:
Go to your SBCL source directory.
Run sh make-shared-library.sh.
Copy src/runtime/libsbcl.so into your library path, e.g. /usr/local/lib/.
This PR resolves #788, providing a way to build a small subset of Quilc functionality into a shared library.
Notes
-pagezero_size 0x100000
compilation option when compiling on macOS to address the issue at the bottom of the sbcl-librarian README.-pagezero_size 0x100000
option.test-build-lib
test that buildslibquilc.dylib
will fail unless you havelibsbcl.so
in your library path. Instructions:sh make-shared-library.sh
.src/runtime/libsbcl.so
into your library path, e.g./usr/local/lib/
.Functions
Parsing/printing
quilc_parse_quil
quilc_print_program
Chip specifications
quilc_build_nq_linear_chip
quilc_chip_spec_from_isa_descriptor
quilc_print_chip_spec
Compilation
quilc_compile_quil
quilc_compile_protoquil
Testing