quil-lang / qvm

The high-performance and featureful Quil simulator.
Other
413 stars 57 forks source link

Circular dependency causes build to fail #314

Closed genos closed 1 year ago

genos commented 1 year ago

Hi all! I'm trying to build qvm on an M1 Mac (new work computer), and am hitting an error about a circular dependency when running make:

<SNIP>
[package qvm-app.debugger].....
sbcl --dynamic-space-size 4096 --noinform --non-interactive --no-userinit --no-sysinit  \
                --eval "(setf sb-ext:\*on-package-variance\* '(:warn (:swank :swank-backend :swank-repl) :error t))" \
                --eval '(push :hunchentoot-no-ssl *features*)' \
                 \
                --load build-app.lisp \

WARNING: System definition file #P"/Users/genos/quicklisp/dists/quicklisp/software/parse-float-20200218-git/parse-float.asd" contains definition for system "parse-float-tests". Please only define "parse-float" and secondary systems with a name starting with "parse-float/" (e.g. "parse-float/test") in that file.
While evaluating the form starting at line 14, column 0
  of #P"/Users/genos/quicklisp/local-projects/qvm/build-app.lisp":
Unhandled ASDF/ACTION:CIRCULAR-DEPENDENCY in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                                       {70052E0003}>:
  Circular dependency:
     ((#<ASDF/LISP-ACTION:LOAD-OP > . #<ASDF/SYSTEM:SYSTEM "cl-quil">)
      (#<ASDF/LISP-ACTION:LOAD-OP >
       . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "cl-quil" "package">)
      (#<ASDF/LISP-ACTION:PREPARE-OP >
       . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "cl-quil" "package">)
      (#<ASDF/LISP-ACTION:PREPARE-OP > . #<ASDF/SYSTEM:SYSTEM "cl-quil">)
      (#<ASDF/LISP-ACTION:LOAD-OP > . #<ASDF/SYSTEM:SYSTEM "qvm">)
      (#<ASDF/LISP-ACTION:LOAD-OP >
       . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "qvm" "package">)
      (#<ASDF/LISP-ACTION:PREPARE-OP >
       . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "qvm" "package">)
      (#<ASDF/LISP-ACTION:PREPARE-OP > . #<ASDF/SYSTEM:SYSTEM "qvm">))

<SNIP>

It looks like this problem is:

Any ideas or suggestions to get the app to build on this M1 would be greatly appreciated! Thanks.

stylewarning commented 1 year ago

Ok, I investigated. I believe everything is OK. Please ensure the following:

When I do this, I get:

<SNIP>
; compilation unit finished
;   caught 15 STYLE-WARNING conditions
;   printed 221 notes
Warming the operator cache for 30 qubits...done
compressed 32768 bytes into 627 at level 9
compressed 59965440 bytes into 9747636 at level 9
compressed 15695872 bytes into 3984976 at level 9
compressed 2752512 bytes into 681372 at level 9
compressed 33751040 bytes into 5930270 at level 9
$ ./qvm --verbose --benchmark 10
******************************
* Welcome to the Rigetti QVM *
******************************
Copyright (c) 2016-2019 Rigetti Computing.

(Configured with 4096 MiB of workspace and 16 workers.)
(Gates parallelize at 19 qubits.)
(There are 3 kernels and they are used with up to 29 qubits.)
(Features enabled: avx2)

<134>1 2023-04-14T18:31:37Z rs qvm 59001 - - Compilation mode disabled.
<135>1 2023-04-14T18:31:37Z rs qvm 59001 - - Selected simulation method: pure-state
<135>1 2023-04-14T18:31:37Z rs qvm 59001 - - Starting "bell" benchmark with 10 qubits...

; Transition H 0 took 4 ms (gc: 0 ms; alloc: 685968 bytes)
; Transition CNOT 0 1 took 1 ms (gc: 0 ms; alloc: 763456 bytes)
; Transition CNOT 1 2 took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition CNOT 2 3 took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition CNOT 3 4 took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition CNOT 4 5 took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition CNOT 5 6 took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition CNOT 6 7 took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition CNOT 7 8 took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition CNOT 8 9 took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition MEASURE 0 ro[0] took 7 ms (gc: 0 ms; alloc: 3462928 bytes)
; Transition MEASURE 1 ro[1] took 2 ms (gc: 0 ms; alloc: 1078592 bytes)
; Transition MEASURE 2 ro[2] took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition MEASURE 3 ro[3] took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition MEASURE 4 ro[4] took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition MEASURE 5 ro[5] took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition MEASURE 6 ro[6] took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition MEASURE 7 ro[7] took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition MEASURE 8 ro[8] took 0 ms (gc: 0 ms; alloc: 0 bytes)
; Transition MEASURE 9 ro[9] took 0 ms (gc: 0 ms; alloc: 0 bytes)
Evaluation took:
  0.014 seconds of real time
  0.014984 seconds of total run time (0.013228 user, 0.001756 system)
  107.14% CPU
  119 lambdas converted
  35,351,884 processor cycles
  6,968,688 bytes consed

Dynamic space usage is:   66,132,352 bytes.
Immobile space usage is:  36,484,864 bytes (27,088 bytes overhead).
Read-only space usage is: 15,691,072 bytes.
Static space usage is:         2,640 bytes.
Control stack usage is:        2,384 bytes.
Binding stack usage is:          112 bytes.
Control and binding stack usage is for the current thread only.
Garbage collection is currently enabled.

Breakdown for dynamic space:
  22,370,656 bytes for 1,398,166 cons objects
  17,215,744 bytes for    80,292 simple-vector objects
  17,206,256 bytes for   270,964 instance objects
   4,059,360 bytes for    84,570 symbol objects
   4,966,224 bytes for    81,490 other objects

  65,818,240 bytes for 1,915,482 dynamic objects (space total)

Breakdown for immobile space:
  33,746,064 bytes for  35,484 code objects
   2,711,712 bytes for  65,635 other objects

  36,457,776 bytes for 101,119 immobile objects (space total)

<135>1 2023-04-14T18:31:37Z rs qvm 59001 - - Total time for program run: 15 ms

(Unrelated note: It says avx2 is enabled, but actually those kernels have been disabled since the AVX2 assembly code needs some updating for newer versions of SBCL.)

genos commented 1 year ago

That did it, thanks! Closing.

For future folks, would it be better to change the instructions to not git clone the three repos to ~/quicklisp/local-projects?