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

Add POST_LOAD_ASDF_SYSTEMS option to build #672

Merged
merged 5 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ $(QUICKLISP_SETUP):
system-index.txt: $(QUICKLISP_SETUP)
$(QUICKLISP) \
$(FOREST_SDK_FEATURE) \
--eval '(ql:quickload "quilc")' \
--eval '(ql:write-asdf-manifest-file "system-index.txt")'
--eval "(ql:quickload '(quilc ${POST_LOAD_ASDF_SYSTEMS}))" \
--eval "(ql:write-asdf-manifest-file \"system-index.txt\")"

###############################################################################
# DEPENDENCIES
Expand Down Expand Up @@ -70,7 +70,8 @@ endif

.PHONY: quilc
quilc: system-index.txt
$(SBCL) $(FOREST_SDK_FEATURE) \
ASDF_SYSTEMS_TO_LOAD="quilc ${POST_LOAD_ASDF_SYSTEMS}" \
$(SBCL) $(FOREST_SDK_FEATURE) \
--eval "(setf sb-ext:\*on-package-variance\* '(:warn (:swank :swank-backend :swank-repl) :error t))" \
--load "build-app.lisp" \
$(FOREST_SDK_OPTION) \
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ To install system-wide issue the command
$ make install
```

#### Build flags

`quilc` can be built with additional options provided to `make` as described below:

| Flag | Description |
|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `POST_LOAD_ASDF_SYSTEMS` | Specify additional ASDF systems to load _after_ `quilc` as part of the executable. This can be used to build `quilc` with additional out-of-tree functionality. |

### Using the Quil Compiler

The Quil Compiler provides two modes of interaction: (1) communicating
Expand Down
8 changes: 7 additions & 1 deletion build-app.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@
(subseq version 0 (position #\- version :test #'eql))))
(load-systems-table)
(push #'local-system-search asdf:*system-definition-search-functions*)
(asdf:load-system "quilc")

;; Load systems defined by environment variable $ASDF_SYSTEMS_TO_LOAD,
;; or if that does not exist just load quilc
(let ((systems (uiop:getenv "ASDF_SYSTEMS_TO_LOAD")))
(dolist (sys (uiop:split-string (or systems "quilc") :separator " "))
(unless (uiop:emptyp sys)
(asdf:load-system sys))))
;; TODO Fix tweedledum
;; #-win32
;; (asdf:load-system "cl-quil/tweedledum")
Expand Down